function updatestencil(){    document.getElementById("stencildemo").innerHTML = "<img src=\"PHP_FILES/PRODUCTS/_sv/stencil.php?who="+ document.getElementById("RegNr").value  +"&desc="+ document.getElementById("Desc").value  +"\">";}function checkform (){  // see http://www.thesitewizard.com/archive/validation.shtml  // for an explanation of this script and how to use it on your  // own website  // ** START **  if (document.getElementById("RegNr").value == "WOS864" ) {    alert( "Skriv ditt bilregistreringsnummer. Tack!" );    document.getElementById("RegNr").focus();	//document.getElementById("RegNr").style='border: 1px solid #FF0000';    return false ;  }    if (document.getElementById("RegNr").value == "") {    alert( "Skriv ditt bilregistreringsnummer. Tack!" );    document.getElementById("RegNr").focus();	//document.getElementById("RegNr").style='border: 1px solid #FF0000';    return false ;  }  // ** END **  return true ;}function kadabra(zap) {	if (document.getElementById) {		var abra = document.getElementById(zap).style;		if (abra.display == "block") {			abra.display = "none";			} else {			abra.display = "block"			} 		return false		} else {		return true		}}function setVisibility(id, visibility) {document.all[id].style.display = visibility;} 

function popup(mylink, windowname){if (! window.focus)return true;var href;if (typeof(mylink) == 'string')   href=mylink;else   href=mylink.href;window.open(href, windowname, 'width=650,height=450,scrollbars=yes');return false;}//function chdiv(data, page, method, target) {    dsHistory.addFunction(function(){chdiv_ds(data, page, method, target)});	if(document.all && !window.opera) {        var aki = new ActiveXObject("Microsoft.XMLHTTP") ;        }        else {            var aki = new XMLHttpRequest();        }        var content = document.getElementById(target);		content.innerHTML = "<p align=\"center\" class=Header3><br><img src=\"./IMG/images/loading.gif\"><br><br></p>";        		if(method == "GET") {            if(data == 'null') {                aki.open("GET", page);            }            else {            				aki.open("GET", page+"?m=1&"+data);            }        }        else if(method == "POST") {            aki.open("POST", page);        }        aki.onreadystatechange = function() {        if (aki.readyState == 4 && aki.status == 200) {			content.innerHTML = aki.responseText;			// alert(this.name);				re_initialize();			}        }        if(method == "GET") {            aki.send(null);        }        else if(method == "POST") {            aki.setRequestHeader('Content-Type','application/x-www-form-urlencoded');         		 aki.send(data);		         }}//function chdiv_bis(data, page, method, target) {    dsHistory.addFunction(function(){chdiv_ds(data, page, method, target)});	if(document.all && !window.opera) {        var aki = new ActiveXObject("Microsoft.XMLHTTP") ;        }        else {            var aki = new XMLHttpRequest();        }        var content = document.getElementById(target);		content.innerHTML = "";        		if(method == "GET") {            if(data == 'null') {                aki.open("GET", page);            }            else {            				aki.open("GET", page+"?m=1&"+data);            }        }        else if(method == "POST") {            akiaki.open("POST", page);        }        aki.onreadystatechange = function() {        if (aki.readyState == 4 && aki.status == 200) {			content.innerHTML = aki.responseText;			// alert(this.name);				re_initialize();			}        }        if(method == "GET") {            aki.send(null);        }        else if(method == "POST") {            aki.setRequestHeader('Content-Type','application/x-www-form-urlencoded');         		 aki.send(data);		         }}function chdiv_ds(data, page, method, target) {	if(document.all && !window.opera) {        var aki = new ActiveXObject("Microsoft.XMLHTTP") ;        }        else {            var aki = new XMLHttpRequest();        }        var content = document.getElementById(target);		content.innerHTML = "<p align=\"center\" class=Header3><br><img src=\"./IMG/images/loading.gif\"><br><br></p>";        		if(method == "GET") {            if(data == 'null') {                aki.open("GET", page);            }            else {            				aki.open("GET", page+"?m=1&"+data);            }        }        else if(method == "POST") {            akiaki.open("POST", page);        }        aki.onreadystatechange = function() {        if (aki.readyState == 4 && aki.status == 200) {			content.innerHTML = aki.responseText;			// alert(this.name);			//	re_initialize();			}        }        if(method == "GET") {            aki.send(null);        }        else if(method == "POST") {            aki.setRequestHeader('Content-Type','application/x-www-form-urlencoded');         		 aki.send(data);		         }}function quizz_addq(end,act){	if (end == 0){		chdiv($('addq').serialize(),'main.php','GET','q_msg'); 		chdiv('act='+act,'main.php','GET','q_sum'); 		$('addq').reset()	} else {		chdiv('act='+act+'&commit=1','main.php','GET','centerContent'); 	}}function quizz_delq(id,act){	chdiv('act='+act+'&todo=del&todo_id='+id,'main.php','GET','q_sum'); 	chdiv('act='+act,'main.php','GET','q_sum'); }function quizz_valid(){	chdiv($('myquizz').serialize(),'main.php','GET','centerContent'); }/*function chdiv2(blocpage, adress){	new Ajax.Updater(blocpage, adress + '&m=1',evalScripts=true);}*/
