function openWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}
function changeUrl(targ,selObj,restore)
{
	if (selObj.name == 'navit02')
	{
		if (selObj.options[selObj.selectedIndex].value == '/video/')
		{
			var newWindow;
			var URL;
			URL = selObj.options[selObj.selectedIndex].value;
			newWindow=window.open(URL,'videopopup','width=750,height=530,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,titlebar=0,resizable=0,top=25,left=20,screenY=25,screenX=20');
			newWindow.focus();
		}
		else
		{
			eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
			if (restore) selObj.selectedIndex=0;
		}
	}
	else
	{
		eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
		if (restore) selObj.selectedIndex=0;
	}
}

function firstFocus(){ 
        if(document.forms.length>0){ 
                     var oForm=document.forms[0]; 
                     for(var i=0;i<oForm.length;i++){ 
                             if((oForm.elements[i].type=="text")|| 
                              (oForm.elements[i].type=="textarea")||   
			      (oForm.elements[i].type.toString().charAt(0)=="s")){ 
                            	document.forms[0].elements[i].focus(); 
                            break; 
        	}
	}
	}
} 	
function CountLength(oEl){
	var intMaxLength = 2355; // maksimipituus
	var intFldLength = oEl.value.length;
	if(intFldLength >= intMaxLength){
		alert('Viestin merkkimaara on taynna.');
		oEl.value = oEl.value.substr(0,oEl.value.length-1); // poista ylimenevä osa
	}else{
		document.forms[0].elements.oLength.value = intFldLength;
	}
	return false;
}
function CountLength2(oEl){
	var intMaxLength = 1000; // maksimipituus
	var intFldLength = oEl.value.length;
	if(intFldLength >= intMaxLength){
		alert('Viestin merkkimaara on taynna.');
		oEl.value = oEl.value.substr(0,oEl.value.length-1); // poista ylimenevä osa
	}else{
		document.forms[0].elements.oLength.value = intFldLength;
	}
	return false;
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i>a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i>d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

        if (document.images) {
            img1on = new Image();
            img1on.src = "/img/navi_jim2.gif";

            img1off = new Image();
            img1off.src = "/img/navi_jim.gif";
			
			img2on = new Image();
            img2on.src = "/img/navi_radiorock2.gif";

            img2off = new Image();
            img2off.src = "/img/navi_radiorock.gif";
			
			img3on = new Image();
            img3on.src = "/img/navi_radioaalto2.gif";

            img3off = new Image();
            img3off.src = "/img/navi_radioaalto.gif";

			img4on = new Image();
            img4on.src = "/img/navi_kinotv2.gif";

            img4off = new Image();
            img4off.src = "/img/navi_kinotv.gif";
						
			img5on = new Image();
            img5on.src = "/img/navi_urheilukanava2.gif";

            img5off = new Image();
            img5off.src = "/img/navi_urheilukanava.gif";
	    }
function imgOn(imgName) {
        if (document.images) {
            document[imgName].src = eval(imgName + "on.src");
        }
}
function imgOff(imgName) {
        if (document.images) {
            document[imgName].src = eval(imgName + "off.src");
        }
}

function newsVideoPopup()
{
	var newWindow;
	newWindow=window.open("/uutisvideot/default.asp","videopopup","width=800,height=600,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,titlebar=no,resizable=no,top=25,left=20,screenY=25,screenX=20");
	newWindow.focus();
	return false;

}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//-->
