if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  
function funHeight() {
            var contentHeight = document.getElementById("t_wrapper").offsetHeight;
            
            if (myHeight > contentHeight) {
                document.getElementById("footer").style.position = "absolute";
                document.getElementById("footer").style.bottom = "20px";
				document.getElementById("footer").style.right = (myWidth-984)/2;
            }
        }
		
		
		
		
		
function popUp(URL) {
	day = new Date();
	id = day.getTime();
	var width  = 835;
	var height = 700;
	var left   = (screen.width  - width)/2;
	var top    = (screen.height - height)/2;

	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width='+width+',height='+height+',top='+top+',left='+left);");
	}
	
function popUpSize(URL, width, height) {
	day = new Date();
	id = day.getTime();
	//var width  = 815;
	//var height = 790;
	var left   = (screen.width  - width)/2;
	var top    = (screen.height - height)/2;

	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width='+width+',height='+height+',top='+top+',left='+left);");
	}
	
	
	function order() {
		var url;
		if(document.order1.o.value == "0")
		{
			url = "/tutorials/";
		}
		else
		{
			url = "/tutorials/" + document.order1.o.value;
		}
		document.location.href = url;
	}
	
	if (document.images) 
	{
	   img1 = new Image();
	   img2 = new Image();
	   img3 = new Image();
	   img4 = new Image();
	   img5 = new Image();
	   img6 = new Image();
	   img1.src = "/images/gradiant.png";
	   img2.src = "/images/g_hover.png";
	   img3.src = "/images/devider.png";
	   img4.src = "/images/logo_g.png";
	   img5.src = "/images/ajax-loader.gif";
	   img6.src = "/images/search.png";
	}
	
function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1; 
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
return "";
}

function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function checkCookie()
{
	document.getElementById('qt').style.display="none";
	document.getElementById('flash').style.display="none";
player=getCookie('player');

if (player!=null && player!="")
  {
	if(player=='flash')
	{
		document.getElementById('flash').style.display="block";
	}
	if(player=='qt')
	{
		document.getElementById('qt').style.display="block";
	}
	}
  	else 
  	{
  	player="flash";
  if (player!=null && player!="")
    {
    setCookie('player',player,365);
	checkCookie();
    }
  }
}

function swapTwoDivs(div1, div2, displayMethod)
{
	displayMethod = displayMethod || "block";
		
	document.getElementById(div1).style.display = "none";
	document.getElementById(div2).style.display = displayMethod;
}