<!-- Start
// Rakentaja.net frame pakotus, yleiset toiminnot v2.0

function requestQuerystring(targ){
	prts = location.search.substr(1).split("&")
	for(nn=0;nn<prts.length;nn++){
		if(prts[nn].split("=")[0] == targ){
			return prts[nn].split("=")[1]
		}
	}
} 
 
 function setCookie(c_name,value,expiredays)
{var exdate=new Date()
exdate.setDate(exdate.getDate()+expiredays) 
document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate)
} 

function getCookie(c_name) 
{
if (document.cookie.length>0) 
  {
  c_start=document.cookie.indexOf(c_name + "=")
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1 
    c_end=document.cookie.indexOf(";",c_start)
    if (c_end==-1) c_end=document.cookie.length
    return unescape(document.cookie.substring(c_start,c_end))
    } 
  }
return null
}

function poistavalikko() {
	setCookie('valikkopois','1',180);
	window.location.reload(false);
}

var que = unescape(location.search);
if (requestQuerystring("frame") == "0") {
	}  
else {
	if (parent.frames.length==0) {
	   //pakotus v.2
	   leftHalf="http://"+location.host;
	   rightHalf=location.pathname +que;
	   location.replace(leftHalf+"/index.asp?s="+rightHalf);
	}
}

var prototyyppi = location.protocol
function tulostatama(){
	if (que != "") {
		sivulinkki = prototyyppi + "//"+location.host + location.pathname + que +'&frame=0&tulosta=1' 

	}
	else {
		sivulinkki = prototyyppi + "//"+location.host + location.pathname + '?frame=0&tulosta=1' 
	} 
	window.open(sivulinkki,'mywindow','width=650,height=600,scrollbars=yes')
}
if (requestQuerystring("tulosta") == "1"){
	self.setTimeout('print()', 10) ;
}

var urlAddress = "http://"+location.host + location.pathname + que;
var pageName = document.title; 
function addToFavorites() { 
 	if (window.external) { 
		window.external.AddFavorite(urlAddress,pageName) 
	} else { 
		alert("Selaimesi ei tue tätä ominaisuutta!"); 
	} 
} 

//  End -->