 function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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 MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//************* Functions ****************///
function open_win(a,b,c)
{
	op=window.open(a,b,c);
	op.focus();
}
function openwin(a,b,c)
{
	ab=window.open(a,b,c)
	ab.focus();
} 
 
function chec(val,id,con)
{
	va=document.getElementById(id).value;
	if(con=="1")
	{	
		if(va=="Username" || va=="Password")
		{
			document.getElementById(id).value="";
			return true;		
		}
	}	
	else
	{
		if(va=="")
			{
				document.getElementById(id).value=val;
				return true;
			}
	}
}
function chk_url()
{
	ur=document.getElementById("textfield3").value;
	var url=/http:\/\/[A-Za-z0-9\.-]{3,}\.[A-Za-z]{3}/;
	
	if(url.test(ur)==false)
	{
		alert('Please enter valid URL');
		return false;
	}
	else
	{
	 
		return true;
	}	

}
function ref()
{
	document.location.href="http://www.webalue.com/";
}
function RefreshImage(valImageId) {
	var objImage = document.images[valImageId];
	if (objImage == undefined) {
		return;
	}	
	var now = new Date();
	objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString();
	return false
}

function ch_form()
{
 	
	var email_chk=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	em=document.getElementById("email").value;
	nam=document.getElementById("nam").value;
	des=document.getElementById("desc").value;
	subject=document.getElementById("subject").value;
	
	msg="";
	if(nam=="")
		msg=msg+" Please enter your name \n";
	
	if(email_chk.test(em)==false)
		msg=msg+" Please enter valid email \n";
		
	 if(des=="")
		msg=msg+" Please enter description \n";	

	 
	if(subject=="")
		msg=msg+" Please enter  subject \n";	
	
 
	if(msg!="")
	{
	
		alert(msg);
		return false;
	}
	else
	{
		document.frm_co.action="contact_us1.asp";
		return true;
	}	
}


function ch()
 {
 	var reg=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	te=document.getElementById("email").value;
	if(reg.test(te))
	{
		document.fr_se.action="forget_password1.asp";
		return true;
		}
	else
	{
		alert("Please enter correct email address")	
		return false;
		}
 }
 
 
 function limitText(limitField, limitCount, limitNum) {
	if (limitField.value.length > limitNum) {
		limitField.value = limitField.value.substring(0, limitNum);
	} else {
		limitCount.value = limitNum - limitField.value.length;
	}
}


function sh(a,b,d)
{
 
	c=document.getElementById(b).value;
	if(c==a)
		document.getElementById(b).value="";

	c=document.getElementById(b).value;
	if(d==2)
	{
	if(c=="")
		document.getElementById(b).value=a;
	}	
	return true;		
}

function display_text(a,b)
{
	Effect.toggle('text_view', 'blind', { duration: a });
	return false;
}
function addnew(a,b,c)
{
	af=window.open(a,b,c)
	af.focus();
} 
function div_link(a)
 {
 	
 	if(a=="1")
	{	
	  document.getElementById("sub_link").style.display="block";
		// Effect.Grow('sub_link');
	}
	else
	{
	//Effect.toggle('sub_link', 'slide', { delay: 0.5 });
	    document.getElementById("sub_link").style.display="none";
	//	Effect.Fold('sub_link');
	}
		
 	return false;
 }
 
 function display_graph(a,b)
{
	Effect.toggle(b, 'blind', { duration: a });
	return false;
}
 function index_fun()
 {
	 adf=$("siteid").value;
	if(adf!="" && adf!=null && !isNaN(adf))
	{ 
		asd=$("dd")
		asd.style.display="block";
		asd.className="white_content";
		asd1=$("onew1")
		asd1.className="flexcroll";
		asd1.style.display="block";
	}
	else
	{	
		asd=$("dd");
		asd.style.display="none"
		asd.setAttribute("class","aa")
		asd1=$("onew1")
		asd1.setAttribute("class","as")
		asd1.style.display="none";
	} 
 }
