// JavaScript Document
var oldid="";
var DivWidth="";
var DivHeight="";
	function closediv(url)
	{
		document.getElementById('d1').style.display = 'none';
		document.test.src='img/blank.gif';
		document.getElementById('tickets-video').style.visibility= 'visible';
	}

	function select_div(id)
	{
		if(oldid=="")
		{	oldid=id;
			document.getElementById(id).className="bag act";

		}
		else
		{
			document.getElementById(oldid).className="bag";
			document.getElementById(id).className="bag act";
			oldid=id;
		}
	}

	function posediv()
	{
			$ScreenWidth=document.getElementById("body").offsetWidth;
			iWidth=DivWidth;
			iHeight=DivHeight;

			var iRealWidth = iWidth ? iWidth : 800 ;
			var iRealHeight = screen.height/4 ;
			var iLeft = Math.round (($ScreenWidth-iWidth) / 2)-23;

			scrtop=document.documentElement.scrollTop;
			document.getElementById('d1').style.marginTop=scrtop+iRealHeight+"px";
			document.getElementById('d1').style.marginLeft= iLeft+"px";
	}
	$BigIter=0;
	function opendiv(url,w,h)
	{

		$BigIter++;
		url=url+"?"+$BigIter;
		var str=document.test.src;
		if (!str.match(url)){

			document.getElementById('d1').style.background= '#fff no-repeat center url(\'img/loading.gif\')';
			document.test.style.opacity = 0;
			document.test.style.filter = 'alpha(opacity=0)';
			document.test.style.MozOpacity = 0;
			document.getElementById('d1').style.display = '';
			
			document.test.src=url;
			document.test.width=w;
			document.test.height=h;

			$ScreenWidth=document.getElementById("body").offsetWidth;

			var iWidth=w;
			var iHeight=h;
			DivWidth=w;
			DivWidth=w;
			var iRealWidth = iWidth ? iWidth : 800 ;
			var iRealHeight = screen.height/4 ;

			var iLeft = Math.round (($ScreenWidth-w) / 2)-23;


			scrtop=document.documentElement.scrollTop;
			document.getElementById('d1').style.marginTop=scrtop+iRealHeight+"px";
			document.getElementById('d1').style.marginLeft= iLeft+"px";

		}
	}

	function initAppear(){
		for (var i=0;i<11;i++){
			setTimeout('setOpacity('+i+')',35*i);
		}
		document.getElementById('d1').style.background= '#000000';
		return false;
	}

	function setOpacity(value){
		document.test.style.opacity = value/10;
		document.test.style.filter = 'alpha(opacity=' + value*10 + ')';
		document.test.style.MozOpacity = value/10;
	}
	function tics()
	{
		document.getElementById('tickets-video').style.visibility='hidden';
	}