var flashvars = {};
flashvars.autostart = "false";
flashvars.backcolor = "444444";
flashvars.frontcolor = "ece5cd";
flashvars.lightcolor = "FFFFFF";
flashvars.screencolor = "000000"; //EEE after debug!
flashvars.gapro = ""; //or google-tracking fails
flashvars.plugins = "gapro-1";
flashvars.gapro.accountid = "UA-3238416-2";
flashvars.gapro.trackstarts = "true";
flashvars.gapro.trackpercentage = "true";
flashvars.gapro.tracktime = "true";

var params = {};
params.menu = "false";
params.allowfullscreen = "true";
params.allowscriptaccess = "always";
var attributes = {};

function fOpenwin(theWidth,theHeight,theUrl) {
	openWin = window.open(theUrl,'fNewWin','status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+theWidth+',height='+theHeight+'');
	openWin.focus();
}
function fPrintPage(theWidth,theNavid,theItemid,theRawurl,theSeminarlang,theSeminarid,theParams) {
	var theUrl = 'print.php?navid='+theNavid+'&url='+theRawurl;
	if (theItemid)			theUrl += '&itemid='+theItemid;
	if (theSeminarlang)		theUrl += '&seminarlang='+theSeminarlang;
	if (theSeminarid)		theUrl += '&seminarid='+theSeminarid;
	if (theParams)			theUrl += theParams;
	printWin = window.open(theUrl,'fPrintWin','status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+theWidth+',height=600');
	printWin.focus();
}
// JQUERY
function mycarousel_initCallback(carousel) { // home-carousel
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};



// AJAX
$(document).ready(function() {
	$("#homeCarousel a.ajaxCall").click(function(e){
		//var theLink	= $(this).attr('href')+'?embed=1';
		var theLink		= 'ext/home-data.php?newsid='+$(this).attr('rel')+'&embed=1';
		var theHeight	= 240;
		$("#home-screen-content").fadeOut("slow", function(){
			$("#home-screen-content").empty();
			$("#home-screen-content").append("<iframe scrolling='no' frameborder='0' hspace='0' src='"+theLink+"' id='contentIframe' name='contentIframe' style='width:960px;height:270px;' onload='iframeFadein()'></iframe>");
			//alert(theLink);
			/*
			$("#home-screen-container").fadeIn('slow');
			$('#home-screen-container').load(theLink, function() { $("#ajaxContent").fadeIn('slow'); });
			*/
		});
		return false;
	});
	$('#homeCarousel a').click(function() {
		this.blur();
	});
});
function iframeFadein() {
	$("#home-screen-content").fadeIn('slow');
}
