function visHovedside(){
	document.location.href="default.asp";
}

function visEntreprenor(){
	document.location.href="entreprenor.asp?proid=12";
}

function visMM(fid){
	document.location.href="entreprenor.asp?d=1&proid="+fid;
}

function visNyheter(){
	document.location.href="nyheter.asp";
}

function visAktiviteter(){
	document.location.href="aktiviteter.asp";
}

function visMentor(){
	document.location.href="mentorogcoach.asp?d=1&id=1";

}

function visBilde(pic,title,txt){
	document.images['bigPic'].src=pic;
	//document.getElementById('bTittel').innerText = title;
	//document.getElementById('bTekst').innerText = txt;
}

function visNyhetsBilde(pic,title,txt){
	document.images['bigPic'].src='admin/data/images/'+pic;
	document.getElementById('bTittel').innerHTML = title;
	document.getElementById('bTekst').innerHTML = txt;
}

function disp(meny,imgs){
var myImgs = document.getElementById(imgs);
var myTema = document.getElementById(meny);
if (myTema.style.display =="none"){
myTema.style.display="block";
myImgs.src="admin/images/ups.gif"
//myMeny.innerHTML = "- Aktuelt"
}else{
myTema.style.display="none";
myImgs.src="admin/images/downs.gif"
//myMeny.innerHTML = "+ Aktuelt"
}
}

function visSamarbeidspartnere(){
	document.location.href="samarbeidspartnere.asp"
}

function visPartner(pid,pp){
	document.location.href="vissamarbeidspartner.asp?id="+pid+"&pp="+pp

}

function visFylke(fnr){
	document.location.href="fylke.asp?f="+fnr

}

function goHto(){
	document.location.href="http://www.hyperlinkto.com";
}

function radioButtons(rID, a){
var radioArray = Array("chk0", "chk1", "chk2");
var thisRadioButton = document.getElementById(rID)	
//alert(a)
	for (var i = 0; i < radioArray.length; i++) { 
		document.getElementById(radioArray[i]).src="admin/images/f_off.gif"		
		if (radioArray[i]==rID) { 
			thisRadioButton.src="admin/images/f_on.gif"
			document.reg.ftype.value=a
		}



	} 
}

function send_onclick(){
	alert('sender');
}

function echeck(str) {

	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){
	   alert("Ugyldig epostadresse\nsSjekk at du har skrevet inn riktig epostadresse")
	   return false
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   alert("Ugyldig epostadresse\nsSjekk at du har skrevet inn riktig epostadresse")
	   return false
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
	    alert("Ugyldig epostadresse\nsSjekk at du har skrevet inn riktig epostadresse")
	    return false
	}

	 if (str.indexOf(at,(lat+1))!=-1){
	    alert("Ugyldig epostadresse\nsSjekk at du har skrevet inn riktig epostadresse")
	    return false
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
	    alert("Ugyldig epostadresse\nsSjekk at du har skrevet inn riktig epostadresse")
	    return false
	 }

	 if (str.indexOf(dot,(lat+2))==-1){
	    alert("Ugyldig epostadresse\nsSjekk at du har skrevet inn riktig epostadresse")
	    return false
	 }
		
	 if (str.indexOf(" ")!=-1){
	    alert("Ugyldig epostadresse\nsSjekk at du har skrevet inn riktig epostadresse")
	    return false
	 }

	 return true

}

function ValidateForm(){
	var navn=document.kontaktForm.navn
	var epost=document.kontaktForm.epost


	
	if ((navn.value==null)||(navn.value=="")){
		alert("Du må fylle inn ditt navn")
		navn.focus()
		return false
	}


	if ((epost.value==null)||(epost.value=="")){
		alert("Vennligst skriv inn din epostadresse")
		epost.focus()
		return false
	}
	if (echeck(epost.value)==false){
		epost.value=""
		epost.focus()
		return false
	}

	//return true;
	kontaktForm.submit();
 }

function sjekkForm(){
var teksten="Ja takk, jeg vil gjerne motta nyheter fra Kragerø Spa Resort";
if (kontaktForm.booking.value=='Nyhetsbrev'){
	kontaktForm.tekst.value=teksten;
   }else{
	kontaktForm.tekst.value='';	
   }
}

function getMenuObject(obj) {
	var theObj
	if (document.layers) {
		if (typeof obj == "string") {
		// just one layer deep
			return document.layers[obj]
		} else {
		// can be a nested layer
			return obj
		}
	}
	
	if (document.getElementById) {
		if (typeof obj == "string") {
			return document.getElementById(obj)
		} else {
			return obj.style
		}
	}

	if (document.all) {
		if (typeof obj == "string") {
			return document.all(obj)
		} else {
			return obj
		}
	}
	return null
}


function showMenuDiv(divID){
	var theObj = getMenuObject(divID)
	theObj.style.visibility = "visible";
}

function hideMenuDiv(divID){
	var theObj = getMenuObject(divID)
	theObj.style.visibility = "hidden";
}

function cOn(td){
if(document.getElementById||(document.all && !(document.getElementById))){
td.style.backgroundColor="#FFFFFF";

}
}

function cOut(td){
if(document.getElementById||(document.all && !(document.getElementById))){
td.style.backgroundColor="#74918D";
}
}

function horisontalOver(td){
if(document.getElementById||(document.all && !(document.getElementById))){
td.style.backgroundColor="#C2C2CA";

}
}

function horisontalOut(td){
if(document.getElementById||(document.all && !(document.getElementById))){
td.style.backgroundColor="#DEDEDE";
}
}
