function submitForm(formname){
	var theForm=document.forms[formname];
	var fields=theForm['om_fields'].value.split(',');
	var fStyles=theForm['om_colors'].value.split(',');
	var orgStyles=theForm['om_org_colors'].value.split(',');
	var error=0;
	for(var i=0;i<fields.length;i++){
		var theField=fields[i];
		var rpos=theField.indexOf('_r');
		if(rpos>-1){
			theField=theField.substring(0,rpos);
		}
		if(rpos>-1 && theForm[theField].value.length==0 ){//
			error++;
			document.getElementById(theField).style.backgroundColor=fStyles[0];
			document.getElementById(theField).style.color=fStyles[1];
		}else if (theField=='email' && theForm[theField].value.match(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/)==null) {//
			error++;
			//alert(theForm[theField].value.match(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/));
			document.getElementById(theField).style.backgroundColor=fStyles[0];
			document.getElementById(theField).style.color=fStyles[1];
		}else{
			document.getElementById(theField).style.backgroundColor=orgStyles[0];
			document.getElementById(theField).style.color=orgStyles[1];
		}
	}
	
	if(error>0){
		document.getElementById(formname+'Error').style.display='';
		return false;
	}else{
		document.getElementById(formname+'Error').style.display='none';
		return true;
	}	
			
}


function mp(url,opts){
	window.open(url,"mp",opts);
}


//Browser detection
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false
if (ns4) {
	document.write('<link rel="stylesheet" href="media/css/singer_ns.css" type="text/css">')
}//end if
if (ie4) {
	document.write('<link rel="stylesheet" href="media/css/singer_ie.css" type="text/css">')
}//end if
if(!ie4 && !ns4){
	document.write('<link rel="stylesheet" href="media/css/singer_ns.css" type="text/css">')
}//end if


     function singer() {
             banner = new MakeArray(3);
             numbanner = 3; 

             banner[0] = "<a href=http://www.singer.nl target=_top><img src=./media/graphics/branding-singer1.jpg width=770 height=200 border=0></a>"
             banner[1] = "<a href=http://www.singer.nl target=_top><img src=./media/graphics/branding-singer2.jpg width=770 height=200 border=0></a>"
             banner[2] = "<a href=http://www.singer.nl target=_top><img src=./media/graphics/branding-singer3.jpg width=770 height=200 border=0></a>"
			 var now = new Date()
             var sec = now.getSeconds()
             return banner[sec % numbanner];
     }

     function MakeArray(n) { 
             this.length = n; 
             for (var i = 1; i <= n; i++) { 
                     this[i] = 0 }
                 return this 
     }


     function products() {
             banner = new MakeArray(3);
             numbanner = 3; 

             banner[0] = "<a href=http://www.singer.nl target=_top><img src=./media/graphics/branding-product1.jpg width=770 height=200 border=0></a>"
             banner[1] = "<a href=http://www.singer.nl target=_top><img src=./media/graphics/branding-product2.jpg width=770 height=200 border=0></a>"
             banner[2] = "<a href=http://www.singer.nl target=_top><img src=./media/graphics/branding-product3.jpg width=770 height=200 border=0></a>"
			 var now = new Date()
             var sec = now.getSeconds()
             return banner[sec % numbanner];
     }

     function MakeArray(n) { 
             this.length = n; 
             for (var i = 1; i <= n; i++) { 
                     this[i] = 0 }
                 return this 
     }

