// JavaScript Document

function pass_key_code(e) {
 var key_enter =e.keyCode;
  if( key_enter == 13){
    document.frm_login.submit();
  }
  
}

function change_color(obj){
	if(obj.value == 'E-mail'){
		obj.value="";
		obj.style.color='#095ac9' ;
	}
	else if(obj.value == 'Password'){
	  	obj.value="";
		obj.style.color='#095ac9' ;
	}
}

var message="Function Disabled!";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
//alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
//alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("return false")

function login_div(obj){
	if(obj.id == 'a0'){
		obj.id ='a1'; 
		hide_div('content_call_us');
		show_div('content_login');
		
	}
	else{
		obj.id ='a0';
		hide_div('content_login');
		show_div('content_call_us');
			 
	}
}
function hide_div(div_id){											
	document.getElementById(div_id).style.visibility= 'hidden';
	document.getElementById(div_id).style.display = "none";				
}
function show_div(div_id){										
	document.getElementById(div_id).style.visibility= 'visible';
	document.getElementById(div_id).style.display = '';						
}

function frm_submit()
{
document.frm_login.submit();
}

function clear_login()
{
	if(document.getElementById('txt_uname').value == 'E-mail')
	{
	document.getElementById('txt_uname').value = '';
	}
}

function populate_login()
{
	if(document.getElementById('txt_uname').value == '')
	{
	document.getElementById('txt_uname').value = 'E-mail';
	}

}

function clear_password()
{
	if(document.getElementById('txt_pass').value == 'Password')
	{
	document.getElementById('txt_pass').value = '';
	}

}
function populate_password()
{
	if(document.getElementById('txt_pass').value == '')
	{
	document.getElementById('txt_pass').value = 'Password';
	}

}

function fn_signuppage(plan_id)
		{
			if(plan_id > 0)
			 {
			  document.getElementById('dv_planId').value = plan_id;
			  document.frm_to_signup.method = 'post';
			  document.frm_to_signup.action = 'signup';
			  document.frm_to_signup.submit();
			 }
			 else
			 return false;
		}


	function isValidEmailAddress(str_value) {
		var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
		return pattern.test(str_value);
	}
	  var g_PopupIFrame;
	 /* for pop-up */
	 //0 means disabled; 1 means enabled;
	var popupStatus = 0;
	var disableClose = false;
	//loading popup with jQuery magic!
	function loadPopup(){
		//loads popup only if it is disabled
		if(popupStatus==0){
			$("#backgroundPopup").css({
				"opacity": "0.4"			
			});
			$("#backgroundPopup").fadeIn("slow");
			$("#popupContact").fadeIn("slow");
			popupStatus = 1;
		}
		$("#popupContactClose").click(function(){
			disablePopup();
		});
	}

