Object.extend=function(a,c,b){for(var d in c){if(b==false&&a[d]!=null){continue}a[d]=c[d]}return a};Object.extend(Function.prototype,{apply:function(o,a){var r,x="__fapply";if(typeof o!="object"){o={}}o[x]=this;var s="r = o."+x+"(";for(var i=0;i<a.length;i++){if(i>0){s+=","}s+="a["+i+"]"}s+=");";eval(s);delete o[x];return r},bind:function(d){if(!Function.__objs){Function.__objs=[];Function.__funcs=[]}var a=d.__oid;if(!a){Function.__objs[a=d.__oid=Function.__objs.length]=d}var b=this;var c=b.__fid;if(!c){Function.__funcs[c=b.__fid=Function.__funcs.length]=b}if(!d.__closures){d.__closures=[]}var f=d.__closures[c];if(f){return f}d=null;b=null;return Function.__objs[a].__closures[c]=function(){return Function.__funcs[c].apply(Function.__objs[a],arguments)}}},false);Object.extend(Array.prototype,{push:function(a){this[this.length]=a},addRange:function(a){if(a.length>0){for(var b=0;b<a.length;b++){this.push(a[b])}}},clear:function(){this.length=0;return this},shift:function(){if(this.length==0){return null}var b=this[0];for(var a=0;a<this.length-1;a++){this[a]=this[a+1]}this.length--;return b}},false);Object.extend(String.prototype,{trimLeft:function(){return this.replace(/^\s*/,"")},trimRight:function(){return this.replace(/\s*$/,"")},trim:function(){return this.trimRight().trimLeft()},endsWith:function(a){if(this.length==0||this.length<a.length){return false}return(this.substr(this.length-a.length)==a)},startsWith:function(a){if(this.length==0||this.length<a.length){return false}return(this.substr(0,a.length)==a)},split:function(g){var b=[];if(this.length==0){return b}var f=0;for(var d=0;d<this.length;d++){if(this.charAt(d)==g){b.push(this.substring(f,d));f=++d}}b.push(s.substr(f));return b}},false);Object.extend(String,{format:function(b){for(var a=1;a<arguments.length;a++){b=b.replace("{"+(a-1)+"}",arguments[a])}return b},isNullOrEmpty:function(a){if(a==null||a.length==0){return true}return false}},false);if(typeof addEvent=="undefined"){addEvent=function(h,c,d,a){if(h==null){return false}if(h.addEventListener){h.addEventListener(c,d,a);return true}else{if(h.attachEvent){var b=h.attachEvent("on"+c,d);return b}else{try{h["on"+c]=d}catch(g){}}}}}if(typeof removeEvent=="undefined"){removeEvent=function(g,b,c,a){if(g==null){return false}if(g.removeEventListener){g.removeEventListener(b,c,a);return true}else{if(g.detachEvent){g.detachEvent("on"+b,c)}else{try{g["on"+b]=function(){}}catch(d){}}}}}Object.extend(Function.prototype,{getArguments:function(){var a=[];for(var b=0;b<this.arguments.length;b++){a.push(this.arguments[b])}return a}},false);var MS={Browser:{}};Object.extend(MS.Browser,{isIE:navigator.userAgent.indexOf("MSIE")!=-1,isFirefox:navigator.userAgent.indexOf("Firefox")!=-1,isOpera:window.opera!=null},false);var AjaxPro={};AjaxPro.IFrameXmlHttp=function(){};AjaxPro.IFrameXmlHttp.prototype={onreadystatechange:null,headers:[],method:"POST",url:null,async:true,iframe:null,status:0,readyState:0,responseText:null,abort:function(){},readystatechanged:function(){var a=this.iframe.contentDocument||this.iframe.document;if(a!=null&&a.readyState=="complete"&&a.body!=null&&a.body.res!=null){this.status=200;this.statusText="OK";this.readyState=4;this.responseText=a.body.res;this.onreadystatechange();return}setTimeout(this.readystatechanged.bind(this),10)},open:function(f,a,b){if(b==false){alert("Synchronous call using IFrameXMLHttp is not supported.");return}if(this.iframe==null){var c="hans";if(document.createElement&&document.documentElement&&(window.opera||navigator.userAgent.indexOf("MSIE 5.0")==-1)){var d=document.createElement("iframe");d.setAttribute("id",c);d.style.visibility="hidden";d.style.position="absolute";d.style.width=d.style.height=d.borderWidth="0px";this.iframe=document.getElementsByTagName("body")[0].appendChild(d)}else{if(document.body&&document.body.insertAdjacentHTML){document.body.insertAdjacentHTML("beforeEnd",'<iframe name="'+c+'" id="'+c+'" style="border:1px solid black;display:none"></iframe>')}}if(window.frames&&window.frames[c]){this.iframe=window.frames[c]}this.iframe.name=c;this.iframe.document.open();this.iframe.document.write("<html><body></body></html>");this.iframe.document.close()}this.method=f;this.url=a;this.async=b},setRequestHeader:function(a,c){for(var b=0;b<this.headers.length;b++){if(this.headers[b].name==a){this.headers[b].value=c;return}}this.headers.push({name:a,value:c})},getResponseHeader:function(a,b){return null},addInput:function(g,c,b,f){var d;var a="input";if(f.indexOf("\n")>=0){a="textarea"}if(g.all){d=g.createElement("<"+a+' name="'+b+'" />')}else{d=g.createElement(a);d.setAttribute("name",b)}d.setAttribute("value",f);c.appendChild(d);d=null},send:function(c){if(this.iframe==null){return}var d=this.iframe.contentDocument||this.iframe.document;var b=d.createElement("form");d.body.appendChild(b);b.setAttribute("action",this.url);b.setAttribute("method",this.method);b.setAttribute("enctype","application/x-www-form-urlencoded");for(var a=0;a<this.headers.length;a++){switch(this.headers[a].name.toLowerCase()){case"content-length":case"accept-encoding":case"content-type":break;default:this.addInput(d,b,this.headers[a].name,this.headers[a].value)}}this.addInput(d,b,"data",c);b.submit();setTimeout(this.readystatechanged.bind(this),0)}};var progids=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];var progid=null;if(typeof ActiveXObject!="undefined"){var ie7xmlhttp=false;if(typeof XMLHttpRequest=="object"){try{var o=new XMLHttpRequest();ie7xmlhttp=true}catch(e){}}if(typeof XMLHttpRequest=="undefined"||!ie7xmlhttp){XMLHttpRequest=function(){var a=null;if(!AjaxPro.noActiveX){if(progid!=null){return new ActiveXObject(progid)}for(var b=0;b<progids.length&&a==null;b++){try{a=new ActiveXObject(progids[b]);progid=progids[b]}catch(c){}}}if(a==null&&MS.Browser.isIE){return new AjaxPro.IFrameXmlHttp()}return a}}}Object.extend(AjaxPro,{noOperation:function(){},onLoading:function(){},onError:function(){},onTimeout:function(){return true},onStateChanged:function(){},cryptProvider:null,queue:null,token:"",version:"9.2.17.1",ID:"AjaxPro",noActiveX:false,timeoutPeriod:15*1000,queue:null,noUtcTime:false,regExDate:function(h,g,d,f,b){h=h.substring(1).replace('"',"");var a=h;if(h.substring(0,7)=="\\/Date("){h=h.match(/Date\((.*?)\)/)[1];a="new Date("+parseInt(h)+")"}else{var c=h.split(/[-,:,T,Z]/);c[1]=(parseInt(c[1],0)-1).toString();a="new Date(Date.UTC("+c.join(",")+"))"}return a},parse:function(text){var regEx=/(\"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}.*?\")|(\"\\\/Date\(.*?\)\\\/")/g;text=text.replace(regEx,this.regExDate);return eval("("+text+")")},m:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},toJSON:function(f){if(f==null){return"null"}var b=[];var d;var g=f.constructor;if(g==Number){return isFinite(f)?f.toString():AjaxPro.toJSON(null)}else{if(g==Boolean){return f.toString()}else{if(g==String){if(/["\\\x00-\x1f]/.test(f)){f=f.replace(/([\x00-\x1f\\"])/g,function(i,h){var j=AjaxPro.m[h];if(j){return j}j=h.charCodeAt();return"\\u00"+Math.floor(j/16).toString(16)+(j%16).toString(16)})}return'"'+f+'"'}else{if(g==Array){for(d=0;d<f.length;d++){b.push(AjaxPro.toJSON(f[d]))}return"["+b.join(",")+"]"}else{if(g==Date){return AjaxPro.toJSON("/Date("+new Date(Date.UTC(f.getUTCFullYear(),f.getUTCMonth(),f.getUTCDate(),f.getUTCHours(),f.getUTCMinutes(),f.getUTCSeconds(),f.getUTCMilliseconds())).getTime()+")/")}}}}}if(typeof f.toJSON=="function"){return f.toJSON()}if(typeof f=="object"){for(var a in f){if(typeof f[a]!="function"){b.push('"'+a+'":'+AjaxPro.toJSON(f[a]))}}if(b.length>0){return"{"+b.join(",")+"}"}return"{}"}return f.toString()},dispose:function(){if(AjaxPro.queue!=null){AjaxPro.queue.dispose()}}},false);addEvent(window,"unload",AjaxPro.dispose);AjaxPro.Request=function(a){this.url=a;this.xmlHttp=null};AjaxPro.Request.prototype={url:null,callback:null,onLoading:null,onError:null,onTimeout:null,onStateChanged:null,args:null,context:null,isRunning:false,abort:function(){if(this.timeoutTimer!=null){clearTimeout(this.timeoutTimer)}if(this.xmlHttp){this.xmlHttp.onreadystatechange=AjaxPro.noOperation;this.xmlHttp.abort()}if(this.isRunning){this.isRunning=false;this.onLoading(false)}},dispose:function(){this.abort()},getEmptyRes:function(){return{error:null,value:null,request:{method:this.method,args:this.args},context:this.context,duration:this.duration}},endRequest:function(a){this.abort();if(a.error!=null){this.onError(a.error,this)}if(typeof this.callback=="function"){this.callback(a,this)}},mozerror:function(){if(this.timeoutTimer!=null){clearTimeout(this.timeoutTimer)}var a=this.getEmptyRes();a.error={Message:"Unknown",Type:"ConnectFailure",Status:0};this.endRequest(a)},doStateChange:function(){this.onStateChanged(this.xmlHttp.readyState,this);if(this.xmlHttp.readyState!=4||!this.isRunning){return}this.duration=new Date().getTime()-this.__start;if(this.timeoutTimer!=null){clearTimeout(this.timeoutTimer)}var a=this.getEmptyRes();if(this.xmlHttp.status==200&&this.xmlHttp.statusText=="OK"){a=this.createResponse(a)}else{a=this.createResponse(a,true);a.error={Message:this.xmlHttp.statusText,Type:"ConnectFailure",Status:this.xmlHttp.status}}this.endRequest(a)},createResponse:function(b,d){if(!d){if(typeof(this.xmlHttp.responseText)=="unknown"){b.error={Message:"XmlHttpRequest error reading property responseText.",Type:"XmlHttpRequestException"};return b}var c=""+this.xmlHttp.responseText;if(AjaxPro.cryptProvider!=null&&typeof AjaxPro.cryptProvider.decrypt=="function"){c=AjaxPro.cryptProvider.decrypt(c)}if(this.xmlHttp.getResponseHeader("Content-Type")=="text/xml"){b.value=this.xmlHttp.responseXML}else{if(c!=null&&c.trim().length>0){b.json=c;var a=null;a=AjaxPro.parse(c);if(a!=null){if(typeof a.value!="undefined"){b.value=a.value}else{if(typeof a.error!="undefined"){b.error=a.error}}}}}}return b},timeout:function(){this.duration=new Date().getTime()-this.__start;var a=this.onTimeout(this.duration,this);if(typeof a=="undefined"||a!=false){this.abort()}else{this.timeoutTimer=setTimeout(this.timeout.bind(this),AjaxPro.timeoutPeriod)}},invoke:function(h,a,g,c){this.__start=new Date().getTime();this.xmlHttp=new XMLHttpRequest();this.isRunning=true;this.method=h;this.args=a;this.callback=g;this.context=c;var d=typeof(g)=="function"&&g!=AjaxPro.noOperation;if(d){if(MS.Browser.isIE){this.xmlHttp.onreadystatechange=this.doStateChange.bind(this)}else{this.xmlHttp.onload=this.doStateChange.bind(this);this.xmlHttp.onerror=this.mozerror.bind(this)}this.onLoading(true)}var b=AjaxPro.toJSON(a)+"";if(AjaxPro.cryptProvider!=null&&typeof AjaxPro.cryptProvider.encrypt=="function"){b=AjaxPro.cryptProvider.encrypt(b)}this.xmlHttp.open("POST",this.url,d);this.xmlHttp.setRequestHeader("Content-Type","text/plain; charset=utf-8");this.xmlHttp.setRequestHeader("X-"+AjaxPro.ID+"-Method",h);if(AjaxPro.token!=null&&AjaxPro.token.length>0){this.xmlHttp.setRequestHeader("X-"+AjaxPro.ID+"-Token",AjaxPro.token)}this.timeoutTimer=setTimeout(this.timeout.bind(this),AjaxPro.timeoutPeriod);try{this.xmlHttp.send(b)}catch(f){}if(!d){return this.createResponse({error:null,value:null})}return true}};AjaxPro.RequestQueue=function(b){this.queue=[];this.requests=[];this.timer=null;if(isNaN(b)){b=2}for(var a=0;a<b;a++){this.requests[a]=new AjaxPro.Request();this.requests[a].callback=function(c){var d=c.context;c.context=d[3][1];d[3][0](c,this)};this.requests[a].callbackHandle=this.requests[a].callback.bind(this.requests[a])}this.processHandle=this.process.bind(this)};AjaxPro.RequestQueue.prototype={process:function(){this.timer=null;if(this.queue.length==0){return}for(var a=0;a<this.requests.length&&this.queue.length>0;a++){if(this.requests[a].isRunning==false){var b=this.queue.shift();this.requests[a].url=b[0];this.requests[a].onLoading=b[3].length>2&&b[3][2]!=null&&typeof b[3][2]=="function"?b[3][2]:AjaxPro.onLoading;this.requests[a].onError=b[3].length>3&&b[3][3]!=null&&typeof b[3][3]=="function"?b[3][3]:AjaxPro.onError;this.requests[a].onTimeout=b[3].length>4&&b[3][4]!=null&&typeof b[3][4]=="function"?b[3][4]:AjaxPro.onTimeout;this.requests[a].onStateChanged=b[3].length>5&&b[3][5]!=null&&typeof b[3][5]=="function"?b[3][5]:AjaxPro.onStateChanged;this.requests[a].invoke(b[1],b[2],this.requests[a].callbackHandle,b);b=null}}if(this.queue.length>0&&this.timer==null){this.timer=setTimeout(this.processHandle,0)}},add:function(b,d,a,c){this.queue.push([b,d,a,c]);if(this.timer==null){this.timer=setTimeout(this.processHandle,0)}},abort:function(){this.queue.length=0;if(this.timer!=null){clearTimeout(this.timer)}this.timer=null;for(var a=0;a<this.requests.length;a++){if(this.requests[a].isRunning==true){this.requests[a].abort()}}},dispose:function(){for(var a=0;a<this.requests.length;a++){var b=this.requests[a];b.dispose()}this.requests.clear()}};AjaxPro.queue=new AjaxPro.RequestQueue(2);AjaxPro.AjaxClass=function(a){this.url=a};AjaxPro.AjaxClass.prototype={invoke:function(d,a,c){if(c!=null){if(c.length!=6){for(;c.length<6;){c.push(null)}}if(c[0]!=null&&typeof(c[0])=="function"){return AjaxPro.queue.add(this.url,d,a,c)}}var b=new AjaxPro.Request();b.url=this.url;return b.invoke(d,a)}};

function CheckFormNewsletterValues(s) 
{
   var email = document.getElementById("frmNewsletter").txtEmail.value;
   var reg = /^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$/;
 
   if (reg.exec(email) == null) { 
  	  alert(s);
      document.getElementById("frmNewsletter").txtEmail.focus();
  	  return false;
   }

   return true;
}

function site_$() {
var elements = new Array();
for (var i = 0; i < arguments.length; i++) {
var element = arguments[i];
if (typeof(element) == 'string')
element = document.getElementById(element);
if (arguments.length == 1)
return element;
elements.push(element);
}
return elements;
}

if(typeof($)=="undefined") {

window.$=site_$;


}

String.prototype.trim = function() { return this.replace(/^\s\s*/, '').replace(/\s\s*$/,''); };

String.prototype.ToInt=function()
{ 
	var ret=0; 
	try { 
		ret=parseInt(this); 
	}
	catch(e) {
	}
	if(isNaN(ret)) {
		ret=0;
	}
	
	return ret;
}



function tp(t)
{
	var ret=false;
	try {
		eval("var ___t=typeof("+t+");");
		ret=true;
	}	
	catch(e) {
	}
	return ret;
}

function Toggle(r)
{	
	if($(r)!=null) {	
		$(r).style.display=($(r).style.display=="none"?"":"none");
	}
}

function SetValueOnLoad(id,v)
{
	if(document.getElementById(id)!=null) {
		document.getElementById(id).value=v;
	}
	else {
		setTimeout("SetValueOnLoad('"+id+"','"+v+"');",50);
	}
}

function SubmitForm(obj,form,pwText,altClass,altAction)
{
	obj.className=(typeof(altClass)!="undefined"?altClass:"PleaseWaitButton");
	obj.value=(typeof(pwText)!="undefined"?pwText:"Veuillez patienter");
	if(typeof(altAction)!="undefined") {
		$(form).action=altAction;
	}
	$(form).submit();
}

/*
function gammaRay(what) {

	if (document.getElementById) {
		var writePop = window.open('','_blank','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=50,height=50');
		
		var popTop = '';
		popTop += '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\n';
		popTop += '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n';
		popTop += '\n';
		popTop += '<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">\n';
		popTop += '<head>\<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />\n<meta http-equiv="imagetoolbar" content="false" />\n<\script>\n';
		popTop += 'function resizeZoomer(){\n';
		popTop += 'document.getElementById(\'loading\').style.display=\'none\';\n';
		popTop += 'document.getElementById(\'image\').style.visibility=\'visible\';\n';
		popTop += 'var sizeX = document.getElementById(\'image\').offsetWidth+40;\n';
		popTop += 'var sizeY = document.getElementById(\'image\').offsetHeight+65;\n';
		popTop += 'self.resizeTo(sizeX,sizeY);\n';
		popTop += '}\n';
		popTop += '\<\/script>\n';
		popTop += '<title>Image Zoom</title>\n';
		popTop += '</head>\n';
		popTop += '<body onload="resizeZoomer();" style="margin: 15px 2px 0 2px; text-align: center; font: normal 11px verdana; color: #666; background: #fff;">\n';
		popTop += '<div id="loading"><p>Please wait... Veuillez patienter... Bitte warten...</p></div>\n';
		popTop += '<a href="javascript:self.close();" onmousedown="self.close();" title="close"><img id="image" style="visibility: hidden; padding: 2px; border: 1px dotted #eee;" src="' + what + '" alt="close / fermer / schliessen" border="0" /></a>\n';
		popTop += '<\script>\n';
		popTop += 'document.getElementById(\'image\').onload = resizeZoomer;\n';
		popTop += '<\/script>\n';
		popTop += '</body>\n';
		popTop += '</html>\n';
		
		popRocks = writePop.document;
		popRocks.open();
		popRocks.write(popTop);
		popRocks.close();
	}
	else return true;
}
*/


function gammaRay(x)
{
	if($("GRHref")==null) {
		var b=document.getElementsByTagName("body");
		if(b!=null&&b.length==1) {
var t=document.createElement("div");
t.style.display="none";
t.innerHTML='<a id="GRHref" href=""><span id="GRLink" class="frontbox"></span></a>';
b[0].appendChild(t);
} 
		
	}
	if($("GRHref")!=null) { 
	$("GRHref").href=x;
	FboxShowLink($("GRLink"));
	}
}

function DoPostback(n,v,i)
{
	if(n!=null) {
		$(n).value=v;
	}
	$(i).submit();
}

function DoKPPostback(event,n,v,i)
{
 	var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;

	if(keyCode==13) {

		if(n!=null&&n.length>0) {
			$(n).value=v;
		}
		$(i).submit();
	}
}



function FboxShowLink(s)
{
	var elt=$(s);
	if(elt.tagName.toLowerCase()=="a") {
		elt.onclick();
	}
	else {
		fbox_kind($(s));
		showFbox();
	}
}

function RefreshMCaptcha(img,hf)
{
	Soda.Ajax.MCaptcha.GenerateCode(
		function(r)
		{
			img.src='/Scripts/Captcha.aspx?t='+r.value+'&n=1';
			hf.value=r.value;
		}
	);
} 

function LoadCaptchaImage(codeField,captchaField,t,errorMessage)
{
	Soda.Ajax.MCaptcha.GenerateCode(function(r)
		{
			$(codeField).value=r.value;	
			$(captchaField).src="/scripts/captcha.aspx?t="+r.value+"&n=1";
			if(typeof(t)=="undefined"||t==null) {
				$(captchaField).onload=function(){alert(typeof(errorMessage)=="undefined"?"Please enter text as it appears on the image":errorMessage);$(captchaField).onload=null;};
			}
		}
	);
}

function LoadCaptchaImageNW(codeField,captchaField)
{
	Soda.Ajax.MCaptcha.GenerateCode(function(r)
		{
			$(codeField).value=r.value;	
			$(captchaField).onload=null;
			$(captchaField).src="/scripts/captcha.aspx?t="+r.value+"&n=1";
		}
	);
}


function SetValueOnLoad(id,v)
{
	if($(id)!=null) {
		$(id).value=v;
	}
	else {
		setTimeout("SetValueOnLoad('"+id+"','"+v+"');",50);
	}
}


/*** custom ***/
 
 
function OpenWindow(i,w,h)
{
var writePop = window.open(i,'_blank','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width='+w+',height='+h);


}
  

 
function viewLang(){
	var olink = document.getElementById('selectOn');
	olink.href="javascript:hideLang();";
	olink.id="selectOff";
	document.getElementById('switchLang').style.display="block";
}
function hideLang(){
	var olink = document.getElementById('selectOff');
	olink.href="javascript:viewLang();";
	olink.id="selectOn";
	document.getElementById('switchLang').style.display="none";
}

function GetUrlParameter( name ){  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");  var regexS = "[\\?&]"+name+"=([^&#]*)";  var regex = new RegExp( regexS );  var results = regex.exec( window.location.href );  if( results == null )    return "";  else    return results[1];}

function AppendReturnUrl(obj)
{
	var return_url=GetUrlParameter("ReturnURL");
	obj.href+="&ReturnURL="+(return_url.length>0?return_url:escape(top.location.href));
}

function FindPos(AObject)
{
	var posX = 0, posY = 0;
	do
	{
		posX += AObject.offsetLeft;
		posY += AObject.offsetTop;
		AObject = AObject.offsetParent;
	}
	while( AObject != null );

	var pos = [];
	pos['X'] = posX;
	pos['Y'] = posY; 
	return pos;
}

function viewTitle(obj, view){
	
	var position = FindPos(obj);
	var viewDiv=document.getElementById("viewDiv");
	if(view){
		viewDiv.style.top=(position['Y']-3)+"px";		
		/*if(window.ActiveXObject){position['X']-=18;}*/
		viewDiv.style.left=(position['X']+19)+"px";
		viewDiv.innerHTML=obj.innerHTML;
		viewDiv.style.display="block";
	}
	else{
		viewDiv.style.display="none";
		viewDiv.innerHTML="";
	}
	return false;
}


function checkContact(id,action,dosubmit){
	var error = 0;
var fields=['Title','LastName','FirstName','Email','Address1','Zip','City','Country','Phone1','Comment'];

for(var i=0;i<fields.length;i++) {
document.getElementById(fields[i]).style.backgroundColor=""; document.getElementById(fields[i]).style.color="#000000";
if(document.getElementById(fields[i]).value==''){document.getElementById(fields[i]).style.color="#000000";document.getElementById(fields[i]).style.backgroundColor="#ffc3c3";error=1;}
}

var reg = /^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$/;
 
   if (reg.exec(document.getElementById('Email').value) == null) { 
document.getElementById('Email').style.color="#000000";document.getElementById('Email').style.backgroundColor="#ffc3c3";error=1;
	}

	
	if(error!=1){
		document.getElementById(id).action=action; 
		if(typeof(dosubmit)!="undefined"&&dosubmit) {
			document.getElementById(id).submit();
		}
		return true;
	}
	return false;
}

function checkPartner(id,action,dosubmit){
	var error = 0;
var fields=['Title','LastName','FirstName','Email','Address1','Zip','City','Country','Phone1'];

for(var i=0;i<fields.length;i++) {
document.getElementById(fields[i]).style.backgroundColor=""; document.getElementById(fields[i]).style.color="#000000";
if(document.getElementById(fields[i]).value==''){document.getElementById(fields[i]).style.color="#000000";document.getElementById(fields[i]).style.backgroundColor="#ffc3c3";error=1;}
}

var reg = /^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$/;
 
   if (reg.exec(document.getElementById('Email').value) == null) { 
document.getElementById('Email').style.color="#000000";document.getElementById('Email').style.backgroundColor="#ffc3c3";error=1;
	}

	
	if(error!=1){
		document.getElementById(id).action=action; 
		if(typeof(dosubmit)!="undefined"&&dosubmit) {
			document.getElementById(id).submit();
		}
		return true;
	}
	return false;
}
