var next = 0;
var nextSc = 0;
var switchh = true;
var start = true;
function rotateHeader() {
	headerMain = '<img src="gfx/header_bg_company.gif" alt="xsl:easy"/>';
	
	headerBanner1 =  '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="667" height="103">' +
				     '<param name="movie" value="banners/1_conventional.swf" />' +
					 '<param name="quality" value="high" />' +
				     '<embed src="banners/1_conventional.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="667" height="103"></embed>' + 
					 '</object>';
	headerBanner2 =  '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="667" height="103">' +
				     '<param name="movie" value="banners/2_visual_bez_sipiek.swf" />' +
				     '<param name="quality" value="high" />' +
				     '<embed src="banners/2_visual_bez_sipiek.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="667" height="103"></embed>' +
					 '</object>';
					 
	headerBanner3 = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="667" height="103">' + 
			      	 '<param name="movie" value="banners/3_easy.swf" />' +
			   	     '<param name="quality" value="high" />' +
				     '<embed src="banners/3_easy.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="667" height="103"></embed>' +
					 '</object>';
	headerBanner4 =  '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="667" height="103">' +
					 '<param name="movie" value="banners/4_extensible.swf" />' +
					 '<param name="quality" value="high" />' +
				     '<embed src="banners/4_extensible.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="667" height="103"></embed>' +
					 '</object>';
	logo1 = '<img id="logo" src="gfx/logo.gif" alt="xsl:easy" />';
			
	logo2 = '<img id="logo2" src="gfx/logo2.gif" alt="xsl:easy" />';

	if(next == 0 || switchh){
		document.getElementById("DynamicContent").innerHTML = headerMain;
		//document.getElementById("dynLogo").innerHTML = logo1;
		//document.getElementById("header").style.background = "#F3F5F7";
				
		if (next == 0) next = 2;
		switchh = !switchh;
				
		if (!start) {
			setTimeout('rotateScreenshot()', 3000);
			setTimeout('rotateHeader()', 12000);
		}
		else {
			start = false;
			setTimeout('rotateHeader()', 2500);
			nextSc = 1;
		}	
	}
//	else if(next == 1 && !switchh){
//		document.getElementById("DynamicContent").innerHTML = headerBanner1;
//		document.getElementById("dynLogo").innerHTML = logo2;
//		document.getElementById("header").style.background = "#FFFFFF";
//		
//		next = 2;
//		switchh = !switchh;
//		setTimeout('rotateHeader()', 14200);
//	}
	else if(next == 2 && !switchh){
		document.getElementById("DynamicContent").innerHTML = headerBanner2;
		//document.getElementById("dynLogo").innerHTML = logo2;
		//document.getElementById("header").style.background = "#FFFFFF";
		
		next = 3;
		//switchh = !switchh;
		setTimeout('rotateHeader()', 24000);
		setTimeout('rotateScreenshot()', 15000);
	}
	else if(next == 3 && !switchh){
		document.getElementById("DynamicContent").innerHTML = headerBanner3;
		//document.getElementById("dynLogo").innerHTML = logo2;
		//document.getElementById("header").style.background = "#FFFFFF";
		
		next = 4;
		//switchh = !switchh;
		setTimeout('rotateHeader()', 24000);
		setTimeout('rotateScreenshot()', 15000);
	}
	else if(next == 4 && !switchh){
		document.getElementById("DynamicContent").innerHTML = headerBanner4;
		//document.getElementById("dynLogo").innerHTML = logo2;
		//document.getElementById("header").style.background = "#FFFFFF";
		
		next = 2;
		//switchh = !switchh;
		setTimeout('rotateHeader()', 25000);
		setTimeout('rotateScreenshot()', 16000);
	}

}

function rotateScreenshot() {
	sc1 = '<a href="images.php?image=01_des_xpath_mappings.jpg&dir=design" target="image" onclick="window.open(&#39;image.php?image=des_xpaths.jpg&#39;, &#39;image&#39;, &#39;width=100, height=100, left=100, top=100, dependent=yes, location=no, menubar=no, resizable=no, status=no, toolbar=no&#39;);true;">  <img style="padding: 5px 40px 10px 0px; margin-top: 10px; float: left" src="gfx/screenshots/sc1.png" alt="xsl:easy" title="xsl:easy" width="400" height="300" align="right" /></a>';
	sc2 = '<a href="images.php?image=07_des_autocompletion.jpg&dir=design" target="image" onclick="window.open(&#39;image.php?image=des_xpaths.jpg&#39;, &#39;image&#39;, &#39;width=100, height=100, left=100, top=100, dependent=yes, location=no, menubar=no, resizable=no, status=no, toolbar=no&#39;);true;">  <img style="padding: 5px 40px 10px 0px; margin-top: 10px; float: left" src="gfx/screenshots/sc2.png" alt="xsl:easy" title="xsl:easy" width="400" height="300" align="right" /></a>';
	sc3 = '<a href="images.php?image=08_ext_db_reader.jpg&dir=extend" target="image" onclick="window.open(&#39;image.php?image=des_xpaths.jpg&#39;, &#39;image&#39;, &#39;width=100, height=100, left=100, top=100, dependent=yes, location=no, menubar=no, resizable=no, status=no, toolbar=no&#39;);true;">  <img style="padding: 5px 40px 10px 0px; margin-top: 10px; float: left" src="gfx/screenshots/sc3.png" alt="xsl:easy" title="xsl:easy" width="400" height="300" align="right" /></a>';
	sc4 = '<a href="images.php?image=06_des_dragndrop.gif&dir=design" target="image" onclick="window.open(&#39;image.php?image=des_xpaths.jpg&#39;, &#39;image&#39;, &#39;width=100, height=100, left=100, top=100, dependent=yes, location=no, menubar=no, resizable=no, status=no, toolbar=no&#39;);true;">  <img style="padding: 5px 40px 10px 0px; margin-top: 10px; float: left" src="gfx/screenshots/sc4.png" alt="xsl:easy" title="xsl:easy" width="400" height="300" align="right" /></a>';
	
	mainScreenshot = document.getElementById("idScreenshot");
	
	if (nextSc == 0) {
		if (mainScreenshot != null)	
			document.getElementById("idScreenshot").innerHTML = sc1;
		nextSc = 1;
	}
	else
	if (nextSc == 1) {
		if (mainScreenshot != null)	
			document.getElementById("idScreenshot").innerHTML = sc2;
		nextSc = 2;
	}
	else
	if (nextSc == 2) {
		if (mainScreenshot != null)	
			document.getElementById("idScreenshot").innerHTML = sc3;
		nextSc = 3;
	}
	else
	if (nextSc == 3) {
		if (mainScreenshot != null)		
			document.getElementById("idScreenshot").innerHTML = sc4;
		nextSc = 0;
	}
}