/* moved from template_179_split.asp */
avdnr = ('<%=avdnr%>');

ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false
isNS6 = (!document.all && document.getElementById) ? true : false;

function bg_change(denna, farg) {
	if (ie4) document.all[denna].style.background = farg;
	if (isNS6) document.getElementById(denna).style.background = farg;	
}

function openValWindow(inSrc) {
	var newWindowName = 'PopupVal';

	popupwindow = window.open(inSrc, newWindowName, 'width=950,height=740,left=50,top=0,menubar=1,status=1,scrollbars=1,toolbar=0,location=0,directories=0,resizable=yes');

	if(window.focus)
	popupwindow.focus();
}

function goget(adr) {
    document.location=adr
}

function windefaults() {
	delay=300; 
	w='550'; //new window width
	h='400'; //new window height
	l='yes'; //new window location
	s='yes'; //new window status
	m='yes'; //new window menu
	b='yes'; //new window scrollbars

   if ((navigator.appName == "Microsoft Internet Explorer") &&
        (navigator.userAgent.indexOf('3.0') != -1) &&
        (navigator.userAgent.indexOf('Win') != -1))
	    {t='yes'}       //new window toolbar
   else
	    {t='no'}       //new window toolbar
}

namn=0;
windefaults();

function fonster() {
	param="toolbar="+t+",width="+w+",height="+h+",directories=no,status="+s+",scrollbars="+b+",resizable=yes,copyhistory=yes,location="+l+",menubar="+m+"";
	if  (navigator.appName == "Microsoft Internet Explorer") {
	if (!window.nyttfonster) {
	    setTimeout('oppnarandom()',delay);
	} else {
	    fonster2();
	}
    } else {
	if (!window.nyttfonster || window.nyttfonster.closed) {
	    setTimeout('oppnarandom()',delay) ;
	} else {
	    fonster2();
	}
  }
}

function fonster2() {
    nyttfonster=window.open("",namn,param);       
    nyttfonster.close();
    setTimeout('oppnarandom()',delay) ;
}

function oppnarandom() {
    total = 1000000 ;
    randomnumber = Math.random() ;
    namn = Math.round( (total-1) * randomnumber) + 1 ;
    nyttfonster=window.open(adress,namn,param);
    windefaults();
}

function go(adr) {
    opener.content.location.href=adr
    window.close();
}

function lank(sida) {
    parent.location.href=(sida);
}

