var dom			= document.getElementById ? 1 : 0;
var ie			= document.all ? 1 : 0;
var mac			= (navigator.userAgent.indexOf("Mac") > -1) ? 1 : 0;
var ieReal		= (ie && (!mac) && ( typeof(window.offscreenBuffering) != 'undefined') ) ? 1 : 0;
var isActiveX	= ieReal;
var isSp2		= ieReal && (window.navigator.userAgent.indexOf("SV1") != -1);

//----------
function gotopage(mainmenu_str,submenu_str,subsubmenu_str){
    document.location="index.asp?m="+mainmenu_str+"&s="+submenu_str+"&s2="+subsubmenu_str;
}
//----------
function printpage(mainmenu_str,submenu_str,subsubmenu_str){
   window.open("printpage.asp?m="+mainmenu_str+"&s="+submenu_str+"&s2="+subsubmenu_str,"PrintVersion","left=100, top=100, width=720, height=650, status=no, resizable=no, scrollbars=yes");
}
//----------
function ShowCursusGroep(cursusgroep){
    if(cursusgroep.toUpperCase()=="BHV"){
	    if(document.getElementById("cursusgroep_VCA"))
	        document.getElementById("cursusgroep_VCA").style.display="none";
	    if(document.getElementById("cursusgroep_VLH"))
	        document.getElementById("cursusgroep_VLH").style.display="none";
	    if(document.getElementById("cursusgroep_BHV").style.display=="inline"){
	        document.getElementById("cursusgroep_BHV").style.display="none";
			document.getElementById("cursusgroeprow_BHV").className="navlft_row_cursusgroep";	
	    }else{
		    document.getElementById("cursusgroep_BHV").style.display="inline";
			document.getElementById("cursusgroeprow_BHV").className="navlft_row_cursusgroep_on";
		}		
		document.getElementById("cursusgroeprow_VCA").className="navlft_row_cursusgroep";		
		document.getElementById("cursusgroeprow_VLH").className="navlft_row_cursusgroep";	
	}
	
	if(cursusgroep.toUpperCase()=="VCA"){
	    if(document.getElementById("cursusgroep_BHV"))
	        document.getElementById("cursusgroep_BHV").style.display="none";
	    if(document.getElementById("cursusgroep_VLH"))
	        document.getElementById("cursusgroep_VLH").style.display="none";			
	    if(document.getElementById("cursusgroep_VCA").style.display=="inline"){
	        document.getElementById("cursusgroep_VCA").style.display="none";	
			document.getElementById("cursusgroeprow_VCA").className="navlft_row_cursusgroep";
	    }else{
		    document.getElementById("cursusgroep_VCA").style.display="inline";
			document.getElementById("cursusgroeprow_VCA").className="navlft_row_cursusgroep_on";
		}					
		document.getElementById("cursusgroeprow_BHV").className="navlft_row_cursusgroep";	
		document.getElementById("cursusgroeprow_VLH").className="navlft_row_cursusgroep";	
	}
	
	if(cursusgroep.toUpperCase()=="VLH"){
	    if(document.getElementById("cursusgroep_BHV"))
	        document.getElementById("cursusgroep_BHV").style.display="none";
	    if(document.getElementById("cursusgroep_VCA"))
	        document.getElementById("cursusgroep_VCA").style.display="none";			
	    if(document.getElementById("cursusgroep_VLH").style.display=="inline"){
	        document.getElementById("cursusgroep_VLH").style.display="none";	
			document.getElementById("cursusgroeprow_VLH").className="navlft_row_cursusgroep";
	    }else{
		    document.getElementById("cursusgroep_VLH").style.display="inline";
			document.getElementById("cursusgroeprow_VLH").className="navlft_row_cursusgroep_on";
		}					
		document.getElementById("cursusgroeprow_BHV").className="navlft_row_cursusgroep";	
		document.getElementById("cursusgroeprow_VCA").className="navlft_row_cursusgroep";	
	}	
    
}
//----------
function DoActionAction(){
    setTimeout("HideActionAction()", 2000);
}
//----------
function HideActionAction(){
    document.getElementById("action_header").style.color="gray";
    setTimeout("ShowActionAction()", 1700);
}
//----------
function ShowActionAction(){
    document.getElementById("action_header").style.color="#cc5200";
    setTimeout("HideActionAction()", 1700);
}
//----------
function ShowSmenu(mainmenu_str){
   if(mainmenu_str=="0"){
      CreateCursussen();
   }else if(mainmenu_str=="1"){
      CreatePerspektief();
   }else if(mainmenu_str=="2"){
      CreateContact();
   }   
}
//----------
function ShowSsmenu(mainmenu,submenu){
   if(mainmenu.toUpperCase()=="CURSUSSEN"){
      document.location="index.asp?m=0&s="+submenu+"&s2=";
   }else if(mainmenu.toUpperCase()=="INTRODUCTIE"){
      document.location="index.asp?m=1&s="+submenu;
   }else if(mainmenu.toUpperCase()=="CONTACT"){
      document.location="index.asp?m=2&s="+submenu;
   }
}
//----------
function ShowContent(mainmenu_str,submenu,subsubmenu){
   if(mainmenu_str=="0"){
      document.location="index.asp?m="+mainmenu_str+"&s="+submenu+"&s2="+subsubmenu;
   }
}
//----------
function ShowAgenda(){
   if(document.getElementById("content_agenda").style.display=='inline'){
       document.getElementById("content_agenda").style.display='none';
	   document.getElementById("pic_trainingsdata").innerHTML='<img src="images/trainingsdata.jpg" border="0" />';
   }else{
       document.getElementById("content_agenda").style.display='inline';
	   document.getElementById("pic_trainingsdata").innerHTML='<img src="images/trainingsdata_hide.jpg" border="0" />';
   }
}
//----------
function RemoveAllDivs(){
   while(document.getElementById("smenu").hasChildNodes()){
      document.getElementById("smenu").removeChild(document.getElementById("smenu").childNodes[0]);
   }
}
//----------
function CreateCursussen(){

   document.getElementById("tab0").className="tab_header_green";
   document.getElementById("tab1").className="tab_header_gray";
   document.getElementById("tab2").className="tab_header_gray";

   document.getElementById("smenu0").style.display="inline";
   document.getElementById("smenu1").style.display="none";
   document.getElementById("smenu2").style.display="none";
      
}
//----------
function CreatePerspektief(){

   document.getElementById("tab0").className="tab_header_gray";
   document.getElementById("tab1").className="tab_header_green";
   document.getElementById("tab2").className="tab_header_gray";

   document.getElementById("smenu0").style.display="none";
   document.getElementById("smenu1").style.display="inline";
   document.getElementById("smenu2").style.display="none";
      
}
//----------
function CreateContact(){

   document.getElementById("tab0").className="tab_header_gray";
   document.getElementById("tab1").className="tab_header_gray";
   document.getElementById("tab2").className="tab_header_green";
   
   document.getElementById("smenu0").style.display="none";
   document.getElementById("smenu1").style.display="none";
   document.getElementById("smenu2").style.display="inline";   

}
function OpenWindow(val){
   var nextpage="";
   if(val=="pac"){
      nextpage="pac.asp";
   }else if(val=="cedeo"){
      nextpage="http://www.cedeo.nl/";
   }else if(val=="accu"){
      nextpage="http://www.accu-edu.com/";	 
   }else if(val=="veritas"){
      nextpage="http://www.bureauveritas.nl/";		   
   }else{
      return;
   }
   window.open(nextpage, 'newwindow', 'width=780, height=500, left=100, top=100, resizable=yes, menubar=yes, scrollbars=yes, location=yes, hotkeys=yes, directories=yes, toolbar=yes, status=yes');
}
//----------
function register_student(submenu){
	if( (document.form_register.Company_Name.value.replace(/\s/ig,'') == "") || 
	    (document.form_register.Company_Address.value.replace(/\s/ig,'') == "") ||
	    (document.form_register.Company_City.value.replace(/\s/ig,'') == "") ||
	    (document.form_register.Company_Email.value.replace(/\s/ig,'') == "") ||
	    (document.form_register.Company_Phone.value.replace(/\s/ig,'') == "") ||
	    (document.form_register.Company_Contact.value.replace(/\s/ig,'') == "") ||
	    (document.form_register.Company_Gender.value == "") ||
	    (document.form_register.Company_Function.value.replace(/\s/ig,'') == "") ||
	    (document.form_register.Study.value.replace(/\s/ig,'') == "") ||
	    (document.form_register.Training.value.replace(/\s/ig,'') == "") ||
	    (document.form_register.StartDate.value.replace(/\s/ig,'') == "") ||
	    (document.form_register.TrainingsCity.value.replace(/\s/ig,'') == "") ||
	    (document.form_register.Student_LastName.value.replace(/\s/ig,'') == "") ||
	    (document.form_register.Student_Gender.value == "") ||
	    (document.form_register.Student_FirstName.value.replace(/\s/ig,'') == "") ||
	    (document.form_register.Student_Email.value.replace(/\s/ig,'') == "") ||
	    (document.form_register.Student_DateOfBirth.value.replace(/\s/ig,'') == "") ||
	    (document.form_register.Student_CityOfBirth.value.replace(/\s/ig,'') == "") ||
		(document.form_register.Student_Function.value.replace(/\s/ig,'') == "") ||
		(document.form_register.Student_Notes.value.replace(/\s/ig,'') == "") ||
	    (document.form_register.Conditions.checked == false) 
    ){
		window.alert("Verzenden van formulier nog niet mogelijk. Vul eerst de verplichte velden in.");
		
		for(var i=0;i<document.form_register.length;++i){
		    if(document.form_register[i].name!="Company_Fax" &&
			   ((document.form_register[i].name!="Conditions" && document.form_register[i].value.replace(/\s/ig,'')=="") ||
			    (document.form_register[i].name=="Conditions" && document.form_register[i].checked==false))){
			       document.form_register[i].focus();
				   break;
			}
		}
		
	}else{   
	    document,form_register.button_submit.disabled=true;
		document,form_register.button_submit.value="Verzenden...";	
		document,form_register.action="mail_registration.asp?m=2&s="+submenu;
		document.form_register.submit();
	}
}
//----------
function send_question(submenu){
	if((document.form_question.Question_Name.value.replace(/\s/ig,'') == "") || 
	    (document.form_question.Question_Company.value.replace(/\s/ig,'') == "") ||
	    (document.form_question.Question_Email.value.replace(/\s/ig,'') == "") ||
		(document.form_question.Question_City.value.replace(/\s/ig,'') == "") ||
		(document.form_question.Question_Phone.value.replace(/\s/ig,'') == "") ||
		(document.form_question.Question_Fax.value.replace(/\s/ig,'') == "") ||
		(document.form_question.Question_Function.value.replace(/\s/ig,'') == "") ||
	    (document.form_question.Question_Question.value.replace(/\s/ig,'') == "") 
    ){
		window.alert("Verzenden van formulier nog niet mogelijk. Vul eerst de verplichte velden in.");
		
		for(var i=0;i<document.form_question.length;++i){
		    if(document.form_question[i].value.replace(/\s/ig,'')==""){
				   document.form_question[i].focus();
				   break;
			}
		}
	}else{
	    document,form_question.button_submit.disabled=true;
		document,form_question.button_submit.value="Verzenden...";
		document,form_question.action="mail_question.asp?m=2&s="+submenu;
		document.form_question.submit();
	}
}	

function ViewConditions(){
    window.open('conditions.asp','Algemenevoorwaarden', 'width=550, height=600, left=100, top=100, menubar=no, scrollbars=yes, location=no, hotkeys=no, directories=no, toolbar=no, status=no');
}
//----------
function choose_language(page,subpage,lang){
   document.location="index.asp?mid="+page+"&sid="+subpage+"&lang="+lang;
}
//----------
function select_footer(page,lang,fp){
   document.location="index.asp?mid="+page+"&sid=&lang="+lang+"&fp="+fp;
}
//----------
function classnew(obj,new_style) {
   obj.className=new_style;
}
