function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}



function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}



function MM_findObj(n, d) { //v4.0

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && document.getElementById) x=document.getElementById(n); return x;

}



function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}









//UTIL

_ub="document.body.";_us="scroll";_uw="Width";_uh="Height";_b=document.all;_d=document;_w=window;

function getwx(){return(_b)?eval(_ub+"client"+_uw):_w.innerWidth}

function getwy(){return(_b)?eval(_ub+"client"+_uh):_w.innerHeight}

function getpx(){return(_b)?eval(_ub+_us+_uw):_d.width}

function getpy(){return(_b)?eval(_ub+_us+_uh):_d.height}

function getsx(){return(_b)?eval(_ub+_us+"Left"):_w.pageXOffset}

function getsy(){return(_b)?eval(_ub+_us+"top"):_w.pageYOffset}

function findObj(n, d) {var p,i,x;if(!d) d=document;if((p=n.indexOf("?"))>0&&parent.frames.length) {d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;}



//CONVERT LIB

hexstr="0123456789ABCDEF";function dechex(x){return(hexstr.charAt(x/16)+hexstr.charAt(x%16))}



//REAL TIME TOOL

function RTID(){RT=new Date();return (RT.getMilliseconds()+(RT.getSeconds()*999)+(RT.getMinutes()*59940)+(RT.getHours()*3596400))}

function RTOBJ(d,s,e){z=this;z.a=1;z.t=0;z.d=d;z.s=s;z.e=e;z.i=(e-s)/d;}

RTOBJ.prototype.gv=RTGV;function RTGV(){z=this;if(this.t==0)z.t=RTID();T=RTID()-z.t;if(T>z.d){z.a=0;return z.e}return z.s+(T*z.i)}



//LAYER OBJECT

function newbrowse(){return document.getElementById}

function LOBJ(L){z=this;z.N=L;t="document.";z.b=document.all;if(z.b){z.ie=eval(t+"all."+L);z.l= eval(t+"all."+L+".style")}else if (document.getElementById){z.ie=document.getElementById(L);z.l=document.getElementById(L).style;}else z.l=eval(t+L);}

LOBJ.prototype.sx=LSX;function LSX(x){z=this;(z.b)?z.l.pixelLeft=x:z.l.left=x}

LOBJ.prototype.gx=LGX;function LGX(){z=this;return(z.b)?z.l.pixelLeft:z.l.left}

LOBJ.prototype.sy=LSY;function LSY(x){z=this;(z.b)?z.l.pixelTop=x:z.l.top=x}

LOBJ.prototype.gy=LGY;function LGY(){z=this;return(z.b)?z.l.pixelTop:z.l.top}

LOBJ.prototype.vi=LVI;function LVI(x){z=this;if(x)z.l.visibility=(z.b || newbrowse())?"visible":"show";else z.l.visibility=(z.b || newbrowse())?"hidden":"hide";}

LOBJ.prototype.re=LRE;function LRE(x,y){z=this;if(z.b){z.l.width=x;z.l.height=y;}else z.l.resize(x,y);}

LOBJ.prototype.bg=LBG;function LBG(b){z=this;(z.b)?z.l.backgroundColor=b:z.l.bgColor=b}

LOBJ.prototype.wr=LWR;function LWR(d){z=this;if(z.b||newbrowse())z.ie.innerHTML=d;else{z.l.document.write(d);z.l.document.close()}}

LOBJ.prototype.cl=LCL;function LCL(l,t,r,b){c="clip";v=",";z=this;z.l[c];if(z.b)z.l[c]="rect("+t+v+r+v+b+v+l+")";else{z.l[c].top=t;z.l[c].left=l;z.l[c].bottom=b;z.l[c].right=r;}}



function get_random( p_rand )

{

    var ranNum= Math.round(Math.random()*p_rand);

    return ranNum;

}



function clearDefault(el) {

  if (el.defaultValue==el.value) el.value = ""

}