
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];}
}

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_findObj(n, d) { //v4.0
 	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 && document.getElementById) x=document.getElementById(n); return x;
}
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function loginPopup(){
	popUpWindow('http://extnet.modernaforsakringar.se:80/konsument/jsp/index.jsp?obl_inparam_anvtyp=K&obl_inparam_redenhet=5&visa_login_sida=Ja', 0, 0, 0, 0);
	}

function popUpInsurance(prodID)
		{
			var popUpWin=0;
		  if(popUpWin)
		  {
			if(!popUpWin.closed) popUpWin.close();
		  }
		  var left = 0
		  var top = 0
		  var width = 705
		  var height = 800
		  var urlPop = ''
		  
		  switch(prodID)
		  {
		  	//Villaförsäkring
		  	case 1:
		  	urlPop = 'https://extnet.modernaforsakringar.se/konsument/initBeraknaPremie.do?obl_inparam_redenhet=5&obl_inparam_anvtyp=PK&objgrp=201&kundnr=0&redenhetid=5&prodgrp=10'
			break
		  	
			//HemFörsäkring
		  	case 2:
		  	urlPop = 'https://extnet.modernaforsakringar.se/konsument/initBeraknaPremie.do?obl_inparam_redenhet=5&obl_inparam_anvtyp=PK&objgrp=102&kundnr=0&redenhetid=5&prodgrp=3'
			break
			
			//FritidFörsäkring
			case 3:
			urlPop = 'https://extnet.modernaforsakringar.se/konsument/initBeraknaPremie.do?obl_inparam_redenhet=5&obl_inparam_anvtyp=PK&objgrp=301&kundnr=0&redenhetid=5&prodgrp=11'
			break
			
			//Olycksfallsförsäkring
			case 4:
			urlPop = 'https://extnet.modernaforsakringar.se/konsument/initBeraknaPremie.do?obl_inparam_redenhet=5&obl_inparam_anvtyp=PK&objgrp=602&kundnr=0&redenhetid=5&prodgrp=6'
			//urlPop = ""
			//alert("edit the javascriptfunction popUpInsurance in the default.asp")
			break
		  }
		 	if (!urlPop == "")
			{
		  		popUpWin = open(urlPop, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
			}
		}



/*
This Function will validate the report ordering form located at:
Företag, Rapporter, Beställ rapporter
*/

function formTestare(){
	if (theForm.namn.value.length < 1){
		alert("Please write your name!");
		theForm.namn.focus();
		return (false);
	}
	
	if (theForm.adress.value.length < 1){
		alert("Please write your address!");
		theForm.adress.focus();
		return (false);
	}
	
	if (theForm.postadress.value.length < 1){
		alert("Please write your postal address!");
		theForm.postadress.focus();
		return (false);
	}
	return (true);
}