﻿function enablebutton(id,id1)
{
    var val=document.getElementById(id).value;
  if(val!="")
    {
         document.getElementById(id1).removeAttribute("disabled");
        
    }
    else
    {
         document.getElementById(id1).setAttribute("disabled","disabled");
    }
}
function encontrol(id)
{
    var br=navigator.appName;
    
    if(br=="Microsoft Internet Explorer")
    {
     if(id)
        {
            var el=document.getElementById(id).getElementsByTagName("input");
          
            var len=el.length;
            var type;
            for(var i=0;i<len;i++)
            {
                type=el[i].getAttribute("type");
               
                if(type=="button" || type=="submit")
                {
                    el[i].removeAttribute("disabled");
                }
            }
        }
    }
}
function dicontrol(id)
{
    var br=navigator.appName;
   
    if(br=="Microsoft Internet Explorer")
    {
        if(id)
        {
            var el=document.getElementById(id).getElementsByTagName("input");
            var len=el.length;
            var type;
            for(var i=0;i<len;i++)
            {
                type=el[i].getAttribute("type");
                if(type=="button" || type=="submit")
                {
                    el[i].setAttribute("disabled","disabled");
                }
            }
        }
    }
    
}
function enablecontrol(id,id1)
{
     var br=navigator.appName;
    if(br=="Microsoft Internet Explorer")
    {
        var val=document.getElementById(id).value;
      if(val!="")
        {
             document.getElementById(id1).removeAttribute("disabled");
            
        }
        else
        {
             document.getElementById(id1).setAttribute("disabled","disabled");
        }
    }
}
 var newwindow;
function openwindow(path,title)
{
     newwindow=window.open(path, title,'left=100,top=20,scrollbar=yes,width=800,height=600');

}
function CourseOption(ref)
{
 
 var block=new Array();
 block[0]="ClassBlock";
 block[1]="OnlineBlock";
 block[2]="AllBlock";
 block[3]="WorkshopsBlock";
 var len=block.length;
 for(var i=0;i<len;i++)
 {
       var reqblock=block[i];
        if(ref=="btnTopClass")
        {
           
            if(reqblock=="ClassBlock")
            {
               document.getElementById(reqblock).style.display="block";
            }
            else
            {
              document.getElementById(reqblock).style.display="none";
            }
            //SetColor(ref)
        }
        else if(ref=="btnTopOnline")
        {
           
            if(reqblock=="OnlineBlock")
            {
               document.getElementById(reqblock).style.display="block";
            }
            else
            {
                 document.getElementById(reqblock).style.display="none";
            }
            // SetColor(ref);
        }
         else if(ref=="btnTopAll")
        {
           
            if(reqblock=="AllBlock")
            {
               document.getElementById(reqblock).style.display="block";
            }
            else
            {
                 document.getElementById(reqblock).style.display="none";
               
            }
             //SetColor(ref);
        }
         else if(ref=="btnWorkshop")
        {
           
            if(reqblock=="WorkshopsBlock")
            {
               document.getElementById(reqblock).style.display="block";
            }
            else
            {
                 document.getElementById(reqblock).style.display="none";
               
            }
             //SetColor(ref);
        }
       
   }
 }
function SetColor(id)
{
    var btnArray=new Array();
    btnArray[0]="btnTopClass";
    btnArray[1]="btnTopOnline";
    btnArray[2]="btnTopAll";
    var len=btnArray.length;
    for(var i=0;i<len;i++)
    {
      if(btnArray[i]==id)
      {
        document.getElementById(id).style.color="red";
      }
      else
      {
         document.getElementById(btnArray[i]).style.color="#676d77";
      }
    }
}
 

function selectMenuOpType(idBlk1,idBlk2,idRd1,idRd2,idLbl1,idLbl2)
{
 
 var idEx=document.getElementById(idBlk1);
 var idAdd=document.getElementById(idBlk2);
 var rdEx=document.getElementById(idRd1);
 var rdAdd=document.getElementById(idRd2);
 var lblEx=document.getElementById(idLbl1);
 var lblAdd=document.getElementById(idLbl2);

 if(rdEx.checked==true)
 {
    if(idEx.style.display=="none")
    {
        idEx.style.display="block"
        lblEx.innerHTML="";
    }
     if(idAdd.style.display=="block")
    {
        idAdd.style.display="none"
    }
 }
 else
 {
     if(idEx.style.display=="block")
    {
        idEx.style.display="none"
    }
     if(idAdd.style.display=="none")
    {
        idAdd.style.display="block"
        lblAdd.innerHTML="";
    }
 }
}
function displayDiv(id,id1)
{
   var val=document.getElementById(id).value;
   var tardiv= document.getElementById(id1);
   if(val=="India")
   {
      tardiv.style.display="none";  
   }
   else
   {
     tardiv.style.display="block";  
   }
}
function DisplayCharges(id,id1)
{
   var tardiv= document.getElementById(id1);
   
   if(id.indexOf("rdYes")>0)
   {
     tardiv.style.display="block"; 
   }
   else
   {
      tardiv.style.display="none";  
   }  
}
function FillAddress()
{
    var PAdd=document.getElementById('ctl00_ContentPlaceHolder1_txtPAdd');
    var PCountry=document.getElementById("ctl00_ContentPlaceHolder1_ddlPCountry");
    var PState=document.getElementById("ctl00_ContentPlaceHolder1_txtPState");
    var PCity=document.getElementById("ctl00_ContentPlaceHolder1_txtPCity");
    var PPinCode=document.getElementById("ctl00_ContentPlaceHolder1_txtPPin");
    var PPhone=document.getElementById("ctl00_ContentPlaceHolder1_txtPhone");
    var CAdd=document.getElementById("ctl00_ContentPlaceHolder1_txtCAdd");
    var CCountry=document.getElementById("ctl00_ContentPlaceHolder1_ddlCCountry");
    var CState=document.getElementById("ctl00_ContentPlaceHolder1_txtCState");
    var CCity=document.getElementById("ctl00_ContentPlaceHolder1_txtCCity");
    var CPinCode=document.getElementById("ctl00_ContentPlaceHolder1_txtCPin");
    var CPhone=document.getElementById("ctl00_ContentPlaceHolder1_txtCPhone");
    PAdd.value=CAdd.value;
    PCountry.value=CCountry.value;
    PState.value=CState.value;
    PCity.value=CCity.value;
    PPinCode.value=CPinCode.value;
    PPhone.value=CPhone.value;
}
function FindCurrentDate(id)
{
    var tar=document.getElementById(id);
    var CurrDate=new Date();
    var mm=CurrDate.getMonth()+1;
    var dd=CurrDate.getDate();
    var yy=CurrDate.getFullYear();
    var CurrentDate=mm+"/"+dd+"/"+yy;
    tar.innerHTML=CurrentDate;
}
function FindCurrentDateDD(id)
{
    var tar=document.getElementById(id);
    var CurrDate=new Date();
    var mm=CurrDate.getMonth()+1;
    var dd=CurrDate.getDate();
    var yy=CurrDate.getFullYear();
    var CurrentDate=dd+"/"+mm+"/"+yy;
    tar.innerHTML=CurrentDate;
}
function FindCurrentDateDDLong(id)
{
    var  month=new Array();
    month[0]="Janaury";
    month[1]="Febraury";
    month[2]="March";
    month[3]="April";
    month[4]="May";
    month[5]="June";
    month[6]="July";
    month[7]="August";
    month[8]="September";
    month[9]="October";
    month[10]="November";
    month[11]="December";
   
    var tar=document.getElementById(id);
    var CurrDate=new Date();
    var mm=CurrDate.getMonth();
    var dd=CurrDate.getDate();
    var yy=CurrDate.getFullYear();
    var CurrentDate=dd+"-"+month[mm]+"-"+yy;
    tar.innerHTML=CurrentDate;
}
function SetValue(id,id1)
{
  if(document.getElementById(id1).selectedIndex>0)
  {
     document.getElementById(id).value=document.getElementById(id1).value;
  }
}
function SetValue1(id)
{
  var isCorrect=true;
  if(document.getElementById(id).selectedIndex==0)
  {
    alert("Kindly select the studentId");
    isCorrect=false;
  }
  else
  {
   isCorrect=true;
  }
  return isCorrect;
}
// var message="";
 //var isCorrect=true;
 function settext(id,id1)
 {
     document.getElementById(id).value="";
     document.getElementById(id1).selectedIndex=0;
 }
 function CheckMail(id)
 {
   var isCorrect=true;
    var message="";
     var mail= /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
     if(document.getElementById(id).value=="")
     {
        message="Kindly enter your mail id";
        isCorrect=false;
     }
     else if(!mail.test(document.getElementById(id).value))
     {
         message="Kindly enter valid mail id";
         isCorrect=false;
     }
     else
     {
         isCorrect=true;
     }
     if(isCorrect==false)
     {
        alert(message);
     }
    return isCorrect;

 }
 function CheckMail1(id,id1)
 {
   var isCorrect=true;
    var message="";
     var mail= /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
     if(document.getElementById(id).value=="")
     {
        message="Kindly enter your mail id";
        isCorrect=false;
     }
     else if(!mail.test(document.getElementById(id).value))
     {
         message="Kindly enter valid mail id";
         isCorrect=false;
     }
     else
     {
         isCorrect=true;
     }
     if(isCorrect==false)
     {
       document.getElementById(id1).innerHTML=message;
     }
    return isCorrect;

 }
function CheckForm(id)
{
   var isCorrect=true;
   var message="";
   var DivCourier=document.getElementById("ctl00_ContentPlaceHolder1_divHardCopy");
//   var cash=document.getElementById("ctl00_ContentPlaceHolder1_rdCash");
//   var dd=document.getElementById("ctl00_ContentPlaceHolder1_rdDraft");
   var cc=document.getElementById("ctl00_ContentPlaceHolder1_rdCreditCard");
   var divService=document.getElementById("ctl00_ContentPlaceHolder1_PaymentServices");
   var root=document.getElementById(id);
   var el=root.getElementsByTagName("input"); 
   var el1=root.getElementsByTagName("select");
   var len=el.length;
   var len1=el1.length;
   var mail= /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
   var num=/^\d+$/;
   var dec= /^[-+]?\d{1,3}(\.\d{1,2})?$/;
  
   for(var j=0;j<len1;j++)
   {
    var title=el1[j].getAttribute("title");
    var id=el1[j].id;
    var selVal=el1[j].value.substr(1,6);
        if(selVal=="Select")
        {   
            document.getElementById(id).style.backgroundColor="lightyellow";
            el1[j].style.backgroudColor="lightyellow";
            message+="Kindly select the "+title+" from the list; ";
            isCorrect=false;
        }
        else
        {
           document.getElementById(id).style.backgroundColor="#ffffff";
        }
   }
   
   for(var i=0;i<len;i++)
   {
       var type=el[i].getAttribute("type");
       var title=el[i].getAttribute("title");
        if(type=="text")
        {
         var blank =el[i].getAttribute("blank");
         var att=el[i].getAttribute("mail");
         var att1=el[i].getAttribute("num");
         var att2=el[i].getAttribute("dec");
          var id=el[i].id;
          if(blank==1 && el[i].value=="" && att==null && att1==null )
          {
             
               document.getElementById(id).style.backgroundColor="lightyellow";
               message+="Kindly fill the "+title+" ;";
               isCorrect=false;
          }  
          else if(att==1)
          {
             if(blank==1)
              {
                  if(el[i].value=="")
                  {
                     el[i].style.backgroundColor="lightyellow";
                     message+="Kindly fill the "+title+" ;";
                     isCorrect=false;
                  }
                  else if(!mail.test(el[i].value))
                  {
                     el[i].style.backgroundColor="lightyellow";
                     message+="Kindly enter the valid email address in "+title+" ;";
                     isCorrect=false; 
                  }
                  else
                  {
                     el[i].style.backgroundColor="#ffffff";
                  }  
              }
              else
              {
                if(!mail.test(el[i].value) && el[i].value!="")
                  {
                    
                     el[i].style.backgroundColor="lightyellow";
                     message+="Kindly enter the valid email address in "+title+" ;";
                     isCorrect=false;;
                  }
                  else
                  {
                    el[i].style.backgroundColor="#ffffff";
                  }  
              }
            
          }
          else if(att1==1)
          {
             if(blank==1)
              {
                  if(el[i].value=="")
                  {
                     el[i].style.backgroundColor="lightyellow";
                     message+="Kindly fill the "+title+" ;";
                     isCorrect=false;
                  }
                  else if(!num.test(el[i].value))
                  {
                     el[i].style.backgroundColor="lightyellow";
                     message+="Kindly enter the numeric value only in "+title+" ;";
                     isCorrect=false; 
                  }
                  else
                  {
                     el[i].style.backgroundColor="#ffffff";
                  }  
              }
              else
              {
                if(!num.test(el[i].value) && el[i].value!="")
                  {
                    
                     el[i].style.backgroundColor="lightyellow";
                     message+="Kindly enter the numeric value  only in "+title+" ;";
                     isCorrect=false;;
                  }
                  else
                  {
                     el[i].style.backgroundColor="#ffffff";
                  }  
              }
            
          }
           else if(att2==1)
          {
             if(blank==1)
              {
                  if(el[i].value=="")
                  {
                     el[i].style.backgroundColor="lightyellow";
                     message+="Kindly fill the "+title+" ;";
                     isCorrect=false;
                  }
                  else if(!dec.test(el[i].value))
                  {
                     el[i].style.backgroundColor="lightyellow";
                     message+="Kindly enter the numeric/decimal value only in "+title+" ;";
                     isCorrect=false; 
                  }
                  else
                  {
                     el[i].style.backgroundColor="#ffffff";
                  }  
              }
              else
              {
                if(!dec.test(el[i].value) && el[i].value!="")
                  {
                    
                     el[i].style.backgroundColor="lightyellow";
                     message+="Kindly enter the numeric/decimal value  only in "+title+" ;";
                     isCorrect=false;;
                  }
                  else
                  {
                     el[i].style.backgroundColor="#ffffff";
                  }  
              }
            
          }
          else
          {
             document.getElementById(id).style.backgroundColor="#ffffff";
          }
      }
      if(type=="checkbox")
        {
          if(el[i].checked==false)
          {
              el[i].style.backgroudColor="lightyellow";
              message+="Kindly accept the Terms & Conditions; ";
              isCorrect=false;
          }
        }
    }
    
   if(DivCourier.style.display=="block")
    {
      var yes=document.getElementById("ctl00_ContentPlaceHolder1_rdYes");
      var No=document.getElementById("ctl00_ContentPlaceHolder1_rdNo");
      if(yes.checked==false && No.checked==false)
      {
        message+="Kindly select the option of hardcopy; ";
        isCorrect=false;
      }  
    }
    if(cc.checked==false)
    {
          message+="Kindly select the payment option;";
          isCorrect=false;
    }
    if(divService.style.display=="block")
    {
       //var ccav=document.getElementById("ctl00_ContentPlaceHolder1_rdCCAvenue");
       var ppl=document.getElementById("ctl00_ContentPlaceHolder1_rdPayPal"); 
       if(ppl.checked==false)
       {
          message+="Kindly select the payment services;";
          isCorrect=false;
       }
    }
    if(document.getElementById("ctl00_ContentPlaceHolder1_rdPayPal").checked==true)
    {
       var euro=document.getElementById("ctl00_ContentPlaceHolder1_rdEuro");
       var pound=document.getElementById("ctl00_ContentPlaceHolder1_rdPound"); 
       if(euro.checked==false && pound.checked==false)
       {
          message+="Kindly select the currency type;";
          isCorrect=false;
       }
    }
   if(isCorrect==false)
   {
      alert(message);
   }
 
   return  isCorrect;
}

function CheckFormCommon(id)
{
   var isCorrect=true;
   var message="";
   var root=document.getElementById(id);
   var el=root.getElementsByTagName("input"); 
   var el1=root.getElementsByTagName("select");
   var el2=root.getElementsByTagName("textarea");
   var len=el.length;
   var len1=el1.length;
   var len2=el2.length;
   var mail= /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
   var num=/^\d+$/;
   var dec= /^[-+]?\d{1,3}(\.\d{1,2})?$/;
  
   for(var j=0;j<len1;j++)
   {
    var title=el1[j].getAttribute("title");
    var id=el1[j].id;
    var selVal=el1[j].value.substr(1,6);
        if(selVal=="Select")
        {   
            el1[j].style.backgroudColor="lightyellow";
            message+="Kindly select the "+title+" from the list; ";
            isCorrect=false;
        }
        else
        {
           document.getElementById(id).style.backgroundColor="#ffffff";
        }
   }
  
   for(var i=0;i<len;i++)
   {
       var type=el[i].getAttribute("type");
       var title=el[i].getAttribute("title");
        if(type=="text" || type=="password")
        {
         var blank =el[i].getAttribute("blank");
         var att=el[i].getAttribute("mail");
         var att1=el[i].getAttribute("num");
         var att2=el[i].getAttribute("dec");
          var id=el[i].id;
          if(blank==1 && el[i].value=="" && att==null && att1==null )
          {
             
               document.getElementById(id).style.backgroundColor="lightyellow";
               message+="Kindly fill the "+title+" ;";
               isCorrect=false;
          }  
          else if(att==1)
          {
             if(blank==1)
              {
                  if(el[i].value=="")
                  {
                     el[i].style.backgroundColor="lightyellow";
                     message+="Kindly fill the "+title+" ;";
                     isCorrect=false;
                  }
                  else if(!mail.test(el[i].value))
                  {
                     el[i].style.backgroundColor="lightyellow";
                     message+="Kindly enter the valid email address in "+title+" ;";
                     isCorrect=false; 
                  }
                  else
                  {
                     el[i].style.backgroundColor="#ffffff";
                  }  
              }
              else
              {
                if(!mail.test(el[i].value) && el[i].value!="")
                  {
                    
                     el[i].style.backgroundColor="lightyellow";
                     message+="Kindly enter the valid email address in "+title+" ;";
                     isCorrect=false;;
                  }
                  else
                  {
                    el[i].style.backgroundColor="#ffffff";
                  }  
              }
            
          }
          else if(att1==1)
          {
             if(blank==1)
              {
                  if(el[i].value=="")
                  {
                     el[i].style.backgroundColor="lightyellow";
                     message+="Kindly fill the "+title+" ;";
                     isCorrect=false;
                  }
                  else if(!num.test(el[i].value))
                  {
                     el[i].style.backgroundColor="lightyellow";
                     message+="Kindly enter the numeric value only in "+title+" ;";
                     isCorrect=false; 
                  }
                  else
                  {
                     el[i].style.backgroundColor="#ffffff";
                  }  
              }
              else
              {
                if(!num.test(el[i].value) && el[i].value!="")
                  {
                    
                     el[i].style.backgroundColor="lightyellow";
                     message+="Kindly enter the numeric value  only in "+title+" ;";
                     isCorrect=false;;
                  }
                  else
                  {
                     el[i].style.backgroundColor="#ffffff";
                  }  
              }
            
          }
           else if(att2==1)
          {
             if(blank==1)
              {
                  if(el[i].value=="")
                  {
                     el[i].style.backgroundColor="lightyellow";
                     message+="Kindly fill the "+title+" ;";
                     isCorrect=false;
                  }
                  else if(!dec.test(el[i].value))
                  {
                     el[i].style.backgroundColor="lightyellow";
                     message+="Kindly enter the numeric/decimal value only in "+title+" ;";
                     isCorrect=false; 
                  }
                  else
                  {
                     el[i].style.backgroundColor="#ffffff";
                  }  
              }
              else
              {
                if(!dec.test(el[i].value) && el[i].value!="")
                  {
                    
                     el[i].style.backgroundColor="lightyellow";
                     message+="Kindly enter the numeric/decimal value  only in "+title+" ;";
                     isCorrect=false;;
                  }
                  else
                  {
                     el[i].style.backgroundColor="#ffffff";
                  }  
              }
            
          }
          else
          {
             document.getElementById(id).style.backgroundColor="#ffffff";
          }
      }
      
    }
   for (var k=0;k<len2;k++)
   {
         var blank =el2[k].getAttribute("blank");
         var title=el2[k].getAttribute("title");
         var id=el2[k].id;
         if(blank==1 && el[k].value=="")
         {
               el2[k].style.backgroudColor="lightyellow";
               message+="Kindly fill the "+title+" ;";
               isCorrect=false;
         }
   } 
   if(isCorrect==false)
   {
      alert(message);
   }
 
   return  isCorrect;
}
function CheckForm1(id)
{
   var isCorrect=true;
   var message="";
   var DivCourier=document.getElementById("divHardCopy");
   var cash=document.getElementById("rdCash");
   var dd=document.getElementById("rdDraft");
   var cc=document.getElementById("rdCreditCard");
   var root=document.getElementById(id);
   var el=root.getElementsByTagName("input"); 
   var el1=root.getElementsByTagName("select");
   var len=el.length;
   var len1=el1.length;
   var mail= /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
   var num=/^\d+$/;
   var dec= /^[-+]?\d{1,3}(\.\d{1,2})?$/;
  
   for(var j=0;j<len1;j++)
   {
    var title=el1[j].getAttribute("title");
    var id=el1[j].id;
    var selVal=el1[j].value.substr(1,6);
        if(selVal=="Select")
        {   
            document.getElementById(id).style.backgroundColor="lightyellow";
            el1[j].style.backgroudColor="lightyellow";
            message+="Kindly select the "+title+" from the list; ";
            isCorrect=false;
        }
        else
        {
           document.getElementById(id).style.backgroundColor="#ffffff";
        }
   }
   
   for(var i=0;i<len;i++)
   {
       var type=el[i].getAttribute("type");
       var title=el[i].getAttribute("title");
        if(type=="text")
        {
         var blank =el[i].getAttribute("blank");
         var att=el[i].getAttribute("mail");
         var att1=el[i].getAttribute("num");
         var att2=el[i].getAttribute("dec");
          var id=el[i].id;
          if(blank==1 && el[i].value=="" && att==null && att1==null && att2==null )
          {
             
               document.getElementById(id).style.backgroundColor="lightyellow";
               message+="Kindly fill the "+title+" ;";
               isCorrect=false;
          }  
          else if(att==1)
          {
             if(blank==1)
              {
                  if(el[i].value=="")
                  {
                     el[i].style.backgroundColor="lightyellow";
                     message+="Kindly fill the "+title+" ;";
                     isCorrect=false;
                  }
                  else if(!mail.test(el[i].value))
                  {
                     el[i].style.backgroundColor="lightyellow";
                     message+="Kindly enter the valid email address in "+title+" ;";
                     isCorrect=false; 
                  }
                  else
                  {
                     el[i].style.backgroundColor="#ffffff";
                  }  
              }
              else
              {
                if(!mail.test(el[i].value) && el[i].value!="")
                  {
                    
                     el[i].style.backgroundColor="lightyellow";
                     message+="Kindly enter the valid email address in "+title+" ;";
                     isCorrect=false;;
                  }
                  else
                  {
                    el[i].style.backgroundColor="#ffffff";
                  }  
              }
            
          }
          else if(att1==1)
          {
             if(blank==1)
              {
                  if(el[i].value=="")
                  {
                     el[i].style.backgroundColor="lightyellow";
                     message+="Kindly fill the "+title+" ;";
                     isCorrect=false;
                  }
                  else if(!num.test(el[i].value))
                  {
                     el[i].style.backgroundColor="lightyellow";
                     message+="Kindly enter the numeric value only in "+title+" ;";
                     isCorrect=false; 
                  }
                  else
                  {
                     el[i].style.backgroundColor="#ffffff";
                  }  
              }
              else
              {
                if(!num.test(el[i].value) && el[i].value!="")
                  {
                    
                     el[i].style.backgroundColor="lightyellow";
                     message+="Kindly enter the numeric value  only in "+title+" ;";
                     isCorrect=false;;
                  }
                  else
                  {
                     el[i].style.backgroundColor="#ffffff";
                  }  
              }
            
          }
          else if(att2==1)
          {
             if(blank==1)
              {
                  if(el[i].value=="")
                  {
                     el[i].style.backgroundColor="lightyellow";
                     message+="Kindly fill the "+title+" ;";
                     isCorrect=false;
                  }
                  else if(!dec.test(el[i].value))
                  {
                     el[i].style.backgroundColor="lightyellow";
                     message+="Kindly enter the numeric/decimal value only in "+title+" ;";
                     isCorrect=false; 
                  }
                  else
                  {
                     el[i].style.backgroundColor="#ffffff";
                  }  
              }
              else
              {
                if(!dec.test(el[i].value) && el[i].value!="")
                  {
                    
                     el[i].style.backgroundColor="lightyellow";
                     message+="Kindly enter the numeric/decimal value  only in "+title+" ;";
                     isCorrect=false;;
                  }
                  else
                  {
                     el[i].style.backgroundColor="#ffffff";
                  }  
              }
            
          }
          else
          {
             document.getElementById(id).style.backgroundColor="#ffffff";
          }
      }
      if(type=="checkbox")
        {
          if(el[i].checked==false)
          {
              el[i].style.backgroudColor="lightyellow";
              message+="Kindly accept the Terms & Conditions; ";
              isCorrect=false;
          }
        }
    }
    
   if(DivCourier.style.display=="block")
    {
      var yes=document.getElementById("rdYes");
      var No=document.getElementById("rdNo");
      if(yes.checked==false && No.checked==false)
      {
        message+="Kindly select the option of hardcopy; ";
        isCorrect=false;
      }  
    }
    if(cash.checked==false && dd.checked==false && cc.checked==false)
    {
          message+="Kindly select the payment option;";
          isCorrect=false;
    }
   if(isCorrect==false)
   {
      //alert(message);
   }
 
   return  isCorrect;
}
function ClearContent(id)
{
   var DivHardCopy=document.getElementById("ctl00_ContentPlaceHolder1_divHardCopy");
   var DivCourier=document.getElementById("ctl00_ContentPlaceHolder1_divCourier");
   var divpayment=document.getElementById("ctl00_ContentPlaceHolder1_PaymentServices");
   var root=document.getElementById(id);
   var el=root.getElementsByTagName("input"); 
   var el1=root.getElementsByTagName("select");
   var len=el.length;
   var len1=el1.length;
   for(var i=0;i<len1;i++)
   {
    el1[i].selectedIndex=0;
    el1[i].style.backgroundColor="#ffffff";
   }
   for(var j=0;j<len;j++)
   {
     var type=el[j].getAttribute("type");
     if(type=="text")
     {
      el[j].value="";
      el[j].style.backgroundColor="#ffffff";
     }
     if(type=="radio")
     {
        el[j].checked=false;
     }
     if(type=="checkbox")
     {
        el[j].checked=false;
     }
   }
   DivCourier.style.display="none";
   DivHardCopy.style.display="none";
   divpayment.style.display="none";
   message="";
}
function ClearContentCommon(id)
{
   var root=document.getElementById(id);
   var el=root.getElementsByTagName("input"); 
   var el1=root.getElementsByTagName("select");
   var len=el.length;
   var len1=el1.length;
   for(var i=0;i<len1;i++)
   {
    el1[i].selectedIndex=0;
   }
   for(var j=0;j<len;j++)
   {
     var type=el[j].getAttribute("type");
     if(type=="text")
     {
      el[j].value="";
     }
     if(type=="radio")
     {
        el[j].checked=false;
     }
     if(type=="checkbox")
     {
        el[j].checked=false;
     }
   }
  
}
function CheckRadio( )
{
    var DivCourier=document.getElementById("ctl00_ContentPlaceHolder1_divHardCopy");
    var cash=document.getElementById("ctl00_ContentPlaceHolder1_rdCash");
    var dd=document.getElementById("ctl00_ContentPlaceHolder1_rdDraft");
    var cc=document.getElementById("ctl00_ContentPlaceHolder1_rdCreditCard");
    
    if(DivCourier.style.display=="block")
    {
      var yes=document.getElementById("ctl00_ContentPlaceHolder1_rdYes");
      var No=document.getElementById("ctl00_ContentPlaceHolder1_rdNo");
      if(yes.checked==false && No.checked==false)
      {
        mes+="Kindly select the option of hardcopy; ";
        correct=false;
      }  
    }
    if(cash.checked==false && dd.checked==false && cc.checked==false)
    {
          mes+="Kindly select the payment option;";
          correct=false;
    }
    
  return correct;
}

function ValidateKeyPress(id)
{
    var tar=document.getElementById(id);
    var type=tar.getAttribute("type");
    var mail= /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
    var num=/^\d+$/;
    var dec= /^[-+]?\d{1,3}(\.\d{1,2})?$/;
    var att=tar.getAttribute("mail");
    var att1=tar.getAttribute("num");
    var att2=tar.getAttribute("dec");
    var blank=tar.getAttribute("blank");
    if(type=="select")
    {
        var str=tar.value.substr(1,3);
        if(str=="Sel")
        {
          tar.style.backgroundColor="lightyellow";
        }
        else
        {
            tar.style.backgroundColor="#ffffff";
        }
    }
   else if(blank==1 && att==null && att1==null && att2==null)
   {
     if(tar.value=="")
      {
        tar.style.backgroundColor="lightyellow";
      }
      else
      {
        tar.style.backgroundColor="#ffffff";
      }  
   }
   else if(att==1)
    {
      if(blank==1)
      {
          if(tar.value=="" || !mail.test(tar.value))
          {
            tar.style.backgroundColor="lightyellow";
          }
          else
          {
            tar.style.backgroundColor="#ffffff";
          }  
      }
      else
      {
        if(!mail.test(tar.value))
          {
            tar.style.backgroundColor="lightyellow";
          }
          else
          {
            tar.style.backgroundColor="#ffffff";
          }  
      }
    }
    else if(att1==1)
    {
      if(blank==1)
      {
          if(tar.value=="" || !num.test(tar.value))
          {
            tar.style.backgroundColor="lightyellow";
          }
          else
          {
            tar.style.backgroundColor="#ffffff";
          }  
      }
      else
      {
        if(!num.test(tar.value))
          {
            tar.style.backgroundColor="lightyellow";
          }
          else
          {
            tar.style.backgroundColor="#ffffff";
          }  
      }
      
    }
    else if(att2==1)
    {
      if(blank==1)
      {
          if(tar.value=="" || !dec.test(tar.value))
          {
            tar.style.backgroundColor="lightyellow";
          }
          else
          {
            tar.style.backgroundColor="#ffffff";
          }  
      }
      else
      {
        if(!dec.test(tar.value))
          {
            tar.style.backgroundColor="lightyellow";
          }
          else
          {
            tar.style.backgroundColor="#ffffff";
          }  
      }
      
    }
}
			
function fund(orderid,name,address,phone,email,pincode,state,city,Amount,country)
{
	document.getElementById('Order_Id').value =orderid;
	document.getElementById('name').value = name;
	document.getElementById('pincode').value = pincode;
	document.getElementById('address').value = address;
	document.getElementById("Ccountry").value=country;
	document.getElementById('phone').value = phone;
	document.getElementById('Cemail').value = email;
	document.getElementById('Ccity').value = city;
	document.getElementById('Cstate').value = state;
	document.getElementById('CAmount').value = Amount;
	return true;	
}
function fund1(orderid,firstname,lastname,address1,address2,phone1,phone2,mobile,email,pincode,state,city,Amount,country)
{
	document.getElementById("item_number").value =orderid;
	document.getElementById("invoice").value =orderid;
	document.getElementById("first_name").value = firstname;
	document.getElementById("last_name").value = lastname;
	document.getElementById("zip").value = pincode;
	document.getElementById("address1").value = address1;
	document.getElementById("country").value=country;
	document.getElementById("night_phone_a").value = phone1;
	document.getElementById("night_phone_b").value = phone2;
	document.getElementById("night_phone_c").value = mobile;
	document.getElementById("email").value = email;
	document.getElementById("city").value = city;
	document.getElementById("state").value = state;
	document.getElementById("amount").value = Amount;
	
	return true;	
}
function SetHeight(id,id1)
{
  var GetTop=document.getElementById(id).offsetTop-40;
 // var GetLeft=document.getElementById(id).offsetLeft-45;
  document.getElementById(id1).style.top=GetTop+"px";
  document.getElementById(id1).style.left=580+"px";
}
function DisplayServices(id,id1)
{
   if(id.indexOf("rdCreditCard")>0)
   {
     document.getElementById(id1).style.display="block";
   }
   else
   {
     document.getElementById(id1).style.display="none";
     var ele=document.getElementById(id1).getElementsByTagName("input");
   
     var len=ele.length;
     for(var i=0;i<len;i++)
     {
        var type=ele[i].getAttribute("type");
        if(type=="radio")
        {
         ele[i].checked=false;
        }
     }
   }
} 

function displayProgress(bar,id1)
{
     var scrOfX = 0;
    var tar=document.getElementById(bar);
    //var y=window.pageYOffset;
    var y=document.body.scrollTop;
    var top1=document.getElementById(id1).offsetTop;
   
     if( typeof( window.pageYOffset ) == 'number' )
      {
    //Netscape compliant
        scrOfY = window.pageYOffset;
        tar.style.top=top1+scrOfY+30+"px";
    }
    else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) )
    {
        //DOM compliant
        scrOfY = document.body.scrollTop;
         tar.style.top=top1+scrOfY+30+"px";
     }
   else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) )
    {
    //IE6 standards compliant mode
     scrOfY = document.documentElement.scrollTop;
  
    }
    tar.style.top=top1+scrOfY+30+"px";
}
function CloseWin(id,id1)
{
     if(document.getElementById(id).style.display=="block")
     {
        ClearContatiner(id);
       document.getElementById(id1).innerHTML="";
       document.getElementById(id).style.display="none";
       
     }
}
function CloseWin1(id)
{
     if(document.getElementById(id).style.display=="block")
     {
       document.getElementById(id).style.display="none";
     }
     else
     {
        document.getElementById(id).style.display="block";
     }
}
function ClearContatiner(id)
{
    var main=document.getElementById(id);
    var inputtype=main.getElementsByTagName("input");
    var len=inputtype.length;
    var optionlist=main.getElementsByTagName("select");
    var len1=optionlist.length;
    var txtarea=main.getElementsByTagName("textarea");
    var len2=txtarea.length;
    for(var i=0;i<len;i++)
    {
     var type=inputtype[i].getAttribute("type");
      if(type=="text")
      {
        inputtype[i].value="";
      }
      else if(type=="radio")
      {
        inputtype[i].checked=false;
      }
      else if(type=="checkbox")
      {
        inputtype[i].checked=false;
      }
    }
    for(var j=0;j<len1;j++)
    {
     optionlist[j].selectedIndex=0;
    }
    for(var k=0;k<len2;k++)
    {
        txtarea[k].value="";
    }
}
function ClearContatiner1(id)
{
    var main=document.getElementById(id);
    var inputtype=main.getElementsByTagName("input");
    var len=inputtype.length;
    var txtarea=main.getElementsByTagName("textarea");
    var len2=txtarea.length;
    for(var i=0;i<len;i++)
    {
     var type=inputtype[i].getAttribute("type");
      if(type=="text")
      {
        inputtype[i].value="";
      }
      else if(type=="radio")
      {
        inputtype[i].checked=false;
      }
      else if(type=="checkbox")
      {
        inputtype[i].checked=false;
      }
    }
   
    for(var k=0;k<len2;k++)
    {
        txtarea[k].value="";
    }
}
function AddUploadFiles(id,id1)
{
    document.getElementById(id1).value+=","+document.getElementById(id).value;
}

//accordian

	
var ContentHeight = 170;
var TimeToSlide = 250.0;

var openAccordion = '';

function runAccordion(index)
{
var nID = "Accordion" + index + "Content";
if(openAccordion == nID)
	nID = '';
    
setTimeout("animate(" + new Date().getTime() + "," + TimeToSlide + ",'" 
	+ openAccordion + "','" + nID + "')", 33);
  
openAccordion = nID;
}

function runAccordion1(index)
{
var nID = "Accordion" + index + "Content";
if(openAccordion == nID)
	nID = '';
    
setTimeout("animate(" + new Date().getTime() + "," + TimeToSlide + ",'" 
	+ openAccordion + "','" + nID + "')", 33);
  
openAccordion = nID;
}

//2nd function


function animate(lastTick, timeLeft, closingId, openingId)
{  
  var curTick = new Date().getTime();
  var elapsedTicks = curTick - lastTick;
  
  var opening = (openingId == '') ? null : document.getElementById(openingId);
  var closing = (closingId == '') ? null : document.getElementById(closingId);
 
  if(timeLeft <= elapsedTicks)
  {
    if(opening != null)
      opening.style.height = ContentHeight + 'px';
    
    if(closing != null)
    {
      closing.style.display = 'none';
      closing.style.height = '0px';
    }
    return;
  }
 
  timeLeft -= elapsedTicks;
  var newClosedHeight = Math.round((timeLeft/TimeToSlide) * ContentHeight);

  if(opening != null)
  {
    if(opening.style.display != 'block')
      opening.style.display = 'block';
    opening.style.height = (ContentHeight - newClosedHeight) + 'px';
  }
  
  if(closing != null)
    closing.style.height = newClosedHeight + 'px';

  setTimeout("animate(" + curTick + "," + timeLeft + ",'" 
      + closingId + "','" + openingId + "')", 33);
}
	
function openCloseContaine(id)
{
  if(document.getElementById(id).style.display=="none")
	{
		document.getElementById(id).style.display="block";
	}
  else
   {

	document.getElementById(id).style.display="none";
   }
}	

function OpenPopUp(id)
{
    document.getElementById(id).style.display="block";
	
}
 
var mydiv=new Array();
  var num=4;
  var myTop=60;
  for(var i=0;i<num;i++)
  {
    mydiv[i]="spnTop"+i;
  }
  
  var currdiv=-1;
function showdiv()
{
  var nextdiv=currdiv+1;
 
  if(nextdiv>=num)
  {
    nextdiv=0;
  }
  for(var j=0;j<num;j++)
  {
    if(nextdiv==j)
    {
      
       document.getElementById(mydiv[j]).style.display="block";
    }
    else
    {
        
       document.getElementById(mydiv[j]).style.display="none";
    }
  }
  currdiv=nextdiv;
  setTimeout("showdiv()",2700);
}

//var mydiv1=new Array();
//  var num1=4;
//  for(var i=0;i<num;i++)
//  {
//    mydiv1[i]="new"+i;
//  }
//  
//  var currdiv1=-1;
//function showdiv1()
//{
//  var nextdiv1=currdiv1+1;
// 
//  if(nextdiv1>=num1)
//  {
//    nextdiv1=0;
//  }
//  for(var j=0;j<num1;j++)
//  {
//    if(nextdiv1==j)
//    {
//      
//       document.getElementById(mydiv1[j]).style.display="block";
//    }
//    else
//    {
//        
//       document.getElementById(mydiv1[j]).style.display="none";
//    }
//  }
//  currdiv1=nextdiv1;
//  setTimeout("showdiv1()",2700);
//}

function setmarquee(margin,height)
{
     var br=navigator.appName;
     var mar=document.getElementById("GalleryMar");
     if(br=="Microsoft Internet Explorer")
     {
        mar.style.marginTop=margin+"px";
        mar.setAttribute("height",height+"px");
     }
}

function ChangeDiv(id,id1)
{
     var inval=document.getElementById(id).value;
     var container=document.getElementById(id1);
     if(inval=="Bulgarian")
     {
        openwindow('pdffiles/Bulgaria.pdf','Cliniminds');
     }
     else if(inval=="Czech")
     {
          openwindow('pdffiles/czech.pdf','Cliniminds');
     }
     else if(inval=="German")
     {
         openwindow('pdffiles/german.pdf','Cliniminds');
     }
     else if(inval=="French")
     {
         openwindow('pdffiles/french.pdf','Cliniminds');
     }
     else if(inval=="Italian")
     {
         openwindow('pdffiles/italian.pdf','Cliniminds');
     }
     else if(inval=="Kazakh")
     {
         openwindow('pdffiles/kazakh.pdf','Cliniminds');
     }
     else if(inval=="Lithuanian")
     {
         openwindow('pdffiles/lithuanian.pdf','Cliniminds');
     }
     else if(inval=="Polish")
     {
         openwindow('pdffiles/poland.pdf','Cliniminds');
     }
     else if(inval=="Romanian")
     {
         openwindow('pdffiles/romanian.pdf','Cliniminds');
     }
     else if(inval=="Russian")
     {
         openwindow('pdffiles/russia.pdf','Cliniminds');
     }
     else if(inval=="Slovak")
     {
         openwindow('pdffiles/slovak.pdf','Cliniminds');
     }
     else if(inval=="Spanish")
     {
         openwindow('pdffiles/spanish.pdf','Cliniminds');
     }
     else if(inval=="English")
     {
         openwindow('pdffiles/english.pdf','Cliniminds');
     }
     else
     {
        alert("Kindly select the language from the list");
     }

}

function displayCurrency(id,id1)
{
    var idstatus=document.getElementById(id);
    if(idstatus.checked==true)
    {
       document.getElementById(id1).style.display="block";
    }
    else
    {
         document.getElementById(id1).style.display="none";
    }
}
function CheckCourseSelect(id)
{
   var container=document.getElementById(id);
   var list=container.getElementsByTagName('input');
   var len=list.length;
   var att,count;
   for(var i=0;i<len;i++)
   {
     count=0;
     att=list[i].getAttribute('type');
     if(att=='checkbox')
     {
       
        if(list[i].checked==true)
        {
            count=1;
            break;
        }
        else
        {
             count=0;
        }
     }   
   }
  
   if(count==0)
   {
    alert("Kindly select the desired course");
    return false;
   
   } 
   else
   {
    return true;
   }
}

function disablecontrol(id)
{
    var br=navigator.appName;
   
    if(br=="Microsoft Internet Explorer")
    {
      document.getElementById(id).setAttribute("disabled","disabled");
    }
}
var myphoto=new Array();
  var len=0;
  var id1="";
  var currphoto=-1;
 function GetGalleryReq(id)
 {
      var container=document.getElementById(id).getElementsByTagName("div");
      len=container.length;
      for(var i=0;i<len;i++)
      {
        id1=container[i].id;
        myphoto[i]=id1;
      }
 }
 function  ShowPhotoGallery()
{
  var nextphoto=currphoto+1;
 
  if(nextphoto>=len)
  {
    nextphoto=0;
  }
  for(var j=0;j<len;j++)
  {
    if(nextphoto==j)
    {
      
       document.getElementById(myphoto[j]).style.display="block";
    }
    else
    {
        
       document.getElementById(myphoto[j]).style.display="none";
    }
  }
  currphoto=nextphoto;
  setTimeout("ShowPhotoGallery()",5000);
}
