<!--
//----------------------------------------------------------------------------------------------------------------------------------

function submitonce(theform){
//if IE 4+ or NS 6+
if (document.all||document.getElementById){
//screen thru every element in the form, and hunt down "submit" and "reset"
for (i=0;i<theform.length;i++){
var tempobj=theform.elements[i]
if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
//disable em
tempobj.disabled=true
}
}
}

//----------------------------------------------------------------------------------------------------------------------------------

function clearDefault(el) {
  if (el.defaultValue==el.value) el.value = ""
}


 function policy() {window.open("/ruta/policy.html", "policy", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,height=550,width=400")}
 function kontakt() {window.open("/ruta/moderatorer.html", "policy", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,height=550,width=400")}
 function nyhetsbrev() {window.open("ruta/nyhetsbrev.html", "nyhetsbrevruta", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,height=410,width=330")}
 function tips() {window.open("ruta/tips.html", "tipsruta", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,height=400,width=280")}
 function feltips() {window.open("ruta/feltips.html", "felruta", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,height=400,width=280")}


function radio(){
	posTop = screen.height - 350;
	posLeft = screen.width - 372;
	window.open("/radio.asp","radio","width=360, height=250, resizable=yes, top=0, left="+posLeft);
	}

function _gel(id){return document.getElementById(id); }

function setRadio(autoPlay){
	radioList = _gel("radioSelector");
	player.filename = radioList.value;
	player.Play();
}


//----------------------------------------------------------------------------------------------------------------------------------

function showhide(obj){
    var obj  = document.getElementById(obj);
    obj.style.display = obj.style.display == "none"?"block":"none";
}

function toggleImage(img)
{
var src1 = img.getAttribute("SRC1"),
src2 = img.getAttribute("SRC2")
with (img) src = new RegExp(src1).test(src) ?
src.replace(src1,src2) : src.replace(src2,src1)
}

 function OpenWin(url,name,width,height,menubar,location,toolbar,scrollbars,resizable,directories)
	{
	var win = window.open(url, name, 'resizable='+resizable+',menubar='+menubar+',scrollbars='+scrollbars+',location='+location+',toolbar='+toolbar+',width='+width+',height='+height+',directories='+directories+'');
	}

 function surfto(form)
        {
       var myindex=form.dest.selectedIndex;
		pageTracker._trackPageview('/external/firstpage/select/' + form.id + '/' + form.dest.options[myindex].text);
       window.open(form.dest.options[myindex].value,target="_blank"); 
        }


function Expand(currMenu) {
    if (document.all) {
	thisMenu = eval("document.all." + currMenu + ".style")
	    if (thisMenu.display == "block") {
		thisMenu.display = "none"
		}
	    else {
		thisMenu.display = "block"
		}
	    return false
	    }
    else {
    return true
    }
}

lagerNamnKlocka="klockan";

function tid()
{
	datum=new Date();
	timmar=datum.getHours();
	minuter=datum.getMinutes();
	sekunder=datum.getSeconds();
	var timmar=0+timmar;
	timmar="0"+timmar
	minuter="0"+minuter
	sekunder="0"+sekunder
	timmar=timmar.substring(timmar.length-2,timmar.length)
	minuter=minuter.substring(minuter.length-2,minuter.length)
	sekunder=sekunder.substring(sekunder.length-2,sekunder.length)
	visar=timmar+":"+minuter+":"+sekunder

	if (document.all)
	{
		document.all[lagerNamnKlocka].innerHTML = visar;
	}
	else if (document.layers)
	{
		with (document[lagerNamnKlocka].document)
		{
			open();
			write(visar);
			close();
		}
	}
	else if (document.getElementById)
	{
		document.getElementById(lagerNamnKlocka).innerHTML=visar;   
	}

	setTimeout("tid()", 1000);
}
setTimeout("tid()", 100);

//-->

function blocket(f) {
	trck('blocket', f.q.value);
	
	window.open("http://www.blocket.se/li?ca=" + f.ca.value + "&th=1&q=" + f.q.value + "&cg=" + f.cg.value + "&w=1");
	
	return false;
}


function pricerunner(f) {
	trck('pricerunner', f.q.value);
	
	window.open("http://www.pricerunner.se/ref-site=Internetstart/ref-ad=searchbox_start/search/?q=" + escape(f.q.value));
	
	return false;
}

function eniro_kos(f) {
	trck('eniro_kos', f.search_word.value);
	
	window.open("http://kopochsalj.eniro.se/query?what=gti&partnerid=internetstart&search_word=" + escape(f.search_word.value) + "&district_code=" + escape(f.district_code.value));
	
	return false;
}

function eniro_supersok(f) {
	trck('eniro_supersok', f.search_word.value);
	
	window.open("http://www.eniro.se/query?search_word=" + escape(f.search_word.value) + "&geo_area=" + escape(f.geo_area.value) + "&what=all&partnerid=internetstart");
	
	return false;
}

function eniro_kli(f) {
	trck('eniro_myndighet', f.search_word.value);
	
	window.open("http://kli.eniro.se/query?search_word=" + escape(f.search_word.value) + "&mncp_name=" + escape(f.mncp_name.value) + "&what=kli&partnerid=internetstart");
	
	return false;
}

goToFlygstart = function() {
	if(document.getElementById('flygstart_from_date').value == '') {
		alert("Du måste välja avresedatum i kalendern");
		return false;
	}
	if(document.getElementById('flygstart_to_date').value == '') {
		alert("Du måste välja hemresedatum i kalendern");
		return false;
	}
	if(document.getElementById('flygstart_from').value == 'Resa från') { 
		document.getElementById('flygstart_from').value = '';
	} 
	
	if(document.getElementById('flygstart_to').value == 'Resa till') { 
		document.getElementById('flygstart_to').value = '';
	} 
	
	window.open('http://www.flygstart.se/?from=' + escape(document.getElementById('flygstart_from').value) + '&to=' + escape(document.getElementById('flygstart_to').value) + '&from_date=' + escape(document.getElementById('flygstart_from_date').value) + '&to_date=' + escape(document.getElementById('flygstart_to_date').value) + '&utm_source=internetstart&utm_medium=searchbox', 'flygstart');
}