var NS4 = (navigator.appName.indexOf("Netscape")>=0 && !document.getElementById)? true : false;
var IE4 = (document.all && !document.getElementById)? true : false;
var IE5 = (document.getElementById && document.all)? true : false;
var NS6 = (document.getElementById && navigator.appName.indexOf("Netscape")>=0 )? true: false;
var W3C = (document.getElementById)? true : false;
var ieop1=0;
var op_id1=0;

function incropacity1(obj1){	
	if(ieop1<=100){
		ieop1+=10;
		if(IE4 || IE5)obj1.style.filter="alpha(opacity="+ieop1+")";
		if(NS6)obj1.style.MozOpacity=ieop1/100;
		op_id1=setTimeout(function(){incropacity1(obj1)}, 20);
	}
}

function decropacity1(obj1){		
	if(ieop1>=0){
		ieop1-=10;
		if(IE4 || IE5)obj1.style.filter="alpha(opacity="+ieop1+")";
		if(NS6)obj1.style.MozOpacity=ieop1/100;
		op_id1=setTimeout(function(){decropacity1(obj1)}, 20);
	} 
	
	if (ieop1<1){
		obj1.style.display="none";
	}
}

function getposOffset(overlay, offsettype){
	var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
	var parentEl=overlay.offsetParent;
	while (parentEl!=null){
		totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
		parentEl=parentEl.offsetParent;
	}
	return totaloffset;
}

function overlay(curobj1, subobjstr1, opt_position1){
	if (document.getElementById){
		var subobj1=document.getElementById(subobjstr1)
		
		if(IE4 || IE5) {
			opac_str1 = subobj1.style.filter;
			opc_value1 = parseInt(opac_str1.substr(14, 2));
						
			if (opc_value1 <= 0 || isNaN(opc_value1)){
				ieop1 = 0;
				subobj1.style.display="block"
			} else {
				ieop1 = 90;
			}
			
			offsetX = 0;
			offsetY = 7;
		}
		
		if(NS6) {
			if (subobj1.style.opacity <= 0){
				ieop1 = 0;
				subobj1.style.display="block"
			} else {
				ieop1 = 100;
			}
			offsetX = 0;
			offsetY = 0;
		}
				
		var xpos=getposOffset(curobj1, "left")+((typeof opt_position1!="undefined" && opt_position1.indexOf("right")!=-1)? -(subobj1.offsetWidth-curobj1.offsetWidth) : 0)
		var ypos=getposOffset(curobj1, "top")+((typeof opt_position1!="undefined" && opt_position1.indexOf("bottom")!=-1)? curobj1.offsetHeight : 0)
		subobj1.style.left=(xpos+offsetX)+"px"
		subobj1.style.top=(ypos-offsetY)+"px"				
				
		if (ieop1 == 0){
			incropacity1(subobj1);
		} else {
			decropacity1(subobj1);
		}
	
		return false
	}
	else
	return true
}

function overlayclose(subobj1){
	//document.getElementById(subobj1).style.display="none"
	decropacity1(document.getElementById(subobj1));
	//subobj1.style.display="none";
}