// JavaScript Document
//##Abhishek's custom alert effect ##//

var alrtObj;
function dothis(top,left)
{
	//now to hide all selectboxes	
var t=document.getElementsByTagName("select");
//alert(t.length);
for(var i=0;i<t.length;i++)
{
  t[i].style.visibility="hidden"	;
}
//

if(document.getElementById("exa_alert"))
{
alrtObj=document.getElementById("exa_alert");
}
 //alert(document.body.clientWidth);
// alert(document.body.clientHeight);
if(top=="")
{
 top="0";
}
if(left=="")
{
 left="0";
}

//

 var c=document.createElement('div');
 //c.style.backgroundColor="#FF0000"; 
 //c.style.paddingTop=top+"px";
// c.style.paddingLeft=left+"px";
 c.style.position="absolute";  c.style.zIndex="2000";
 c.style.width="60%";
 c.style.height="60%";
if(navigator.appName=="Microsoft Internet Explorer")
{
  c.style.top=top+"%";
  c.style.left=left+"%";
}
else
{
  c.style.top=(top-20)+"%";
  c.style.left=left+"%";	
}
c.id="abhiExadiv1";
//alert(alrtObj);
 c.appendChild(alrtObj); 
 
var d = document.createElement('div');
//d.setAttribute('style', "background:#CCCCCC;");  


d.style.backgroundColor="#CCCCCC";d.style.zIndex="1999";
//alert(document.body.clientHeight);


if(navigator.appName!="Microsoft Internet Explorer")
{
 d.style.width="100%";
	
 d.style.height="100%";	
}
else
{
/*  alert(document.body.offsetTop)	;
  alert(document.body.offsetLeft)	;	
  alert(document.body.offsetHeight)	;	
*/ d.style.width=(document.body.offsetWidth+document.body.offsetLeft)+"px";
 d.style.height=(document.body.offsetHeight+document.body.offsetTop)+"px";
}
d.style.filter="alpha(opacity=45)";
d.style.MozOpacity = 45/ 100;
d.style.position="absolute";
//alert(document.clientHeight);
d.style.top="0px";
d.style.left="0px";
d.id="abhiExadiv2";
window.scrollTo(0,0)
//alert(div.innerHTML);
document.body.appendChild(d);
document.body.appendChild(c);
setTimeout("abfadein('exa_alert','50')",100);

window.onscroll=dothat;
} 
function dothat()
{
 //alert("ad");
 
 window.scrollTo(0,0)
 //window.scrollbars="no";## hi iam working on this, if you know how to get rid of the scrollbar using just script mail me @ exaforms1@gmail.com
}
function exa_alert(txt)
{
	//alert(txt);	
   document.getElementById("exa_alert").style.position="absolute";
document.getElementById("exa_alert").style.top="40%";
 document.getElementById("exa_alert").style.left="50%";
 document.getElementById("alert_text").innerHTML=txt;
  document.getElementById("exa_alert").style.display="block";

  dothis("40","10");
}
function remove_alert()
{
  document.getElementById('abhiExadiv2').parentNode.removeChild(document.getElementById('abhiExadiv2'));
  document.getElementById('abhiExadiv1').parentNode.removeChild(document.getElementById('abhiExadiv1'));
  document.body.appendChild(alrtObj);
  document.getElementById("exa_alert").style.display="none";
  document.getElementById("exa_alert").style.filter="alpha(opacity=0)";
  document.getElementById("exa_alert").style.MozOpacity = 0/ 100;
  window.onscroll=donothing;
  var t=document.getElementsByTagName("select");
//alert(t.length);
for(var i=0;i<t.length;i++)
{
  t[i].style.visibility="visible"	;
}

}
function donothing()
{
	//donot delete this func
}
isloaded("exa_alert");

function isloaded(elem)
{
  if(document.getElementById(elem))
  {
	 document.getElementById("exa_alert").style.MozOpacity = 0/ 100;	

  }
  else
  {
	setTimeout("isloaded('"+elem+"')",1);  
  }
}

//##my internal transition functions, only giving fadein effect and works on most browsers
var abopacity=0;
function abfadein(imgObj,fadeinspeed)
{
abopacity+=5;
if(abopacity<=100 )
{
 document.getElementById(imgObj).style.filter = 'alpha(opacity='+abopacity+')';
 document.getElementById(imgObj).style.MozOpacity = abopacity / 100;
 //document.getElementById(imgObj).style.display="block";
 }
 
 
 if(abopacity<=100)
 {
  setTimeout("abgothruhere('"+imgObj+"')",fadeinspeed);
 } 
 else
 {
	abopacity=0; 
 }
}
//this function is written to act as passthru
function abgothruhere(imgObj)
{
absetopacity(imgObj,abopacity);
}
function absetopacity(obj,abopacity)
{	

	document.getElementById(obj).style.opacity = abopacity / 100;
	document.getElementById(obj).style.MozOpacity = abopacity / 100;
	document.getElementById(obj).style.KhtmlOpacity = abopacity / 100;
	document.getElementById(obj).style.filter = 'alpha(opacity=' + abopacity + ')';
	//alert(document.getElementById(obj).style.filter);
	abfadein(obj,abopacity);
	document.getElementById(obj).style.visibility="visible";
}

//


