var isPicOver = false;
var lastEl = false;        

function showLayer( elName )
{
    var el 			= document.getElementById( elName + "Pic" );
	var tpEl		= document.getElementById( "tpBody" );
	var bpEl		= document.getElementById( "bpBody" );
	var wpEl		= document.getElementById( "wpBody" );
	var ipEl		= document.getElementById( "ipBody" );
	var platformEl	= document.getElementById( "platformBody" );
	var tpPic		= document.getElementById( "tpPic" );
	var bpPic		= document.getElementById( "bpPic" );
	var wpPic		= document.getElementById( "wpPic" );
	var ipPic		= document.getElementById( "ipPic" );
	var platformPic	= document.getElementById( "platformPic" );
	
	var prodArrow	= document.getElementById( "productArrow" );
	
	if( el.style.display!="inline" )
	{
        try
		{
			tpPic.style.display			= "none";
			bpPic.style.display			= "none";
			wpPic.style.display			= "none";
			ipPic.style.display			= "none";
			platformPic.style.display	= "none";
			el.style.display			= "inline";
		
			tpEl.style.display			= "none";
			bpEl.style.display			= "none";
			wpEl.style.display			= "none";
			ipEl.style.display			= "none";
			platformEl.style.display	= "none";
			eval( elName + 'El.style.display = "block";' );
			prodArrow.style.display = "inline";
			if( !document.all )
				document.body.style.overflow = "scroll";
		}
		catch(e)
		{
			alert(e.description);
		}
		return;
	}
    //else//else if( !isPicOver )
	{
        el.style.display			= "none";
		tpEl.style.display			= "block";
		bpEl.style.display			= "block";
		wpEl.style.display			= "block";
		ipEl.style.display			= "block";
		platformEl.style.display	= "block";
		prodArrow.style.display 	= "none";
	}
}  

function moveBottom()
{
	alert(1);
}

function fadeIn( el )
{
	if( el )
	{
		fadeVal = 70;
		fadeEl = el;
	}
	
	if( fadeVal<=99 )
	{
		fadeVal+=4;
		fadeEl.style.opacity 	= "0."+fadeVal;
		fadeEl.style.filter		= "alpha(opacity=" + fadeVal + ")";
		setTimeout( "fadeIn()", 50 );
	}
	else
	{
		fadeEl.style.opacity 	= "1";
		fadeEl.style.filter		= "alpha(opacity=100)";
	}
}

function checkForm()
{
    var frm = document.forms('theForm');
    var oki = true;
    
    email = new String( frm.email.value );
    hasat = email.indexOf ( '\@' );
    
    if ( frm('firstName').value == '' )
    {
       oki = false;
       alert('You have to enter your first name.');
       frm('firstName').focus();
    }
    else if ( frm('lastName').value == '' )
    {
       oki = false;
       alert('You have to enter your last name.');
       frm('lastName').focus();
    }
    
    else if( !email.match("^[^@]+@[^@.]+\.+[^@.]+$") )
    {
       oki = false;
       alert('Your email adress is not correct');
       frm('email').focus();
    }
                                   
     return oki;
}

function imgPopup(url,x,y)
{   
   	MyWin = window.open("","","width=" + x + ",height=" + y + ",toolbar=no,location=no,directories=no,status=no,menubar=yes");
   	with(MyWin.document){
   	open();
   	write("<html>\n<meta http-equiv=imagetoolbar content=no>\n<head>\<title>www.scriptserver.com</title>\n</head>\n<body marginwidth=0 marginheight=0 leftmargin=0 topmargin=0 rightmargin=0>\n");
   	write("<img src=\"" + url + "\" width=\"" + x + "\" height=\"" + y + "\">\n");
   	write("</body>\n</html>\n");
   	close();
   	}
}

function init()
{
	getWebCastTime();
	fixObjects();
}

// AJAX
	var XMLHttp	= null;
	
	function GetXmlHttpObject( )
	{ 
		try
		{
			XMLHttp = new ActiveXObject( "Msxml2.XMLHTTP" );
		}
		catch(e)
		{
		 	try
		 	{
		 		XMLHttp = new ActiveXObject( "Microsoft.XMLHTTP" );
		 	}
			catch(e){}
		}
		
		if( XMLHttp==null )
		{
			XMLHttp = new XMLHttpRequest();
		}
		
		return XMLHttp;
	}
	
	function getWebCastTime()
	{
		window.setTimeout( "getWebCastTime()", 1000 );
		
		xmlHttp = GetXmlHttpObject();
		if( xmlHttp==null )
		{
			//alert( "Sorry, but your browser limits you not to be able to buy on this site" );
			return;
		}
		
		var url = "/websys/getWebCastTime";
		url += "?sid="+Math.random();
		
		xmlHttp.onreadystatechange=renderWebCastTime;
		xmlHttp.open( "GET",url,true );
		xmlHttp.send( null );
	}
	
	function renderWebCastTime() 
	{ 
		if( xmlHttp.readyState==4 || xmlHttp.readyState=="complete" )
		{
			try
			{
				var responseTxt = xmlHttp.responseText;
				var txtSplit = responseTxt.split( "\t" );
				var contDown10 	= txtSplit[0];
				var contDown6 	= txtSplit[1];
				
				var el_10 	= document.getElementById( "w3ss_webCastTime10" );
				var el_6 	= document.getElementById( "w3ss_webCastTime6" );
				
				el_10.innerHTML	= contDown10;
				el_6.innerHTML 	= contDown6;
			}
			catch(e){}
		}
	} 
	
	function fixObjects()
	{
		objects = document.getElementsByTagName("object");
		for (var i = 0; i < objects.length; i++)
		{
		    objects[i].outerHTML = objects[i].outerHTML;
		}
	}