
window.onload= function (){
/*
if (top.location != self.location) {
top.location = self.location.href
}
*/

}





function newWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);

}



function validateform(){

if ((document.MainForm.firstname.value=="")||

(document.MainForm.lastname.value=="")||

(document.MainForm.company.value=="")||

(document.MainForm.country.value=="")||

(document.MainForm.email.value=="")){
  window.alert ("Please fill out all of the required fields!")
  return false;
  }
  else {

  if ((!document.MainForm.region[0].checked) && (!document.MainForm.region[1].checked) && (!document.MainForm.region[2].checked) && (!document.MainForm.region[3].checked))
   {
   alert("Please select a region.");
   return false;
   }

  return true;
}

 }

function validateformEMS(){

if ((document.MainForm.firstname.value=="")||

(document.MainForm.lastname.value=="")||

(document.MainForm.company.value=="")||

(document.MainForm.country.value=="")||


(document.MainForm.email.value=="")){
  window.alert ("Please fill out all of the required fields!")
  return false;
  }
  else {

  return true;
}

 }








function validateformGPS()

{

if ((document.MainForm.firstname.value=="")||

(document.MainForm.lastname.value=="")||

(document.MainForm.company.value=="")||

(document.MainForm.country.value=="")||

(document.MainForm.email.value=="")){
  window.alert ("Please fill out all of the required fields!")
  return false;
  }
  else {

  if ((!document.MainForm.region[0].checked) && (!document.MainForm.region[1].checked) && (!document.MainForm.region[2].checked) && (!document.MainForm.region[3].checked))
   {
   alert("Please select a region.");
   return false;
   }

  return true;
}

 }



function validateformDatabook()

{

if ((document.MainForm.firstname.value=="")||

(document.MainForm.lastname.value=="")||

(document.MainForm.company.value=="")||

(document.MainForm.address.value=="")||

(document.MainForm.city.value=="")||

(document.MainForm.ZIP.value=="")||

(document.MainForm.country.value=="")||

(document.MainForm.email.value==""))

{

window.alert ("Please fill out all of the required fields!")

return false;

}

}












// JS HTTP capabilities
var xmlHttp = null;
// Mozilla, Opera, Safari sowie Internet Explorer 7
if (typeof XMLHttpRequest != 'undefined') {
    xmlHttp = new XMLHttpRequest();
}
if (!xmlHttp) {
    // Internet Explorer 6 und älter
    try {
        xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP");
    } catch(e) {
        try {
            xmlHttp  = new ActiveXObject("Microsoft.XMLHTTP");
        } catch(e) {
            xmlHttp  = null;
        }
    }
}


function getHttpData(url,famid,timeout){

    if (xmlHttp) {
        xmlHttp.open('GET', url, true);
        xmlHttp.onreadystatechange = function () {
          if (xmlHttp.readyState == 4) {
            window.clearTimeout(ende)
            if (xmlHttp.status == 200) {
              document.getElementById('data'+famid).innerHTML = xmlHttp.responseText;
	    }else{
              document.getElementById('data'+famid).innerHTML = "&nbsp;Error: could not connect to database. ("+xmlHttp.status+")";
	    }
	      document.getElementById('loader'+famid).style.visibility = "hidden"
          }
          else if (xmlHttp.readyState == 1) {
		 document.getElementById('loader'+famid).style.visibility = "visible"
	  }

        };
    };
    ende = window.setTimeout("problem("+famid+")",timeout);
    xmlHttp.send(null);
}

function problem(famid){

 xmlHttp.onreadystatechange = function () {}
 xmlHttp.abort()

 document.getElementById('data'+famid).innerHTML = "<br/>&nbsp;Error: could not connect to database.<br/><br/>";
 document.getElementById('loader'+famid).style.visibility = "hidden"

}


function detectBrowser() { 
    var BO = new Object(); 
    BO["ie"]        = false /*@cc_on || true @*/; 
    BO["ie4"]       = BO["ie"] && (document.getElementById == null); 
    BO["ie5"]       = BO["ie"] && (document.namespaces == null) && (!BO["ie4"]); 
    BO["ie6"]       = BO["ie"] && (document.implementation != null) && (document.implementation.hasFeature != null); 
    BO["ie55"]      = BO["ie"] && (document.namespaces != null) && (!BO["ie6"]); 
    /*@cc_on
    BO["ie7"]       = @_jscript_version == '5.7';
    @*/ 
    BO["ie7"] = (BO["ie"] && document.implementation != null && document.compatMode != null && window.XMLHttpRequest != null)
    BO["ns4"]       = !BO["ie"] &&  (document.layers != null) &&  (window.confirm != null) && (document.createElement == null); 
    BO["opera"]     = (self.opera != null); 
    BO["gecko"]     = (document.getBoxObjectFor != null); 
    BO["khtml"]     = (navigator.vendor == "KDE"); 
    BO["konq"]      = ((navigator.vendor == 'KDE') || (document.childNodes) && (!document.all) && (!navigator.taintEnabled)); 
    BO["safari"]    = (document.childNodes) && (!document.all) && (!navigator.taintEnabled) && (!navigator.accentColorName); 
    BO["safari1.2"] = (parseInt(0).toFixed == null) && (BO["safari"] && (window.XMLHttpRequest != null)); 
    BO["safari2.0"] = (parseInt(0).toFixed != null) && BO["safari"] && !BO["safari1.2"]; 
    BO["safari1.1"] = BO["safari"] && !BO["safari1.2"] && !BO["safari2.0"]; 
    return BO; 
} 
 

function toggleSection (idSection,idText) {

 styleDisplay = document.getElementById(idSection).style.display;
 if(styleDisplay == "none"){
  document.getElementById(idSection).style.display='block';
  document.getElementById(idText).innerHTML='show less'
  document.getElementById(idText).className ='showless'
 }
 else{
 document.getElementById(idSection).style.display='none';
 document.getElementById(idText).innerHTML='show more'
  document.getElementById(idText).className ='showmore'
 }
 self.focus()

}



