function Init(){
var pageId = StikMig('url',false);
var sendOK = StikMig('formsubmit',false);

document.getElementById("Contacts").fld5.value = location.host;
document.getElementById("Contacts").fld6.value = pageId;

if(sendOK=="ok"){
document.getElementById("mailOK").style.display="";
}
else{
document.getElementById("sendmail").style.display="";
}
}

function StikMig(parm,local){
var url;
if(local) url=location.href;
else url = parent.location.href;
var hasparm = url.indexOf(parm);
if(hasparm == -1) return '';
else{
 var start = url.indexOf(parm) + parm.length + 1;
 var slut = url.substring(start).indexOf('&');
 if(slut==-1) slut = url.length;
 return unescape(url.substring(start,slut+start));
 }
}

function move(){
top.globalFormID = "rateThisPageForm";
top.sprog = "DA";

radios = document.getElementsByName("fld1");

hit = false;

for(i=0;i<radios.length;i++){
if(document.getElementsByName("fld1")[i].checked) hit = true;
}

if(!hit){
	alert("Please choose a rating.");
    return true;
}
if(checkEmpty('fld2','Name','EN')) return true; 
if(checkEmpty('fld3','E-mail','EN')) return true;
if(checkEmail('fld3','EN')) return true;

if(document.getElementById("Contacts").fld6.value==""){ alert("The function can't be used from this page.");return true; }

document.getElementById("Contacts").kvitURL.value = location.protocol+"//"+location.host+"/Documents/rateThisPage/rateThisPageEN.htm?formsubmit=ok";
document.getElementById("Contacts").submit();

}

function closeWin(){window.close();}

window.onload = Init;
