/* © IQUALITY [2008] MYIQUALITY.COM 1.0 */



var sleep=1000,sleepN=0,running=0,count=0,sarray=new Array(),win=new Array(0,0),scr=new Array(0,0),sliD=0,sliT=0,sliN=0,sliX=0,sliW=0,sli=0; window.onresize=rszObj; window.onscroll=scrObj;

function obj(id) { return document.getElementById(id); }

function run()
{
   delay=sleep; sleepN=sleepN+sleep; if(sleepN>=running*60*1000 && obj('container_status')) { xLoad('container_status','status.php',0); sleepN=0; running=1; }
   if(obj('container_uri').value!=window.location.href.substr(obj('container_root').value.length) && count==0) { getUri(1); count=1; } if(count==1) {
   document.cookie=obj('container_prefix').value+'windowLocation='+window.location.href.substr(obj('container_root').value.length+1); xLoad('container_status','count.php',0);
   count=0; } setTimeout('run();',delay); } function init() { window.location.href=(obj('container_uri').value=getUri(1)); /*run();*/ getWin(); getScr();
}

function hide(id,i)
{
   alt=new Array('block','none'); if(obj(id).style.display==alt[1]) obj(id).style.display=alt[0];
   else if(obj(id).style.display==alt[0]) obj(id).style.display=alt[1]; else obj(id).style.display=alt[i];
}

function zSet(id,i) { obj(id).style.zIndex=i; }

function sArray(sk,sv)
{
   sf=-1; for(sn=0; sf==-1&&sn<sarray.length; sn++) if(sarray[sn][0]==sk) sf=sn; if(sv) { if(sf==-1) sf=sarray.length*1;
   sarray[sf]=new Array(sk,sv); } else { if(sf==-1) return false; else return sarray[sf][1]; }
}

function slide(id,d,n)
{
   if(d==-1&&obj(id).offsetLeft>=0) {} else if(d==1&&obj(id).offsetWidth-82-n*82>=0) {} else {
   if(sliD==0||Math.abs(d)==2) { if(Math.abs(d)!=2) { sliD=2*d; sliX=obj(id).offsetLeft; sliW=obj(id).offsetWidth;
   obj(id).style.width=(sliW+82*sliD/2)+'px'; } s=Math.PI/2/12; sliN+=s; sli=Math.abs(sliD/2)*Math.sin(sliN)*85;
   if(sliN<=Math.PI/2) { obj(id).style.left=(sliX-sli*sliD/2)+'px'; sliT=setTimeout('slide(\''+id+'\','+sliD+','+n+');',30); }
   else { obj(id).style.left=(sliX-82*sliD/2)+'px'; sliD=0; sliN=0; clearTimeout(sliT); } } }
}

function imagePng(o,arg)
{
   arg=(arg.replace(/´/g,'\"')).replace(/`/g,'\''); o.outerHTML='<span'+(o.id?' id=\"'+o.id+'\"':' ')+
   (o.alt?' title=\"'+o.alt+'\"':' ')+'style=\"width:'+o.offsetWidth+'px;height:'+o.offsetHeight+'px;overflow:hidden;filter:progid:'+
   'DXImageTransform.Microsoft.AlphaImageLoader(src=\''+o.src+'\',sizingMethod=\'scale\');\"'+arg+'>&nbsp;</span>';
}

function getWin()
{
  if(typeof(window.innerWidth)=='number') { win[0]=window.innerWidth; win[1]=window.innerHeight; } else if(document.documentElement&&
  (document.documentElement.clientWidth||document.documentElement.clientHeight)) { win[0]=document.documentElement.clientWidth;
  win[1]=document.documentElement.clientHeight; } else if(document.body&&(document.body.clientWidth||document.body.clientHeight)) {
  win[0]=document.body.clientWidth; win[1]=document.body.clientHeight; } } function getScr() { if(typeof(window.pageYOffset)=='number') {
  scr[0]=window.pageXOffset; scr[1]=window.pageYOffset; } else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)) {
  scr[0]=document.body.scrollLeft; scr[1]=document.body.scrollTop; } else if(document.documentElement&&(document.documentElement.scrollLeft||
  document.documentElement.scrollTop)) { scr[0]=document.documentElement.scrollLeft; scr[1]=document.documentElement.scrollTop; }
}

function rszObj()
{
   if(obj('image_dim')) imageDim('close');
}

function scrObj()
{
   if(obj('image_dim')) imageDim('close');
/* s=new Array(scr[0],scr[1]); getScr(); s[0]=scr[0]-s[0]; s[1]=scr[1]-s[1]; if(o=obj('image_dim'))
   { o.style.left=(o.offsetLeft+s[0])+'px'; o.style.top=(o.offsetTop+s[1])+'px'; } */
}

function getCookie(id)
{
   if(document.cookie.length>0) { str=document.cookie.indexOf(id+'='); if(str!=-1)
   { str=str+id.length+1; end=document.cookie.indexOf(';',str); if(end==-1) end=document.cookie.length;
   return unescape(document.cookie.substring(str,end)); } } return false;
}

function getUri(flush)
{
   if(flush=='root') { return obj('container_uri_ser').value; } else { r=''; f=''; count=2; if(flush.length>=3) f='^'+flush;
   u=(obj('container_uri_ser').value+'^'+window.location.href.substr(obj('container_root').value.length+1)+f).split('^');
   s=new Array(); for(n=0; n<u.length; n++) u[n]=u[n].split(':'); for(n=0; n<u.length; n++) { if((pf=u[n][0].substr(0,5))!='post_'&&pf!='form_')
   { p=0; for(m=n+1; m<u.length&&p==0; m++) if(u[n][0]==u[m][0]) p=1; if(p==0 && u[n][0].length>0) s[s.length]=u[n]; } } s.sort();
   for(n=0; n<s.length; n++) { if(obj(s[n][0])&&s[n][1].length>0) { if(r.length==0) r+= '#'; else r+= '^'; r+= s[n][0]+':'+s[n][1]; if(flush==1)
   xLoad(s[n][0],s[n][1],0); } } count=0; return r; } } function setUri(add,flush) { window.location.href=getUri(add); if(flush==1) getUri(1);
}

function xLoad(id,url,form)
{
   var http_request=false, time=new Date(), urlString=''; if(form!=0) obj(id).innerHTML='Loading...'; time.setTime(time.getTime());
   time=time.toGMTString(); if(window.XMLHttpRequest) { http_request=new XMLHttpRequest(); if(http_request.overrideMimeType)
   http_request.overrideMimeType('text/xml'); } else if(window.ActiveXObject) { try { http_request=new ActiveXObject('Msxml2.XMLHTTP');
   } catch (e) { try { http_request=new ActiveXObject('Microsoft.XMLHTTP'); } catch (e) {} } } if(!http_request) return false;
   urlString='doc_'+url; if(urlString.indexOf('?')>0) { urlString+='&'; } else { urlString+='?'; } d=new Date(); urlString+='time='+
   Math.floor(d.getTime()/1000); http_request.onreadystatechange=function() { if(obj(id) && http_request.readyState==4) {
   if(http_request.status==200) { obj(id).innerHTML=http_request.responseText; window.location.href=(u=getUri(id+':'+url));
   obj('container_uri').value=u; if(count==0) count=1; if(f=obj('fragment_add')) { go=f.value; f.value=''; if(go!=1&&go.length>0) {
   if(go=='root') obj('container_uri').value=''; else setUri(go); getUri(1); } } } else if(id!='container_status') { if(id=='admin') {
   obj(id+'_container').style.display='none'; window.location.href=(u=getUri(id+':'+url)); obj('container_uri').value=u; } else
   obj(id).innerHTML='Could\'nt read file `'+url+'` ['+http_request.status+']'; } } }; if(form==0) { http_request.open('GET',urlString,true);
   http_request.send(null); } else { forma=form.split(';'); param='form_name='+forma[0]; form=obj('form_'+forma[0]); for(n=1; n<forma.length; n++)
   { ans=form[forma[n]].value.replace(/&/g,''); if(ans.length>0) param+= '&'+forma[n]+'='+ans; } http_request.open('POST',urlString,true);
   http_request.setRequestHeader('Content-type','application/x-www-form-urlencoded'); http_request.setRequestHeader('Content-length',param.length);
   http_request.setRequestHeader('Connection','close'); http_request.send(param); } } function xSubmit(fo,tv,ml) { tl=tv.length; p=sArray(fo.id);
   if((p==false||p!=tv) && tl>=ml) { sArray(fo.id,tv); fa=fo.action; fs=fa.substr(17,fa.length-18).replace(/\'/g,'').split(','); xLoad(fs[0],fs[1],fs[2]); }
}