var t;
var bln = true;
var count = 0;
var newcount = 0;
var ld = true;


if(document.all)
{
	var str = "<style> .black_overlay { display: none; position: absolute; top: 0px; left: 0px; width: " + (screen.width - 40) + "px; height: 5500px; background-color: #000;  z-index:1001; -moz-opacity: 0.8; opacity:.80; filter: alpha(opacity=80);} ";
}
else
{
		var str = "<style> .black_overlay { display: none; position: absolute; top: 0px; left: 0px; width: " + (screen.width - 20) + "px; height: 5500px; background-color: #000;  z-index:1001; -moz-opacity: 0.8; opacity:.80; filter: alpha(opacity=80);} ";
}

left = (screen.width - imgwidth) / 2;

str += ".white_content_cat {  display: none;  position: absolute;  width: " + (imgwidth + 20) + "px;  height: " + (imgheight + 100) + "px; padding: 3px;  background-color: white;	  z-index:1002;	  overflow: hidden;	  top:50px; 	  left: " + left + "px;	  border:5px solid #000; }</style>";


			
document.write(str);

function loading()
{
		count = 0;
		bln = true;
	if(ld == true)
	{
		if(newcount == 0)
		{
			setIntDn = setInterval("dissolve_in()",100);
		}
		popupbox = document.getElementById("loading");
		
		width = screen.width;
		width = (width - 400)/2;
		document.getElementById("loading").style.left = Number(width) + "px";
		
		height = screen.height;
		height = (height - 105)/2;
		document.getElementById("loading").style.top = Number(height) + "px";
		
		
		popupbox.style.display='block';
		document.getElementById("fade").style.display="block";
		t = setTimeout("loading()", 1000);
		num = 0;

	}
	else
	{
		clearTimeout(t);
		document.getElementById("loading").style.display = 'none';
		appear_box();
	}
	
	newcount++;
	if(newcount == 5)
	{
		ld = false;
	}
}


function appear_box() {

	if(count == 5)
	{
		bln = false;
	}
		
	popupbox = document.getElementById("popup");
	popupbox.style.display='block';
	
	width = screen.width;
	width = (width - 650)/2;
//	document.getElementById("popup").style.left = Number(width) + "px";
	
	
	document.getElementById("fade").style.display="block";
	
	t = setTimeout("appear_box()", 1000);
	num = 0;
	count++;

}
	
function temp()
{
	document.getElementById('popup').style.display='none';
	document.getElementById('fade').style.display='none';
	clearInterval(t);
}


function dissolve_in(){
	popupbox.style.opacity = num/100;
	//popupbox.style.filter='alpha(opacity='+num+')';
	if(num < 110){num=num+15;}
	else{clearInterval(setIntDn);}
}


function swapimage(val)
{
	for(i=1;i<=4;i++)
	{
		if(document.getElementById("moreimage" + i))
		{
			if(i==val)
			{
				document.getElementById("moreimage" + i).style.display='';
			}
			else
			{
				document.getElementById("moreimage" + i).style.display='none';
			}
				
		}
	}
}

function close_lightbox()
{
	document.getElementById('popup').style.display='none';
	document.getElementById('fade').style.display='none';
	ld = true;
	newcount = 0;
	clearInterval(t);
}