function getOpac(flag)
{	 
 var opacCoef=0.8;
 return (flag - 1.0)*opacCoef + 1.0;
}



function dissolve()
{
	if(!isMac)
		setTimeout("Fade('loadingpage', 0.05, 1.0, 0.0, 40, '')", 1500); 
}

function Fade(id, step, value, limit, timeout, executeString)
{
	var element = document.getElementById(id)
	//alert ("Fade('" + id+"', '" + step+"', '"+ value +"', '" + limit+"', '"+ timeout+"', \""+ executeString +"\")");
	if (isIE4){
		  newOpacity = value * 100 ;
		  element.style.filter = "alpha(opacity="+newOpacity+")";
	  } else if (isCSS){
		  element.style.MozOpacity = value;
	  }
	 	  value = parseFloat(step) + parseFloat(value);
	  if (step > 0 && value < limit || step < 0 && value > limit)
	  	  setTimeout("Fade('" + id+"', '" + step+"', '"+ value +"', '" + limit+"', '"+ timeout+"', \""+ executeString +"\")", timeout);
	  
	  else {
	  	  if (executeString != "") {
	  			setTimeout(executeString,10);
	  		}
	  }
}
function ZoomIn(id, initScale)
{
var elem = document.getElementById(id)
var left = elem.offsetLeft;
var top = elem.offsetTop;
var width = elem.offsetWidth;
var height = elem.offsetHeight;
top = top - (height - 480)/2;
left = left - (width - 640)/2;
elem.style.top = top+"px";
elem.style.left = left+"px";
elem.style.zIndex = 1200;
elem.style.visibility = "visible";
Fade (id, 0.1, 0, 1, 40, "pauseSplash()");
}

function pauseSplash()
{
	setTimeout("fadeSplash()",2500);
}
function ZoomIn_(id, initScale)
{
var elem = document.getElementById(id)
var left = elem.offsetLeft;
var top = elem.offsetTop;
var width = elem.offsetWidth;
var height = elem.offsetHeight;
top = top - (height - 480)/2;
left = left + (640  - width)/2;
sniffBrowser();
elem.style.visibility = "visible";
elem.style.top = parseInt(top - (initScale-1)*height/2)+"px";;
elem.style.left = parseInt(left - (initScale-1)*width/2)+"px";

 ZoomDown (id,3, width*initScale, height*initScale, width, 10, "fadeSplash()");
}

function ZoomDown (id, step, width, height, limit, timeout, executeString)
{
	var element = document.getElementById(id);
	element.style.width = width;
	element.style.height= height;
	
	nextXStep += parseFloat(step / 2);
	nextYStep += parseFloat(step * parseFloat(height / (2 * width)));
	moveElem(element,"top", nextYStep  );
	moveElem(element,"left", nextXStep  );
	width -= 2*parseInt(nextXStep);
	height -= 2*parseInt(nextYStep);
	nextXStep -= parseInt(nextXStep);
	nextYStep -= parseInt(nextYStep);
	timeout = timeout*0.95;
	if (step < 0 && width < limit || step > 0 && width> limit)
	  	  setTimeout("ZoomDown ('" + id+"', '" + step+"', '"+ width +"', '"+ height +"', '" + limit+"', '"+ timeout+"', \""+ executeString +"\")", timeout);
	 else {
	  	 if (executeString != "") {
	  			setTimeout(executeString,4000);
	  		}
	  }

}

function hideSplash()
{
	document.getElementById("splash1").style.display="none";
}

function fadeSplash() 
{
	document.getElementById("loadingpage").style.display="none";
	staticTable = document.getElementById("agentNameTableStatic");
	staticTable.className="fadingSplash";
	staticTable = document.getElementById("addressTableStatic");
	Fade('pctr', -0.05, 1.0, 0.0, 60, '');
	FadeClass(".fadingSplash", -0.05, 1.0, 0, 40, "hideSplash()");

//

}
function FadeClass(classid, step, value, limit, timeout, executeString)
{
   styleclass = getStyleFromSheets(classid); 
	if (isIE4){
		  newOpacity = value * 100 ;
		  styleclass.style.filter = "alpha(opacity="+newOpacity+")";
	  } else{
		  styleclass.style.MozOpacity = value;
	  }
	 	  value = parseFloat(step) + parseFloat(value);
	  if (step > 0 && value < limit || step < 0 && value > limit){
	  	  setTimeout("FadeClass('" + classid+"', '" + step+"', '"+ value +"', '" + limit+"', '"+ timeout+"', \""+ executeString +"\")", timeout);
	  	  }
	  
	  else {
	  	  if (executeString != "") {
	  			setTimeout(executeString,10);
	  		}
	  }
}<!-- 
 --><!-- 
 -->
