// JavaScript Document
var oldid="";
	function closediv(url)
	{
		document.getElementById('d1').style.display = 'none';
		document.test.src='img/blank.gif';
	}

	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 opendiv(url,w,h)
	{
		var str=document.test.src;
		if (!str.match(url))
		{
			document.getElementById('d1').style.background= '#f5f5e8 no-repeat center url(\'img/loader.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 = Number(document.getElementById("body").offsetWidth);
			
			var iWidth=w;
			var iHeight=h;
			var iRealWidth = iWidth ? iWidth : 800 ;
			var iRealHeight = iHeight ? iHeight : screen.height - 30 ;
			var iLeft = Math.round ((screenWidth-w) / 2);
			
			scrtop=document.documentElement.scrollTop;
			document.getElementById('d1').style.marginTop=scrtop+50+"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;
	}
