Object.extend=function(_1,_2,_3){for(prop in _2){if(_3==false&&_1[prop]!=null){continue;}_1[prop]=_2[prop];}return _1;};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(o){if(!Function.__objs){Function.__objs=[];Function.__funcs=[];}var _a=o.__oid;if(!_a){Function.__objs[_a=o.__oid=Function.__objs.length]=o;}var me=this;var _c=me.__fid;if(!_c){Function.__funcs[_c=me.__fid=Function.__funcs.length]=me;}if(!o.__closures){o.__closures=[];}var _d=o.__closures[_c];if(_d){return _d;}o=null;me=null;return Function.__objs[_a].__closures[_c]=function(){return Function.__funcs[_c].apply(Function.__objs[_a],arguments);};}},false);Object.extend(Array.prototype,{push:function(o){this[this.length]=o;},addRange:function(_f){if(_f.length>0){for(var i=0;i<_f.length;i++){this.push(_f[i]);}}},clear:function(){this.length=0;return this;},shift:function(){if(this.length==0){return null;}var o=this[0];for(var i=0;i<this.length-1;i++){this[i]=this[i+1];}this.length--;return o;}},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(s){if(this.length==0||this.length<s.length){return false;}return (this.substr(this.length-s.length)==s);},startsWith:function(s){if(this.length==0||this.length<s.length){return false;}return (this.substr(0,s.length)==s);},split:function(c){var a=[];if(this.length==0){return a;}var p=0;for(var i=0;i<this.length;i++){if(this.charAt(i)==c){a.push(this.substring(p,i));p=++i;}}a.push(s.substr(p));return a;}},false);Object.extend(String,{format:function(s){for(var i=1;i<arguments.length;i++){s=s.replace("{"+(i-1)+"}",arguments[i]);}return s;},isNullOrEmpty:function(s){if(s==null||s.length==0){return true;}return false;}},false);if(typeof addEvent=="undefined"){addEvent=function(o,_1d,f,_1f){if(o==null){return false;}if(o.addEventListener){o.addEventListener(_1d,f,_1f);return true;}else{if(o.attachEvent){var r=o.attachEvent("on"+_1d,f);return r;}else{try{o["on"+_1d]=f;}catch(e){}}}};}if(typeof removeEvent=="undefined"){removeEvent=function(o,_22,f,_24){if(o==null){return false;}if(o.removeEventListener){o.removeEventListener(_22,f,_24);return true;}else{if(o.detachEvent){o.detachEvent("on"+_22,f);}else{try{o["on"+_22]=function(){};}catch(e){}}}};}Object.extend(Function.prototype,{getArguments:function(){var _25=[];for(var i=0;i<this.arguments.length;i++){_25.push(this.arguments[i]);}return _25;}},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 doc=this.iframe.contentDocument||this.iframe.document;if(doc!=null&&doc.readyState=="complete"&&doc.body!=null&&doc.body.res!=null){this.status=200;this.statusText="OK";this.readyState=4;this.responseText=doc.body.res;this.onreadystatechange();return;}setTimeout(this.readystatechanged.bind(this),10);},open:function(_28,url,_2a){if(_2a==false){alert("Synchronous call using IFrameXMLHttp is not supported.");return;}if(this.iframe==null){var _2b="hans";if(document.createElement&&document.documentElement&&(window.opera||navigator.userAgent.indexOf("MSIE 5.0")==-1)){var ifr=document.createElement("iframe");ifr.setAttribute("id",_2b);ifr.style.visibility="hidden";ifr.style.position="absolute";ifr.style.width=ifr.style.height=ifr.borderWidth="0px";this.iframe=document.getElementsByTagName("body")[0].appendChild(ifr);}else{if(document.body&&document.body.insertAdjacentHTML){document.body.insertAdjacentHTML("beforeEnd","<iframe name=\""+_2b+"\" id=\""+_2b+"\" style=\"border:1px solid black;display:none\"></iframe>");}}if(window.frames&&window.frames[_2b]){this.iframe=window.frames[_2b];}this.iframe.name=_2b;this.iframe.document.open();this.iframe.document.write("<html><body></body></html>");this.iframe.document.close();}this.method=_28;this.url=url;this.async=_2a;},setRequestHeader:function(_2d,_2e){for(var i=0;i<this.headers.length;i++){if(this.headers[i].name==_2d){this.headers[i].value=_2e;return;}}this.headers.push({"name":_2d,"value":_2e});},getResponseHeader:function(_30,_31){return null;},addInput:function(doc,_33,_34,_35){var ele;var tag="input";if(_35.indexOf("\n")>=0){tag="textarea";}if(doc.all){ele=doc.createElement("<"+tag+" name=\""+_34+"\" />");}else{ele=doc.createElement(tag);ele.setAttribute("name",_34);}ele.setAttribute("value",_35);_33.appendChild(ele);ele=null;},send:function(_38){if(this.iframe==null){return;}var doc=this.iframe.contentDocument||this.iframe.document;var _3a=doc.createElement("form");doc.body.appendChild(_3a);_3a.setAttribute("action",this.url);_3a.setAttribute("method",this.method);_3a.setAttribute("enctype","application/x-www-form-urlencoded");for(var i=0;i<this.headers.length;i++){switch(this.headers[i].name.toLowerCase()){case "content-length":case "accept-encoding":case "content-type":break;default:this.addInput(doc,_3a,this.headers[i].name,this.headers[i].value);}}this.addInput(doc,_3a,"data",_38);_3a.submit();setTimeout(this.readystatechanged.bind(this),1);}};var progids=["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 _3c=null;if(!AjaxPro.noActiveX){if(_progid){return new ActiveXObject(_progid);}for(var i=0;i<progids.length&&_3c==null;i++){try{_3c=new ActiveXObject(progids[i]);progid=progids[i];}catch(e){}}}if(_3c==null&&MS.Browser.isIE){return new AjaxPro.IFrameXmlHttp();}return _3c;};}}Object.extend(AjaxPro,{noOperation:function(){},onLoading:function(){},onError:function(){},onTimeout:function(){},onStateChanged:function(){},cryptProvider:null,queue:null,token:"",version:"6.7.20.1",ID:"AjaxPro",noActiveX:false,timeoutPeriod:10*1000,queue:null,toJSON:function(o){if(o==null){return "null";}switch(o.constructor){case String:var v=[];for(var i=0;i<o.length;i++){var c=o.charAt(i);if(c>=" "){if(c=="\\"||c=="\""){v.push("\\");}v.push(c);}else{switch(c){case "\n":v.push("\\n");break;case "\r":v.push("\\r");break;case "\b":v.push("\\b");break;case "\f":v.push("\\f");break;case "\t":v.push("\\t");break;default:v.push("\\u00");v.push(c.charCodeAt().toString(16));}}}return "\""+v.join("")+"\"";case Array:var v=[];for(var i=0;i<o.length;i++){v.push(AjaxPro.toJSON(o[i]));}return "["+v.join(",")+"]";case Number:return isFinite(o)?o.toString():AjaxPro.toJSON(null);case Boolean:return o.toString();case Date:var d=new Object();d.__type="System.DateTime";d.Year=o.getUTCFullYear();d.Month=o.getUTCMonth()+1;d.Day=o.getUTCDate();d.Hour=o.getUTCHours();d.Minute=o.getUTCMinutes();d.Second=o.getUTCSeconds();d.Millisecond=o.getUTCMilliseconds();return AjaxPro.toJSON(d);default:if(typeof o.toJSON=="function"){return o.toJSON();}if(typeof o=="object"){var v=[];for(attr in o){if(typeof o[attr]!="function"){v.push("\""+attr+"\":"+AjaxPro.toJSON(o[attr]));}}if(v.length>0){return "{"+v.join(",")+"}";}return "{}";}return o.toString();}},dispose:function(){if(AjaxPro.queue!=null){AjaxPro.queue.dispose();}}},false);addEvent(window,"unload",AjaxPro.dispose);AjaxPro.Request=function(url){this.url=url;this.xmlHttp=null;};AjaxPro.Request.prototype={url:null,callback:null,onLoading:AjaxPro.noOperation,onError:AjaxPro.noOperation,onTimeout:AjaxPro.noOperation,onStateChanged:AjaxPro.noOperation,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(res){this.abort();if(res.error!=null){this.onError(res.error,this);}if(typeof this.callback=="function"){this.callback(res,this);}},mozerror:function(){if(this.timeoutTimer!=null){clearTimeout(this.timeoutTimer);}var res=this.getEmptyRes();res.error={Message:"Unknown",Type:"ConnectFailure",Status:0};this.endRequest(res);},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 res=this.getEmptyRes();if(this.xmlHttp.status==200&&this.xmlHttp.statusText=="OK"){res=this.createResponse(res);}else{res=this.createResponse(res,true);res.error={Message:this.xmlHttp.statusText,Type:"ConnectFailure",Status:this.xmlHttp.status};}this.endRequest(res);},createResponse:function(r,_4b){if(!_4b){var _4c=new String(this.xmlHttp.responseText);if(AjaxPro.cryptProvider!=null&&typeof AjaxPro.cryptProvider=="function"){_4c=AjaxPro.cryptProvider.decrypt(_4c);}if(this.xmlHttp.getResponseHeader("Content-Type")=="text/xml"){r.value=this.xmlHttp.responseXML;}else{if(_4c!=null&&_4c.trim().length>0){r.json=_4c;eval("r.value = "+_4c+"*/");}}}return r;},timeout:function(){this.duration=new Date().getTime()-this.__start;var r=this.onTimeout(this.duration,this);if(typeof r=="undefined"||r!=false){this.abort();}else{this.timeoutTimer=setTimeout(this.timeout.bind(this),AjaxPro.timeoutPeriod);}},invoke:function(_4e,_4f,_50,_51){this.__start=new Date().getTime();if(this.xmlHttp==null){this.xmlHttp=new XMLHttpRequest();}this.isRunning=true;this.method=_4e;this.args=_4f;this.callback=_50;this.context=_51;var _52=typeof _50=="function"&&_50!=AjaxPro.noOperation;if(_52){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 _53=AjaxPro.toJSON(_4f)+"";if(AjaxPro.cryptProvider!=null){_53=AjaxPro.cryptProvider.encrypt(_53);}this.xmlHttp.open("POST",this.url,_52);this.xmlHttp.setRequestHeader("Content-Type","text/plain; charset=utf-8");this.xmlHttp.setRequestHeader("X-"+AjaxPro.ID+"-Method",_4e);if(AjaxPro.token!=null&&AjaxPro.token.length>0){this.xmlHttp.setRequestHeader("X-"+AjaxPro.ID+"-Token",AjaxPro.token);}if(!MS.Browser.isIE){this.xmlHttp.setRequestHeader("Connection","close");}this.timeoutTimer=setTimeout(this.timeout.bind(this),AjaxPro.timeoutPeriod);try{this.xmlHttp.send(_53);}catch(e){}if(!_52){return this.createResponse({error:null,value:null});}return true;}};AjaxPro.RequestQueue=function(_54){this.queue=[];this.requests=[];this.timer=null;if(isNaN(_54)){_54=2;}for(var i=0;i<_54;i++){this.requests[i]=new AjaxPro.Request();this.requests[i].callback=function(res){var r=res.context;res.context=r[3][1];r[3][0](res,this);};this.requests[i].callbackHandle=this.requests[i].callback.bind(this.requests[i]);}};AjaxPro.RequestQueue.prototype={process:function(){this.timer=null;if(this.queue.length==0){return;}for(var i=0;i<this.requests.length&&this.queue.length>0;i++){if(this.requests[i].isRunning==false){var r=this.queue.shift();this.requests[i].url=r[0];this.requests[i].onLoading=r[3].length>2&&r[3][2]!=null&&typeof r[3][2]=="function"?r[3][2]:AjaxPro.onLoading;this.requests[i].onError=r[3].length>3&&r[3][3]!=null&&typeof r[3][3]=="function"?r[3][3]:AjaxPro.onError;this.requests[i].onTimeout=r[3].length>4&&r[3][4]!=null&&typeof r[3][4]=="function"?r[3][4]:AjaxPro.onTimeout;this.requests[i].onStateChanged=r[3].length>5&&r[3][5]!=null&&typeof r[3][5]=="function"?r[3][5]:AjaxPro.onStateChanged;this.requests[i].invoke(r[1],r[2],this.requests[i].callbackHandle,r);r=null;}}if(this.queue.length>0&&this.timer==null){this.timer=setTimeout(this.process.bind(this),10);}},add:function(url,_5b,_5c,e){this.queue.push([url,_5b,_5c,e]);if(this.timer==null){this.timer=setTimeout(this.process.bind(this),1);}},abort:function(){this.queue.length=0;if(this.timer!=null){clearTimeout(this.timer);}this.timer=null;for(var i=0;i<this.requests.length;i++){if(this.requests[i].isRunning==true){this.requests[i].abort();}}},dispose:function(){for(var i=0;i<this.requests.length;i++){var r=this.requests[i];r.dispose();}this.requests.clear();}};AjaxPro.queue=new AjaxPro.RequestQueue(2);AjaxPro.AjaxClass=function(url){this.url=url;};AjaxPro.AjaxClass.prototype={invoke:function(_62,_63,e){if(e!=null){if(e.length!=6){for(;e.length<6;){e.push(null);}}if(e[0]!=null&&typeof e[0]=="function"){return AjaxPro.queue.add(this.url,_62,_63,e);}}var r=new AjaxPro.Request();r.url=this.url;return r.invoke(_62,_63);}};

function $() {
	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;
}


function CheckFormNewsletterValues(s) 
{
   var email = document.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.frmNewsletter.txtEmail.focus();
  	 return false;
   }

   return true;
}
function showSub(el){
	if(el.getElementsByTagName('ul')[0])
		el.getElementsByTagName('ul')[0].style.display = 'block';
}
function hideSub(el){
	if(el.getElementsByTagName('ul')[0])
		el.getElementsByTagName('ul')[0].style.display = 'none';
}
function FboxShowLink(s)
{
	fbox_kind($(s));
	showFbox();
}

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 gammaRay_old(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;
}

