// JavaScript Document

var image1;
function changeImg(obj)
{
	if(obj.alt == "plus"){
		obj.src = "images/open-icon.gif";
		obj.alt = "minus"
	}
	else{
		obj.src = "images/close-icon.gif";
		obj.alt = "plus";
	}	
	return true;
}
function aa(zap) {

 if (document.getElementById) {
 var abra = document.getElementById(zap).style;
 if (abra.display == "block") {
 abra.display = "none";
 } else {
 abra.display = "block";
 }
 return false;
 } else {
 return true;
 }

} // mmLoadMenus()

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}




function ShowSearch()
{
show('search');
}
var actualheight;
	var current_div;
	function  init(divid)
	{
	//alert("trying to set Initial props for " +divid);
	try{
	if(document.getElementById(divid).offsetHeight)
	{
	actualheight=document.getElementById(divid).offsetHeight;
	//alert(actualheight);
	}
	else
	{

		actualheight=600;

	//alert("i am unable to find the height of "+ divid);
	}
	//alert ("trying to set height of div to 0");
	document.getElementById(divid).style.height=0+'px';
	document.getElementById(divid).style.display="none";
	}
	catch(e)
	{
	//actualheight=300;
	//alert(e);
	}
	//alert(actualheight);

	}
var i=0;

	function show(divid,top)
	{
	if(divid)
	{
	current_div=divid;
	}

	var divid=current_div;
	document.getElementById(divid).style.display="block";
	document.getElementById(divid).style.height=i+'px';
	i=i+15;
	if(i<actualheight)
	{
	setTimeout("show()",1);
	}
	else
	{
	document.getElementById(divid).style.height=actualheight+'px';
	}
	}

	var j=0;
	function hide(divid)
	{
	try{
	if(divid)
	{
	current_div=divid;
	}
	divid=current_div;
	//alert('Trying to hide '+ divid);
	if(document.getElementById(divid).offsetHeight)
	{
	j=document.getElementById(divid).offsetHeight;
	if(j>0)
	{
	j=j-15;
	}
	if(j<=0)
	{
	j=0;
	i=0;
	//alert("setting height to 0");
	document.getElementById(divid).style.height=0+'px';
	document.getElementById(divid).style.display="none";

	//document.getElementById(divid).style.top=-85+'px';
	//alert("successfully set height to 0");
	}
	else
	{
	document.getElementById(divid).style.height=j+'px';
	setTimeout("hide()",0);
	}
	}

	}catch(e)
	{
	//alert(e);
	}
	}
	
	

var ie=document.all
var dom=document.getElementById
var ns4=document.layers
var calunits=document.layers? "" : "px"

var bouncelimit=8 //(must be divisible by 8)
var direction="up"
function logoinitbox(){
if (!dom&&!ie&&!ns4)
return
crossobj=(dom)?document.getElementById("logodropin").style : ie? document.all.dropin : document.dropin
scroll_left=(ie)? truebody().scrollLeft : window.pageXOffset
crossobj.left=scroll_left-250+calunits
crossobj.display=(dom||ie)? "block" : "block"
dropstart=setInterval("dropin()",50)
}

function dropin(){
scroll_left=(ie)? truebody().scrollLeft : window.pageXOffset
if (parseInt(crossobj.left)<0+scroll_left)
crossobj.left=parseInt(crossobj.left)+40+calunits
else{
clearInterval(dropstart)
bouncestart=setInterval("bouncein()",50)
}
}

function bouncein(){
crossobj.left=parseInt(crossobj.left)-bouncelimit+calunits
if (bouncelimit<0)
bouncelimit+=8
bouncelimit=bouncelimit*-1
if (bouncelimit==0){
clearInterval(bouncestart)
}
}

function dismissbox(){
if (window.bouncestart) clearInterval(bouncestart)
crossobj.display="none"
}

function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function show1()
{
if(document.getElementById("chek").checked==true)
{
  document.getElementById("fn").style.display = "block";
}
else
document.getElementById("fn").style.display = "none";
}






function printarticle()
{
document.getElementById("header-container").style.display="none";
document.getElementById("contactpage-content").style.display="none";
document.getElementById("left-nevi").style.display="none";
document.getElementById("content").style.float = "left";
document.getElementById("mast-container").style.width = "710px";
document.getElementById("print").style.display="none";
document.getElementById("footer").style.display="none";
window.print()
}
function displaysavemenu()
{
document.getElementById('selectsaveplan').style.display = "block"; 
}

function valid()
{
if(document.post.subject.value=="")
  {
  alert("Please enter subject");
  document.post.subject.focus();
  return false;
  }
  if(document.post.message.value=="")
  {
  alert("Please enter message");
  document.post.message.focus();
  return false;
  }
  if(document.post.txtCaptcha.value=="")
  {
  alert("Please enter security code");
  document.post.txtCaptcha.focus();
  return false;
  }
  else{
     getParam(document.post)
     if(document.getElementById('result').value=='fail')
      {
	   alert('Please enter correct security code.');
	   document.post.txtCaptcha.value='';
	   document.post.txtCaptcha.focus();
       return false; 
	  }
  }
  return true;
  }
  
  
function clickclear(thisfield, defaulttext) {
if (thisfield.value == defaulttext) {
thisfield.value = "";
}
}

function clickrecall(thisfield, defaulttext) {
if (thisfield.value == "") {
thisfield.value = defaulttext;
}
}


