function emailcheck(emailID) 
{
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (!filter.test(emailID))
	{		
		return false;					
	}
	else
	{
		return true;
	}	
}
function changeLink(elm)
{
	sh=document.body.scrollHeight;
	scrollTo(0,sh); 
	for(var i=1;i<=6;i++)
	{	
		document.getElementById("divDynamicData_"+i).style.display="none";
		document.getElementById("fontBottomLink_"+i).className="bottomMiddleInactive";
		document.getElementById("imgLeft_"+i).src='images/bottom_left_inactive_btn.jpg';
		document.getElementById("imgRight_"+i).src='images/bottom_right_inactive_btn.jpg';
	} 
	if(document.getElementById("Link_"+elm))
	{
		document.getElementById("fontBottomLink_"+elm).className="bottomMiddleActive";
		document.getElementById("imgLeft_"+elm).src='images/bottom_left_active_btn.jpg';
		document.getElementById("imgRight_"+elm).src='images/bottom_right_active_btn.jpg';
	}
	if(document.getElementById("divDynamicData_"+elm))
	{
		document.getElementById("divDynamicData_"+elm).style.display="block";
	}
	
}
function displayEmrContent(type)
{
	if(type==1)
	{
		document.getElementById("divOneClickEmr").style.display="inline";
	}
	else if(type==2)
	{
		document.getElementById("divOneClickEmrInner").style.display="inline";
	}
}
function changeTopLink(elm)
{
	for(var i=1;i<=6;i++)
	{	
		if(document.getElementById("TopLink_"+i).className!="")
		{
			document.getElementById("TopLink_"+i).className="";
		}
	} 
	if(document.getElementById("TopLink_"+elm))
	{
		document.getElementById("fontTopLink_"+elm).className="topMiddleActive";
		document.getElementById("imgTopLeft_"+elm).src='images/left_active_btn.jpg';
		document.getElementById("imgTopRight_"+elm).src='images/right_active_btn.jpg';
	}
}
function closeForm(type)
{
	if(type==1)
	{
		document.getElementById("divOneClickEmr").style.display="none";
	}
	else if(type==2)
	{
		document.getElementById("divOneClickEmrInner").style.display="none";
	}
}
// change architecture link
function changeArchitectureLink(elm)
{
	for(var i=1;i<=4;i++)
	{	
		document.getElementById("divOurAchitecture_"+i).style.display="none";
	} 
	if(document.getElementById("divOurAchitecture_"+elm))
	{
		document.getElementById("divOurAchitecture_"+elm).style.display="block";
		document.getElementById("divServiceTop").style.display="none";
		document.getElementById("fontTitle").innerHTML="Our Architecture";
	}
}
// back to services
function backToServices()
{
	for(var i=1;i<=4;i++)
	{	
		document.getElementById("divOurAchitecture_"+i).style.display="none";
	}
	document.getElementById("divServiceTop").style.display="block";
	document.getElementById("fontTitle").innerHTML="Services";
}

//Contact us
function contactUs()
{
	var errormsg="";
	var email=document.getElementById("txtEmail");
	var phone=document.getElementById("txtPhone");
	if(email.value.replace(/ /g,"")=="")
	{
		errormsg=errormsg+"-Enter email id\n";
		email.focus();
	}
	else if(!emailcheck(email.value))
	{
		errormsg=errormsg+"-Enter valid email id\n";
		email.focus();
	}
	if(phone.value.replace(/ /g,"")=="")
	{
		errormsg=errormsg+"-Enter Phone number\n";
		phone.focus();
	}
	if(errormsg!="")
	{
		alert("Please correct the following errors\n"+errormsg);
	}
	else
	{
	 //var url="ajax_send_email.php?name="+document.getElementById("txtName").value+";
     /*  var name=document.getElementById("txtName").value;
     var org=document.getElementById("txtOrganisation").value;
     var mailid=document.getElementById("txtEmail").value;
     var phoneno=document.getElementById("txtPhone").value;
     var city=document.getElementById("txtCity").value;
     var state=document.getElementById("txtState").value;
    var zip=document.getElementById("txtZip").value;
   var adinfo=document.getElementById("txtInformation").value;
	 var url="ajax_send_email.php?mailid="+mailid;
	  url=url+"&org="+org; 
	  url=url+"&mailid="+mailid; 
	 url=url+"&phoneno="+phoneno;
	  url=url+"&city="+city;
	 url=url+"&state="+state;
	 url=url+"&zip="+zip;
	 url=url+"&adinfo="+adinfo; 
		var xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request");
			return;
		}
        
		xmlHttp.onreadystatechange=function()
		{
			if (xmlHttp.readyState==4 && xmlHttp.status==200)
			{ 
				alert("Sucessfully mail sent");	
				
				
		}
	}	
	xmlHttp.open("GET",url,true);
	xmlHttp.send();
	} */
	/*document.form_contactus.action="send_email.php";
	document.form_contactus.submit();  */
	 document.form_contactus.action="send_email.php";
	document.form_contactus.target="ifSubmit";
	document.form_contactus.submit();  
}
}
function resetForm()
{
window.location="contactus.html";
}
function HippaCompliantProcess(type)
{
   var width = 600;
	var height = 550;
	var left = parseInt((screen.availWidth/2) - (width/2));
	var top = parseInt((screen.availHeight/2) - (height/2));
	var windowFeatures = "width=" + width + ",height=" + height + ",status,scrollbars=yes,resizable,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
	if(type==1)
	{
		window.open("hipaa_compliance.html","List",windowFeatures);
	}
	else if(type==2)
	{
		window.open("hipaa_processes.html","List",windowFeatures);
	}
}



function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		// Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}
