var ie5  = (document.all && document.getElementById);
var ns6 = (!document.all && document.getElementById && !window.opera);
var opera=(window.opera||(window.opera && window.getSelection));
var opac3 = 0;
var OK = false;

function iagree(tp)
{
	
	showhideLayer('dvDiscl');
	if(tp==1)
	{
		OK = true;
		document.frm.submit();
	}
	else
	{
		OK = false;
	}
}
function chkDiscl(tp)
{

	if(!OK)
	{
		var arr = getPageSize(); 
		var top = parseInt(arr[3]/2 -100);
		var left = parseInt(arr[2]/2 -250);

		document.getElementById('dvDiscl').style.top = 	top+'px';
		document.getElementById('dvDiscl').style.left =	left+'px';

		showhideLayer('dvDiscl');

		return false;
	}
	else
	{
		return true;
	}
	
}

function getPageSize()
{
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else {
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	var windowWidth, windowHeight;
	if (self.innerHeight) {
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) {
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}
	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}

function showhideLayer(divid){
if(divid!="")
{
	id=document.getElementById(divid);
	if (id.style.display=="block")
	{
		opac3 = 100;
		if (!opera){opacOut(divid);}
		else{ id.style.display="none"; }

	}
	else
	{
		opac3 = 0;
		if (!opera){opacIn(divid);}
		if (opera && window.getSelection){id.style.opacity = 1;}
		id.style.display="block";

	}
}
}
function opacIn(divid) {
	if(opac3 != 100){
		opac3+=5;
		if(ie5) {document.getElementById(divid).filters.alpha.opacity = opac3;}
		//if(ie5) {document.getElementById(divid).style.filters = 'alpha(opacity='+opac3+')';}
		
		if(ns6) {document.getElementById(divid).style.MozOpacity = opac3/100;}
		setTimeout('opacIn("'+divid+'")', 10);
		}
}
function opacOut(divid) {
	if(opac3 > 0){
		opac3-=5;
		if(ie5) {document.getElementById(divid).filters.alpha.opacity = opac3;}
		//if(ie5) {document.getElementById(divid).style.filters = 'alpha(opacity='+opac3+')';}
		
		if(ns6) {document.getElementById(divid).style.MozOpacity = opac3/100;}
		setTimeout('opacOut("'+divid+'")', 10);
		}
		else{document.getElementById(divid).style.display="none";}
}
