<!--
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];}
}
//-->
function validLogin()
 {

   if(document.frmlogin.username.value == "")
   {
    alert("Please enter User Name");
	return false;
	}
	if(document.frmlogin.pass.value == "")
   {
    alert("Please enter Password");
	return false;
	}
    var st =  EncryptPassword(document.frmlogin.pass.value);
	//alert(document.frmlogin.pass.value);	
	return true;
  }
  
 function EncryptPassword(form) 
	{
		
		var str_in;
		var num_out = "";
	 
		str_in = escape(form);
		for(i = 0; i < str_in.length; i++) 
				num_out += (str_in.charCodeAt(i) - 23);
		
		document.frmlogin.encrptPwd.value = num_out;
		return str_out;	
	}	
 

//added validations


var arSelected = new Array();
var selected = new Array();

function MM_openBrWindow(theURL,winName,features) { //v2.0
   window.open(theURL,winName,features);
  
}
// Function Name: CheckPhone
// Description: This function validates the Phone field
function CheckPhone(strPhone)
{
    var checkOk="0123456789-+ ";
	var numValid=true;
    var j=0; 
     
    //Checking if the First character is '-' or not
	if(strPhone.charAt(0)=='-')
	{
	  return false;
	}
	
	//Checking if first character is '+'
	if(strPhone.charAt(0)=='+')
	 {
	  j++;  
	 }
	
	//Checking if the Phone number contains non-numbers 
	//if the character is '-' then it is allowed
	for(i=j; i<strPhone.length; i++)
	{
	    ch=strPhone.charAt(i);	     
	    for(j=0; j<checkOk.length; j++)
	    {
	       if(ch==checkOk.charAt(j))
	       {
	        numValid=true;
	        break;
	       } 
	       else
	        numValid=false;	           
	    } 
	    if(numValid==false) 
	       break;
	}
	
	//Checking if the Last character is '-' or not
	if(strPhone.charAt(i-1)=='-')
	{
	  return false;
	}  
    return numValid;
}
// Function Name: CheckEmail
// Description: This function validates the Email field

  var emailstr = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/	
	
	function validateEmail()
	{
		
		var EmailmatchArray = document.frmMail.mailid.value.match(emailstr);

		if (EmailmatchArray == null)
		{
			alert ('Please enter valid Email Id.');
			document.frmMail.mailid.focus();
			//return false;
		}
		else
		{
		
		document.frmMail.submit();
		//return true;
		}
	}	
function CheckEmail(strEmail)
{

    var checkAlpha="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
    var checkOther="_.-'"
    var emailValid=true;
    var checkAtDot=false;  
    var i,j,ch;
    
	//Removing white spaces from strName
	while(strEmail.charAt(0)==' ')
	       strEmail=strEmail.substring(1,strEmail.length); 

    //checking for first character is alpha numeric or not
    for(i=0; i<checkAlpha.length; i++)
     {
       if(strEmail.charAt(0)==checkAlpha.charAt(i))
       {
         emailValid=true;   
         break;
       }
       else
         emailValid=false;
     }

     //Returning false if the first character was not alphabet 
     if(emailValid==false) return false;
   
    //checking the characters before '@' character
    for(i=1; i<strEmail.length; i++)
	{
	    ch=strEmail.charAt(i);	     	    
	    //if '@' is found then break from the loop
	    if(ch=='@')
             {
                checkAtDot=true;
                emailValid=true; 
	        break;
             } 
	    for(j=0; j<(checkAlpha.length + checkOther.length); j++)
	    {
	       if(ch==checkAlpha.charAt(j))
	       {               
	        emailValid=true;
	        break;
	       } 
	       else if(ch==checkOther.charAt(j))
           {
	        emailValid=true;
	        break;
           }                      
 	        emailValid=false;	           
	    } 
	    if(emailValid==false) 
	       break;
	}
	
	 //Returning false if the Email Id is Invalid  
     if(checkAtDot==false || emailValid==false) return false;
    
     //checking the characters after '@' characters
     //checking for first character after '@' character is alphabet or not
     //incrementing i to move to next character
 
     i++;
     ch=strEmail.charAt(i);
       for(j=0; j<checkAlpha.length; j++)
       { 
        if(ch==checkAlpha.charAt(j))
        {

         emailValid=true; 
         break;
        }   
       else
         emailValid=false;
      }
        
     //Returning false if the Email Id is Invalid  
     if(emailValid==false) return false;

     checkAtDot=false;
     
	//checking the characters before '.' character
     for(i=i+1;i<strEmail.length; i++)
	{
	    ch=strEmail.charAt(i);	     
	    
	    //if '.' is found then break from the loop
	    if(ch=='.')
            {  
               checkAtDot=true;
               emailValid=true;
	       break;
            }
        //check characters of Email ID in checkAlpha and checkOther     
	    for(j=0; j<(checkAlpha.length + checkOther.length); j++)
	    {
	       if(ch==checkAlpha.charAt(j))
	       {
	        emailValid=true;
	        break;
	       } 
	       else if(ch==checkOther.charAt(j))
	       {
	        emailValid=true;
	        break;
	       } 
               else 
	        emailValid=false;	           
	    } 
	    if(emailValid==false) 
	       break;
	}

    //returning false if character '.' or Email Id is false
    if(checkAtDot==false || emailValid==false) return false;
	
	//Checking if after '.' Email has non-alpha numeric characters
    //if no characters are there after '.' then return false
    emailValid=false;	           
    checkAtDot=false;
        
	for(i=i+1; i<strEmail.length; i++)
	{
	    ch=strEmail.charAt(i);   
	    for(j=0; j<checkAlpha.length; j++)
	    {
	       if(ch==checkAlpha.charAt(j))
	       {
	        emailValid=true;
	        break;
	       } 
	       else if(ch=='.')
	       { 
	        
	         //if email id has multiple '.' characters
	         checkAtDot=true; 
	         emailValid=false;
	         break;
	       }       
	       else
	        emailValid=false;	           
	    } 
	    if(checkAtDot==false && emailValid==false) 
	       break;
	    checkAtDot=false;    
	}	
	
   return(emailValid);	
}

function Validate()
{

 var strEmail=document.form1.email.value;
 var strPhone=document.form1.contactno.value;

  if(document.form1.subject.value=="")
  {
   alert("Please fill in the subject");
   document.form1.subject.focus(true);
   return false;
  } 
  
   if(document.form1.name.value=="")
  {
   alert("Please fill in your name");
   document.form1.name.focus(true);
   return false;
  } 
   if(strEmail=="")
  {
   alert("Please fill in your email address");
   document.form1.email.focus(true);
   return false;
  } 
   if(document.form1.contactno.value=="")
  {
   alert("Please fill in your contact number");
   document.form1.contactno.focus(true);
   return false;
  }
  
  if(!CheckEmail(strEmail))
  {
    alert("Invalid Email Address");
	
	document.form1.email.focus(true);
     return false;
 }	 
 
 if(!CheckPhone(strPhone))
  {
    alert("Invalid Phone Number");
	
	document.form1.contactno.focus(true);
     return false;
 }	 
  
  return true;
}

function BPFormValidate()
{

 var strEmail=document.form1.email.value;
 var strPhone=document.form1.contactno3.value;
 var i=0,iFlg=0;
//alert("Please select Core Business Area"+document.form1.chkCoreBusiness.checked);
  if(document.form1.company.value=="")
  {
   alert("Please enter the company name");
   document.form1.company.focus(true);
   return false;
  }
  if(document.form1.country.value=="")
  {
   alert("Please enter the country ");
   document.form1.country.focus(true);
   return false;
  }
  if(document.form1.website.value=="")
  {
   alert("Please enter the website ");
   document.form1.website.focus(true);
   return false;
  } 
  
   if(document.form1.fname.value=="")
  {
   alert("Please enter first name");
   document.form1.fname.focus(true);
   return false;
  }
  if(document.form1.lname.value=="")
  {
   alert("Please enter last name");
   document.form1.lname.focus(true);
   return false;
  }
   if(document.form1.design.value=="")
  {
   alert("Please enter designation");
   document.form1.design.focus(true);
   return false;
  }
   
   if(strEmail=="")
  {
   alert("Please enter email address");
   document.form1.email.focus(true);
   return false;
  } 
   if(document.form1.contactno1.value=="" || document.form1.contactno2.value=="" || document.form1.contactno3.value=="")
  {
   alert("Please enter telephone number");
   document.form1.contactno.focus(true);
   return false;
  }
 
 for(i=0;i<document.form1.chkCoreBusiness.length;i++)
  {
   if(document.form1.chkCoreBusiness[i].checked==true)
     iFlg =1;	
  }
  if(iFlg == 0)
   {
  	alert("Please select Core Business Area");
   //document.form1.chkCoreBusiness.focus(true);
     return false;  
   }
   
    if(document.form1.noyears.value=="")
  {
   alert("Please enter No. of years in operation");
   document.form1.noyears.focus(true);
   return false;
  }
   if(document.form1.mcust.value=="")
  {
   alert("Please enter Major customers ");
   document.form1.mcust.focus(true);
   return false;
  }
   if(document.form1.topmarket.value=="")
  {
   alert("Please enter market segment ");
   document.form1.topmarket.focus(true);
   return false;
  }
   if(document.form1.productSold.value=="")
  {
   alert("Please enter Product sold ");
   document.form1.productSold.focus(true);
   return false;
  }
   
  if(!CheckEmail(strEmail))
  {
    alert("Invalid Email Address");
	
	document.form1.email.focus(true);
     return false;
 }	 
 
 if(!CheckPhone(strPhone))
  {
    alert("Invalid Phone Number");
	
	document.form1.contactno3.focus(true);
     return false;
 }	 
  
  return true;
 
}
function Hide(x)
 {
  document.getElementById(x).style.display = "none";
 }
 
 function ShowHide(x)
 {
  	var mname;
  	mname = x;
  	if(document.getElementById(x).style.display == "block")
  		document.getElementById(x).style.display = "none";
  	else
  		document.getElementById(x).style.display = "block";
  	
 }
  
 //Disable all the drop down based controls
 function DisableAll()
 {
  Hide("divProducts"); 
  Hide("divCaseStudies");
  Hide("divServices");
  Hide("divBusiness");
  Hide("divCareers");
  Hide("divAbout");
  Hide("divQuery");
  document.frmMember.chkProducts.checked=false;
  document.frmMember.chkCaseStudies.checked=false;
  document.frmMember.chkServices.checked=false;
  document.frmMember.chkBiz.checked=false;
  document.frmMember.chkCareers.checked=false;
  document.frmMember.chkAbout.checked=false;
  //document.frmMember.chkQuery.checked=false;
 }

 
 
 //Enable product html controls
 function EnableProduct()
 {
  ShowHide("divProducts"); 
 }
 
 //Disable product html controls
 function DisableProduct()
 {
  Hide("divProducts"); 
 }
 
 //Enable Business / Alliance Partner html controls
 function EnableBusiness()
 {
  ShowHide("divBusiness");
 }
 
 //Disable Business / Alliance Partner html controls
 function DisableBusiness()
 { 
  Hide("divBusiness");
 }
 
 //Enable Services / Consultancy html controls
 function EnableServices()
 {
  ShowHide("divServices");
 }
 
 //Disable Services / Consultancy html controls
 function DisableServices()
 {
  Hide("divServices");
 }
 
 //Enable Career with Indus html controls
 function EnableCareers()
 {
  ShowHide("divCareers");
 }
 
 //Disable Career with Indus html controls
 function DisableCareers()
 {
  Hide("divCareers");
 }
 
 //Enable About us html controls
 function EnableAboutUs()
 {
  ShowHide("divAbout");
 }
 
 //Disable About us html controls
 function DisableAboutUs()
 {
  Hide("divAbout");
 }
 
 //Enable Case Study html controls
 function EnableCaseStudy()
 {
  ShowHide("divCaseStudies");
 }
 
 //Disable Case Study html controls
 function DisableCaseStudy()
 {
  Hide("divCaseStudies");
 }
 
 //Enable Any Other query html controls
 function EnableQuery()
 {
  ShowHide("divQuery");
 }
 
 //Enable Any Other query html controls
 function DisableQuery()
 {
  Hide("divQuery");
 }
 
 //Sets the sections
 function setSection(ob)
 {
  identity=document.getElementById(ob); 
  
  if(ob=='chkProducts')
  {
  	if(document.frmMember.chkProducts.checked==true)
	  EnableProduct();
	else
	  DisableProduct();	
  }
  else if(ob=='chkBiz')
  {
    if(document.frmMember.chkBiz.checked==true)
	  EnableBusiness();
	else
	  DisableBusiness();  
  }
  else if(ob=='chkCareers')
  {
   if(document.frmMember.chkCareers.checked==true)
	  EnableCareers();
	else
	  DisableCareers();
  }
  else if(ob=='chkAbout')
  {
   if(document.frmMember.chkAbout.checked==true)
	 EnableAboutUs();
   else
    DisableAboutUs();
  }
  else if(ob=='chkCaseStudies')
  {
   if(document.frmMember.chkCaseStudies.checked==true)
	 EnableCaseStudy();
   else
     DisableCaseStudy();
  }
  else if(ob=='chkQuery')
  {
   if(document.frmMember.chkQuery.checked==true)
	 EnableQuery();
   else
     DisableQuery();
  }		
  else if(ob=='chkServices')
  {
   if(document.frmMember.chkServices.checked==true)
     EnableServices();
   else
     DisableServices();
  }		
 }
 
  function checkBPFormAscii()
  {
	   	var chk="'";
		// the keys  (' , ; and " ) will not be allowed
		if((event.keyCode == 39)||(event.keyCode == 59) || (event.keyCode == 34))
		{
		 	  return false;
		}		
		return true;		
  }

 function checkAscii()
  {
	   	var chk="'";
		//window.clipboardData.clearData();
		//	var ind = chk.indexOf(String.fromCharCode(event.keyCode));
		if((event.keyCode == 39)||(event.keyCode == 45) ||(event.keyCode == 59))
		{
		 	  return false;
		}		
		return true;		
  }
 