// JavaScript Document
function closediv(url,w,h){
	
	//show all select elements
	if (document.all && !window.opera){
		for (var j=0; j<document.getElementsByTagName("select").length; j++) {
			document.getElementsByTagName("select")[j].style.visibility = 'visible';
		}
	}
	
	document.getElementById('d2').style.display = 'none';
	document.test.src='img/blank.gif';
}

function opendiv(url,w,h){

	var str=document.test.src;
	if (str.match(url)){
		return false;
	}
		
	//hidden all select elements
	if (document.all && !window.opera){
		for (var j=0; j<document.getElementsByTagName("select").length; j++) {
			document.getElementsByTagName("select")[j].style.visibility = 'hidden';
		}
	}
		
	document.test.style.opacity = 0;
	document.test.style.filter = 'alpha(opacity=0)';
	document.test.style.MozOpacity = 0;
	document.getElementById('d2').style.display = '';
	
	document.test.src=url;
	document.test.width=w;
	document.test.height=h;
	
	var iWidth=w;
	var iHeight=h;
	var iRealWidth = iWidth ? iWidth : 800 ;
	var iRealHeight = iHeight ? iHeight : screen.height - 30 ;
	var iLeft = Math.round ((screen.width - iRealWidth) / 2)-23;
	var iTop =  Math.round ((screen.height - iRealHeight) / 2) - 80 ;
	document.getElementById('d2').style.left= iLeft ;	
  
	if(document.all) {
		document.getElementById('d2').style.top= iTop + document.body.scrollTop;
	}
	else if(document.getElementById) {
		document.getElementById('d2').style.top= iTop + window.pageYOffset;
	}
}

function initAppear(){
	for (var i=0;i<11;i++)
		setTimeout('setOpacity('+i+')',35*i);
	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;
}