/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="#">Clients</a>'
menu1[1]='<a href="#">Partners</a>'
menu1[2]='<a href="#">User Testmonials</a>'

//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<a href="./training.html">Training</a>'
menu2[1]='<a href="./consultancy.html">Consultancy</a>'
//menu2[2]='<a href="./knowledge.html">Knowledge Space</a>'
//menu2[4]='<a href="./emr.html">Elctronic Medical Record</a>'
//menu2[5]='<a href="./enquiry.html">Career</a>'

//Contents for menu 3, and so on
var menu3=new Array()
menu3[0]='<a href="./sdb.html">Scientific-Db</a>'
menu3[1]='<a href="./dc.html">DataCuration</a>'
menu3[2]='<a href="./ims.html">ImageManagementSystem</a>'
//menu3[4]='<a href="./imaging.html">Imaging Information</a>'
//menu3[5]='<a href="./enquiry.html">Career</a>'

var menuwidth='200px' //default menu width
var menubgcolor='#5C748B' //menu bgcolor
var disappeardelay=400  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-image:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu

/*Validations*/

function validation()
{

		userName=document.getElementById("userName").value;
		password=document.getElementById("password").value;
		
		if(userName=="")
			{
			alert("Please Enter the Username");
			return false;
			}
            
			if(password=="")
			{
			alert("please Enter the Password");
			return false;
			}
			else
			{
			res=passvalidation(password);
            if(res==false)return false;
			}

		return true;
}

function passvalidation(pwd)
	{
		for(i=0;i<pwd.length;i++)
		{
			password=pwd.length;
			if(password<6)
			{
			alert("Plz enter minimum of 6 characters for password");
			return false;
			}
		}
	}

/*Validations*/
function common()
{
	
	email=document.getElementById('email').value;
	com=document.getElementById('comments').value;

	if(email=='')
	{
		
		document.getElementById('display').innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid gray 1px ; color:red;width:400px;'> Email should not be empty</div>";
        //document.getElementById('primary_email').focus();
		return false;
	}
	else
	{
	        resemail=emailval(email);
            if(resemail==false)
		    {
				document.getElementById('display').innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid gray 1px ; color:red;width:400px;'>&nbsp;&nbsp;Enter valid Email</div>";
			return false;
			}

	}
	if(com=='')
	{
		
		document.getElementById('display').innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid gray 1px ; color:red;width:400px;'>Feedback Should not be Empty</div>";
        //document.getElementById('primary_email').focus();
		return false;
	}

return true;
}
function email_valid()
{
	
	email=document.getElementById('email').value;
	if(email=='')
	{
		
		document.getElementById('display').innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid gray 1px ; color:red;width:400px;'> Email should not be empty</div>";
        //document.getElementById('primary_email').focus();
		return false;
	}
	else
	{
	        resemail=emailval(email);
            if(resemail==false)
		    {
				document.getElementById('display').innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid gray 1px ; color:red;width:400px;'>&nbsp;&nbsp;Enter valid Email</div>";
			return false;
			}

	}
return true;
}
function emailval(str)
{
	var email = /^[a-z0-9]([a-z0-9_\-\.]*)@([a-z0-9_\-\.]*)(\.[a-z]{2,3}(\.[a-z]{2}){0,2})$/i; 
    return email.test(str);
}

function register_validation()
{
	userName=document.getElementById('userName').value;
	password=document.getElementById('password').value;
	cpassword=document.getElementById('confirmPassword').value;
	firstName=document.getElementById('firstName').value;
	lastName=document.getElementById('lastName').value;
	email=document.getElementById('email').value;
	resume=document.getElementById('resume').value;

	if(userName == '')
	{
 document.getElementById("display").innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:red;'>Please Enter the Username</div>";
 return false;
	}
if(password == '')
          {
                document.getElementById('display').innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:red;'>Password should not be empty</div>";
            return false;
          }
          else
          {
            res=passvalidation(password);
            if(res==false)return false;
          }

          /* ConfirmationPassword Validation*/
           if(cpassword == '')
         {
            document.getElementById('display').innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:red;'>Confirm Password should not be empty</div>";
            return false;
        }
        else
        {
            res7=cpassvalidation(cpassword);
            if(res7==false)return false;
        }
	if(firstName == '')
	{
		 document.getElementById("display").innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:red;'>Please Enter the Firstname</div>";
		return false;
	}
	if(lastName == '')
	{
 document.getElementById("display").innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:red;'>Please Enter the Lastname</div>";
 return false;
	}	
	
if(email=='')
         {
       
            document.getElementById ('display').innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:red;'>Email should not be empty</div>";
            //document.getElementById('primary_email').focus();
            return false;
          }
          else
          {
            resemail=emailval(email);
            if(resemail==false)
            {
                document.getElementById('display').innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:red;'>Enter valid Email</div>";
            return false;
            }

          }

	if(resume == '')
	{
 document.getElementById("display").innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:red;'>Resume Should not be Empty</div>";
 return false;
	}	
	
   

}
function passvalidation(pwd)
    {
        for(i=0;i<pwd.length;i++)
        {
            password1=pwd.length;
            if(password1<6)
            {
        document.getElementById("display").innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:red;'>Please Enter Minimum of 6 Characters for Password</div>";
        return false;
            }
        }
    }

    function cpassvalidation(cpwd)
    {
        for(i=0;i<cpwd.length;i++)
        {
            cpassword1=cpwd.length;       
            if(((password!=cpassword)&&(password1!=cpassword1))||((password!=cpassword)&&(password1=cpassword1)))
            {
                document.getElementById("display").innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:red;'>Password & Confirmation Password Should be Same</div>";
                return false;
            }
        }
    } 
function online()
{

	email=document.getElementById('email').value;
	phone=document.getElementById('phoneNo').value;
if(email=='')
         {
       
            document.getElementById ('display').innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:red;'>Email should not be empty</div>";
            //document.getElementById('primary_email').focus();
            return false;
          }
          else
          {
            resemail=emailval(email);
            if(resemail==false)
            {
                document.getElementById('display').innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:red;'>Enter valid Email</div>";
            return false;
            }

          }

		  if(phone == "")
			{       
				document.getElementById('display').innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:red;'>Please Enter Phone Number</div>";
				return false;
			}
			else
			{
				resmob=mobilevalidation(phone);
				if(resmob == false)
				{
				return false;   
				}
			}
}
function enq_validation()
{
	

	firstName=document.getElementById('firstName').value;
	lastName=document.getElementById('lastName').value;
	email=document.getElementById('email').value;
	phone=document.getElementById('phoneNo').value;
	message=document.getElementById('message').value;


	if(firstName == '')
	{
 document.getElementById("display").innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:red;'>Please Enter the Firstname</div>";
 return false;
	}
	
	if(lastName == '')
	{
 document.getElementById("display").innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:red;'>Please Enter the Lastname</div>";
 return false;
	}
	if(email=='')
         {
       
            document.getElementById ('display').innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:red;'>Email should not be empty</div>";
            //document.getElementById('primary_email').focus();
            return false;
          }
          else
          {
            resemail=emailval(email);
            if(resemail==false)
            {
                document.getElementById('display').innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:red;'>Enter valid Email</div>";
            return false;
            }

          }

		  if(phone == "")
			{       
				document.getElementById('display').innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:red;'>Please Enter Phone Number</div>";
				return false;
			}
			else
			{
				resmob=mobilevalidation(phone);
				if(resmob == false)
				{
				return false;   
				}
			}
			if(message == '')
	{
 document.getElementById("display").innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid #969696 1px ; color:red;'>Please Enter the Message</div>";
 return false;
	}

}
function mobilevalidation(mv)
    {
        for(i=0;i<mv.length;i++)
        {
            if(!(mv.charAt(i)>=0 && mv.charAt(i)<=9))
            {
                document.getElementById('display').innerHTML="<div align='center' style='padding:5px;background-color:#E5E5E5;border:solid gray 1px ; color:red;'>Enter the number b/w(0-9)</div>";
                return false;
            }
        }
    }
function enroll()
{

	email=document.getElementById('eemail').value;
	phone=document.getElementById('phoneNo').value;
if(email=='')
         {
       
           alert("Email should not be empty");
            //document.getElementById('primary_email').focus();
            return false;
          }
          else
          {
            resemail=emailval(email);
            if(resemail==false)
            {
                alert("Enter valid Email");
            return false;
            }

          }

		  if(phone == "")
			{       
				alert("Please Enter Phone Number");
				return false;
			}
			else
			{
				resmob=mobile_validation(phone);
				if(resmob == false)
				{
				return false;   
				}
			}
}
function mobile_validation(mv)
    {
        for(i=0;i<mv.length;i++)
        {
            if(!(mv.charAt(i)>=0 && mv.charAt(i)<=9))
            {
                alert("Enter the number b/w(0-9)");
                return false;
            }
        }
    }

  function ask(){
	email=document.getElementById('email').value;
	question=document.getElementById('query').value;
	gender=document.getElementById("gender").value;
	age=document.getElementById('age').value;
	city=document.getElementById('city').value;
if(email=='')
         {
       
           alert("Email should not be empty");
            return false;
          }
          else
          {
            resemail=emailval(email);
            if(resemail==false)
            {
                alert("Enter valid Email");
            return false;
            }

         }

		if(question=='')
         {
			 alert("Question Should not be Empty")
			 return false;
		 }

					 if(gender=="")
						{
   
							alert(" Please select the Gender");
							document.getElementById('gender').focus();
							return false;
           				}
						if(age=='')
						 {
							 alert("Please Enter your Age")
							 return false;
						 }
						 else
						{
							resmob=agevalidation(age);
							if(resmob == false)
							{
								return false;   
							}
							else
							{
								if(age <=0 || age>=100)
								{
									alert(" Please Enter Age Between 0 - 100");
									document.getElementById('age').focus();
									return false;
								}
							}
						}

						if(city=='')
						 {
							 alert("Please Enter your City")
							 return false;
						 }
						 else
						{
							var alphaExp = /^[a-zA-Z]+$/;
							if(city.match(alphaExp)){
							return true;
							}else{
								alert("Enter only letters");
									return false;
									}

						}

return true;
}
function emailval(str)
{
	var email = /^[a-z0-9]([a-z0-9_\-\.]*)@([a-z0-9_\-\.]*)(\.[a-z]{2,3}(\.[a-z]{2}){0,2})$/i; 
    return email.test(str);
}
  function agevalidation(mv)
    {
        for(i=0;i<mv.length;i++)
        {
            if(!(mv.charAt(i)>=0 && mv.charAt(i)<=9))
            {
                alert("Enter the number b/w(0-9)");
                document.getElementById('age').focus();
                return false;
            }
        }
    }