
function print_r(obj){win_print_r=window.open('about:blank','win_print_r');win_print_r.document.write('<html><body>');r_print_r(obj,win_print_r);win_print_r.document.write('</body></html>');}
function r_print_r(theObj,win_print_r){if(theObj.constructor==Array||theObj.constructor==Object){if(win_print_r==null)
win_print_r=window.open('about:blank','win_print_r');}
for(var p in theObj){if(theObj[p].constructor==Array||theObj[p].constructor==Object){win_print_r.document.write("<li>["+p+"] =>"+typeof(theObj)+"</li>");win_print_r.document.write("<ul>")
r_print_r(theObj[p],win_print_r);win_print_r.document.write("</ul>")}else{win_print_r.document.write("<li>["+p+"] =>"+theObj[p]+"</li>");}}
win_print_r.document.write("</ul>")}
function writeCookie(nom,valeur)
{var argv=writeCookie.arguments;var argc=writeCookie.arguments.length;var expires=(argc>2)?argv[2]:null;var path=(argc>3)?argv[3]:null;var domain=(argc>4)?argv[4]:null;var secure=(argc>5)?argv[5]:false;document.cookie=nom+"="+escape(valeur)+
((expires==null||expires==0)?"":("; expires="+expires.toGMTString()))+
((path==null)?("; path=/"):("; path="+path))+
((domain==null)?"":("; domain="+domain))+
((secure==true)?"; secure":"");}
function getCookieVal(offset)
{var endstr=document.cookie.indexOf(";",offset);if(endstr==-1)endstr=document.cookie.length;return unescape(document.cookie.substring(offset,endstr));}
function readCookie(nom)
{var arg=nom+"=";var alen=arg.length;var clen=document.cookie.length;var i=0;while(i<clen)
{var j=i+alen;if(document.cookie.substring(i,j)==arg)return getCookieVal(j);i=document.cookie.indexOf(" ",i)+1;if(i==0)break;}
return null;}
function parent_form(element)
{form=null;while(element)
{if(typeof(element)!="object")return false;if(element.nodeName=='FORM')
{form=element;break;}
element=element.parentNode;}
return form;}
function submit_parent(element)
{if(stop_event_all)return;if(element.className)
{classnames=element.className.split(' ');for(var i=0;i<classnames.length;i++)
{if(classnames[i]=='disabled')
{return false;}}}
submit_name=element.name;if(element.nodeName=="A")
{var hidden_input=null;if(submit_name!="")
{hidden_input=document.createElement("input");hidden_input.type="hidden";hidden_input.name=submit_name;hidden_input.value="1";}}
form=parent_form(element);if(form)
{if(hidden_input)
{form.appendChild(hidden_input);}
if(typeof form.onsubmit=='function')
{form.onsubmit();}
else
{form.submit();}}}
function WindowSizeWidth()
{return window.innerWidth!=null?window.innerWidth:document.documentElement&&document.documentElement.clientWidth?document.documentElement.clientWidth:document.body!=null?document.body.clientWidth:null;}
function WindowSizeHeight()
{return window.innerHeight!=null?window.innerHeight:document.documentElement&&document.documentElement.clientHeight?document.documentElement.clientHeight:document.body!=null?document.body.clientHeight:null;}
function WindowPosLeft()
{return(document.all)?window.screenLeft:window.screenX;}
function WindowPosTop()
{return(document.all)?window.screenTop:window.screenY;}
function WindowPosRight()
{return WindowPosLeft()+WindowSizeWidth();}
function WindowPosBottom()
{return WindowPosTop()+WindowSizeHeight();}
var stop_event_all=false;function StopEvent(pE)
{stop_event_all=true;if(!pE)
if(window.event)
pE=window.event;else
return;if(pE.cancelBubble!=null)
pE.cancelBubble=true;if(pE.stopPropagation)
pE.stopPropagation();if(pE.preventDefault)
pE.preventDefault();if(window.event)
pE.returnValue=false;if(pE.cancel!=null)
pE.cancel=true;return false;}
function include_js(file,complete){var html_doc=document.getElementsByTagName('head')[0];js=document.createElement('script');js.setAttribute('type','text/javascript');js.setAttribute('src',file);html_doc.appendChild(js);js.onreadystatechange=function(){if(js.readyState=='complete'){}}
js.onload=function(){if(complete)
{complete(file);}}
return false;}
function SaveScroll()
{writeCookie("scroll",document.documentElement.scrollTop);}
function SetScroll()
{var sc=readCookie("scroll");if(sc!=null)
{document.documentElement.scrollTop=sc;}}
function getDocHeight(){var D=document;return Math.max(Math.max(D.body.scrollHeight,D.documentElement.scrollHeight),Math.max(D.body.offsetHeight,D.documentElement.offsetHeight),Math.max(D.body.clientHeight,D.documentElement.clientHeight));}
