/* Javascript-dokument for BpL, skapad av HuConn */

/* ------ Allmanna funktioner ------ */

function exit(){
	close();
}

function HC_gotoURL(url) { 
window.location=(url);
}

function HC_setFocus(id) {
document.getElementById(id).focus();
}

function HC_setValue(id, value) {
document.getElementById(id).value=value;
}

function HC_setText(id, text) {
document.getElementById(id).innerHTML=text;
}

function HC_alertMsg(msg){
alert(msg);
}

/* Anropas inifran en fancybox pa onClick-event */
function HC_close_fancybox() { 
parent.$.fn.fancybox.close();
}

function HC_confirmURL(msg, url, how) { 
if (how=="true") { if (confirm(msg)) { window.location=(url); } }
else { if (confirm(msg)==false) { window.location=(url); } }
}

function HC_movepic(id, img_src) {
document.getElementById(id).src=img_src;
}

function HC_setVisibility(id, visibility){
document.getElementById(id).style.visibility = visibility;
}

function HC_openWindow(theURL,winName,features) {
popupWin = window.open(theURL,winName,features);
popupWin.focus();
}

function HC_openDialog(theURL,winName,winWidth,winHeight) {
popupWin = window.open(theURL,winName, 
'toolbar=no,location=no,directories=no,status=no,resizable=no,menubar=no,scrollbars=no,width=' + winWidth + ',height=' + winHeight);
popupWin.focus();
}

/* ------ Speciella funktioner ------ */

function openiNet(url, myname) { popupWin = window.open(url, myname, 
	'status=no, resizable=yes, menubar=no, scrollbars=yes, width=980, height=640');
	popupWin.focus();
}

/* Ta bort texten och satt regionen vid mouseOut pa kartan */
function HC_bytRegion(id) {
document.getElementById(id).innerHTML='';
visaRegion();
}

/* Byt region vid val pa regionsmenyn i formularet s18 */
function visaRegion(){
val = document.sokG.Region.selectedIndex;
if(val==0){document.getElementById('bilden').src=image22.src;}
else{
	if(val==1){
	document.getElementById('bilden').src=image1.src;
	}
	else if(val==2){
	document.getElementById('bilden').src=image2.src;
	}
	else if(val==3){
	document.getElementById('bilden').src=image3.src;
	}
	else if(val==4){
	document.getElementById('bilden').src=image4.src;
	}
	else if(val==5){
	document.getElementById('bilden').src=image5.src;
	}
	else if(val==6){
	document.getElementById('bilden').src=image6.src;
	}
	else if(val==7){
	document.getElementById('bilden').src=image7.src;
	}
	else if(val==8){
	document.getElementById('bilden').src=image8.src;
	}
	else if(val==9){
	document.getElementById('bilden').src=image9.src;
	}
	else if(val==10){
	document.getElementById('bilden').src=image10.src;
	}
	else if(val==11){
	document.getElementById('bilden').src=image11.src;
	}
	else if(val==12){
	document.getElementById('bilden').src=image12.src;
	}
	else if(val==13){
	document.getElementById('bilden').src=image13.src;
	}
	else if(val==14){
	document.getElementById('bilden').src=image14.src;
	}
	else if(val==15){
	document.getElementById('bilden').src=image15.src;
	}
	else if(val==16){
	document.getElementById('bilden').src=image16.src;
	}
	else if(val==17){
	document.getElementById('bilden').src=image17.src;
	}
	else if(val==18){
	document.getElementById('bilden').src=image17.src;
	}
	else if(val==19){
	document.getElementById('bilden').src=image18.src;
	}
	else if(val==20){
	document.getElementById('bilden').src=image19.src;
	}
	else if(val==21){
	document.getElementById('bilden').src=image20.src;
	}
	else{
	document.getElementById('bilden').src=image22.src;
	}
}
}

