function doChangeUrl(url){
	if (url != null && url != ""){
		window.location = url;
	}
}


function validate_form(thisform)
{
	
	var ok = true;
	var message = "";
	for(i=0; i<thisform.elements.length; i++){
		if(thisform.elements[i].type != 'submit'){
		  var elName = thisform.elements[i].name;
		  var elValue = thisform.elements[i].value;
		  if (elName.slice(-2) == '_r' && elValue == ""){
			  var word = elName.slice(1);
			  var word = word.slice(0,word.length-2);
			  var first = elName.slice(0,1);
			  var first = first.toUpperCase();
			  var message = message + first + word + "\n";
			  var ok= false;
		  }
	   }
	}
	if(ok){
		return true;
	}else{
		alert("Du må fylle ut disse feltene:\n" + message);
		return false;
	}

}

function zoomImage(url, width, height) {
    if(!url || !width || !height) return;
    width += 20;
    height += 40;
    var win = window.open('', 'zoomimg', 'width='+width+',height='+height+'resizable=0,scrollbars=0,directories=0,location=0,menubar=0,status=0,toolbar=0');
    if(win) {
        win.document.open();
        win.document.write('<html><head><title>gsm.no</title></head><body style="margin:0;padding:0;" onclick="self.close();">' +
            '<div align="center"><img src="'+url+'" border="0" alt=""></div>' +
            '</body></html>');
        win.document.close();
        win.focus();
    }
}





