// "DHT'eM alL" v5.3
// Cross-Browser DHTML engine (support MSIE4+ NS4+ Opera7+ Mozilla1.4+)
// (c)2000-2004 Dr.L0V http://drlov.i.am (CreativeZone http://cz-site.com)  
// All Rights Reserved.


// *** Browser implementation ***

Create_Browser = function(){
	var v=this.v=parseInt(this.ver=navigator.appVersion);
	var b=navigator.appName, ua=navigator.userAgent.toLowerCase();
	this.ie = b=="Microsoft Internet Explorer";
	this.ie4 = this.ie&&(this.ver.indexOf('MSIE 4')>0);
	this.ie5 = this.ie&&(this.ver.indexOf('MSIE 5')>0);
	this.ie55 = this.ie&&(this.ver.indexOf('MSIE 5.5')>0);
	this.ie6 = this.ie&&(this.ver.indexOf('MSIE 6')>0);
	this.ns = b=="Netscape";
	this.ns4 = this.ns&&(v==4);
	this.ns6 = (ua.indexOf('netscape')>-1)&&(v>=5);
	this.mozilla = !this.ns6&&(ua.indexOf('gecko')>-1);
	this.opera = b=="Opera";
	this.opera6 = this.opera&&(v==6);
	this.opera7 = this.opera&&(v==7);
	this.safari = ua.indexOf("safari")>-1;
	this.iens6 = this.ie||this.ns6;
	this.ns6mozilla = this.ns6||this.mozilla;
	this.dom=(this.ie||document.createElement&&document.appendChild&&document.getElementsByTagName)?true:false;
	this.win32=ua.indexOf("win")>-1;
	this.mac=ua.indexOf("mac")>-1;
	this.DrLOV=this.ie?"Dr.L&OslashV":"Dr.LOV";
	this.EngineName="DHT&rsquo;eM alL"; this.EngineVer="5.31";
	this.Support=true;
	if (!( (this.ie&&this.v>3) || (this.ns&&this.v>3) || (this.opera&&this.v>6) || (this.mozilla) )) {this.Support=false; alert("Warning! This Browser not support!");}
}

//Default initialize
if (typeof(Br)!="object") Br=Browser=new Create_Browser();




// *** Object (layer) implementation ***

//constructor
Create_Object = function(frame,id,parent,x,y,w,h,bgColor,v,z){
	this.Frame=frame||self;
	this.Parent=parent;	
	if (id!=null) this.ID=id;
	else {
		this.ID="Object_ID_"+Create_Object.Count;
		if (Br.dom) {
			var html="<div id='"+this.ID+"' style='position:absolute;left:"+x+"px;top:"+y+"px;";
			if (w) html+="width:"+w+"px;";
			if (h) html+="height:"+h+"px;";
			if (w&&h) html+="clip:rect(0px "+w+"px "+h+"px 0px);";
			html+="z-index:"+((z!=null)?z:0)+";";
			html+="visibility:"+((v==null)?"inherited":(v?"visible":"hidden"))+";'></div>";		
			var pe=(this.Parent!=null)?this.Parent.elm:this.Frame.document.body;
			if (Br.ns6mozilla) {
				var r=pe.ownerDocument.createRange(); r.setStartBefore(pe);
				pe.appendChild(r.createContextualFragment(html)); 
			} else pe.insertAdjacentHTML("BeforeEnd",html);
		} else if (Br.ns4) {
			if (this.Parent) {
				var tp=this.Parent; var pr="";
				while(true){pr="document."+tp.ID+pr;if(tp.Parent==null){break;}pr="."+pr;tp=tp.Parent;}
				var lr=eval("this.Frame."+pr+".document."+this.ID+"=new Layer(w,"+pr+")");
			} else var lr=eval("this.Frame.document."+this.ID+"=new Layer(w)");
			lr.name=this.ID; lr.left=x; lr.top=y;
			if (h) lr.clip.height=h;
			lr.zIndex=((z!=null)?z:0);
			lr.visibility=(v==null)?"inherit":(v?"show":"hide"); } }
	this.Children=[];
	if (this.Parent) this.Parent.Children[this.Parent.Children.length]=this;
	eval((this.ObjectName="Object1_"+Create_Object.Count)+"=this;");	
	Create_Object.Count++;
	if (Br.dom) {
		this.elm=Br.ns6mozilla?this.Frame.document.getElementById(this.ID):this.Frame.document.all[this.ID];
		this.css=this.elm.style; this.doc=this.Frame.document;
	} else if (Br.ns4) {
		if (id==null) {
			this.elm=(this.Parent!=null)?eval("this.Frame."+pr+".document."+this.ID):this.Frame.document[this.ID];
			this.css=this.elm; this.doc=this.elm.document;
		} else {;}
	}
	this.Wrap=true; this.Exist=true;
	this.GP(); this.GetPagePos(); this.GetContPos(); this.GZ(); this.GetPageZindex(); this.GV();
	if (bgColor) this.SetBgColor(bgColor);
	this.GS(); if(Br.ns6)eval("setTimeout('"+this.ObjectName+".GS();',300)");
}
Create_Object.Count=0;

//destructor
Create_Object.prototype.Destroy = function(){
	if (!this.Exist) return;
	this.SetVisible(false);
	for (var i=0;i<this.Children.length;i++) this.Children[i].Destroy();
	if (Br.dom) this.elm.outerHTML=this.elm.innerHTML=""; else this.WriteContent("");
	if (this.Parent){
		l=this.Parent.length;
		for(i=0;i<l&&this.Parent.Children[i]!=this;i++);
		if (i!=l){
			this.Parent.Children[i]=this.Parent.Children[l-1];
			this.Parent.Children[l-1]=null; this.Parent.Children.length--;} }
	eval(this.ObjectName+"=null;");	
	this.Exist=false; this.ObjectName=this.Parent=this.Children=this.Frame=this.ID=this.elm=this.css=this.doc=null;
}

//general Viewport func
Create_Object.prototype.GetPos = function(){
	if(this.css){this.X=parseInt(this.css.left)+this.GetClipSide("l");this.Y=parseInt(this.css.top)+this.GetClipSide("t");}
	else {this.X=this.Y=0;}
	if(this.elm){this.eX=parseInt(this.elm.offsetLeft);this.eY=parseInt(this.elm.offsetTop);}
	else {this.eX=this.eY=0;}
}
Create_Object.prototype.GetPagePos = function(){
	var xa=0; var ya=0;
	for (var to=this;to.Parent!=null;to=to.Parent) {xa+=to.Parent.X;ya+=to.Parent.Y;}	
	this.pX=this.X+xa; this.pY=this.Y+ya;
}
Create_Object.prototype.SetPos = function(x,y){
	if(this.css){this.css.left=(this.X=((x==null)?this.X:x))-this.GetClipSide("l");this.css.top=(this.Y=((y==null)?this.Y:y))-this.GetClipSide("t");}
	this.GetContPos();
} 
Create_Object.prototype.SetPosBy = function(x,y){
	this.SetPos(this.X+((x==null)?0:x),this.Y+((y==null)?0:y));
}
Create_Object.prototype.GetSize = function(){
	this.GetContSize();
	if(Br.dom){//todo: use clip params
		this.W=isNaN(parseInt(this.css.width))?this.cW:parseInt(this.css.width);
		this.H=isNaN(parseInt(this.css.height))?this.cH:parseInt(this.css.height);
		this.eW=parseInt(this.elm.offsetWidth);
		this.eH=parseInt(this.elm.offsetHeight);}
	else if(Br.ns4&&this.css){
		this.W=(this.css.clip.width==0)?this.cW:this.css.clip.width;
		this.H=(this.css.clip.height==0)?this.cH:this.css.clip.height;
		this.eW=this.elm.offsetWidth;
		this.eH=this.elm.offsetHeight;}
	else {this.W=this.H=0;}
}
Create_Object.prototype.SetSize = function(w,h){
	var w=(w==null)?this.W:w; var h=(h==null)?this.H:h;
	if (Br.dom) {this.css.width=w; this.css.height=h; this.SetClip(0,w,h,0);}
	else if (Br.ns4&&this.css) this.css.resizeTo(w,h);
	this.GetPos(); this.GetPagePos(); this.GetSize(); this.GetContPos();
}
Create_Object.prototype.GetVisible = function(){
	if (!this.css) return this.V=false;
	for (var to=this; to!=null&&to.css.visibility!=(Br.ns4?"hide":"hidden"); to=to.Parent);
	return this.V=((to==null)?true:false);
}
Create_Object.prototype.SetVisible = function(v){
	if (this.css) this.css.visibility=this.V=(v==false)?(Br.ns4?"hide":"hidden"):"inherit";
}
Create_Object.prototype.GetBgColor = function(){//todo: nn4 bug fix
	if (Br.dom) return this.bgColor=this.css.backgroundColor;
	else if (Br.ns4&&this.doc) return this.bgColor=this.doc.bgColor;
//	return this.bgColor=((Br.dom)?this.css.backgroundColor:((Br.ns4&&this.doc)?this.doc.bgColor:"#FFFFFF"));
}
Create_Object.prototype.SetBgColor = function(c){
	if (Br.dom) this.css.backgroundColor=this.bgColor=c;
	else if (Br.ns4&&this.doc) this.doc.bgColor=this.bgColor=c;
}
Create_Object.prototype.GetZindex = function(){
	return this.Z=parseInt((!this.css)?0:(isNaN(this.css.zIndex)?0:this.css.zIndex));
}	
Create_Object.prototype.GetPageZindex = function(){
	var za=0;
	for (var to=this;to.Parent!=null;to=to.Parent) za+=to.Parent.Z;	
	return this.pZ=this.Z+za;
}	
Create_Object.prototype.SetZindex = function(z){
	if (this.css) this.css.zIndex=this.Z=z;
}	
Create_Object.prototype.SetClass = function(c){
	if (Br.dom) this.elm.className=c;
}
Create_Object.prototype.RunFilter = function(i){
	if (Br.ie) {if(i==null)i=0; this.elm.filters[i].Apply(); this.SetVisible(true); this.elm.filters[i].Play();}
	else this.SetVisible(true);
}
Create_Object.prototype.StopFilter = function(i){
	if (Br.ie) {this.elm.filters[(i==null)?0:i].Stop();}
}
Create_Object.prototype.PointIn = function(x,y){
	this.GetPagePos();
	if (x>=this.pX&&x<(this.pX+this.W)&&y>=this.pY&&y<(this.pY+this.H)) return true;
	return false;
}

//general Clip func
Create_Object.prototype.SetClip = function(t,r,b,l){
	if (this.css){
		if (Br.ns4) {this.css.clip.top=t; this.css.clip.right=r; this.css.clip.bottom=b; this.css.clip.left=l;}
		else { var s=(Br.opera||Br.mozilla)?"px, ":"px "; this.css.clip="rect("+t+s+r+s+b+s+l+"px)"; } }
}
Create_Object.prototype.SetClipBy = function(t,r,b,l){
	this.SetClip(this.GetClipSide("t")+t,this.GetClipSide("r")+r,this.GetClipSide("b")+b,this.GetClipSide("l")+l);
}
Create_Object.prototype.GetClipSide = function(s){
	if (!this.css||!this.css.clip) return 0;
	if (Br.dom) var ca=this.css.clip.split("rect(")[1].split(")")[0].split((Br.opera||Br.mozilla)?"px,":"px");
	if (s=="t") return Br.dom?parseInt(ca[0]):this.css.clip.top;
	if (s=="r") return Br.dom?parseInt(ca[1]):this.css.clip.right;
	if (s=="b") return Br.dom?parseInt(ca[2]):this.css.clip.bottom;
	if (s=="l") return Br.dom?parseInt(ca[3]):this.css.clip.left;
}

//general Content func
Create_Object.prototype.GetContPos = function(){
	if(this.css){this.cX=parseInt(this.css.left);this.cY=parseInt(this.css.top);}else{this.cX=this.cY=0;}
	this.GetContPagePos();
}
Create_Object.prototype.GetContPagePos = function(){
	var xa=0; var ya=0;
	for (var to=this;to.Parent!=null;to=to.Parent) {xa+=to.Parent.cX;ya+=to.Parent.cY;}	
	this.pcX=this.cX+xa; this.pcY=this.cY+ya;
}
Create_Object.prototype.SetContPos = function(x,y){
	var t=(y!=null)?this.Y-y:this.GetClipSide("t");
	var l=(x!=null)?this.X-x:this.GetClipSide("l");
	var r=l+this.W; var b=t+this.H;
	this.SetClip(t,r,b,l); this.SetPos(this.X,this.Y); this.GetContPagePos();
}
Create_Object.prototype.GetContSize = function(){
	if (Br.ie||Br.opera) {this.cW=this.elm.scrollWidth; this.cH=this.elm.scrollHeight;}
	else if (Br.ns6mozilla) {//todo: nn6 wrap only if nested layers!!!
		var tw=this.css.width; var th=this.css.height;
		this.css.height="auto";	if (!this.Wrap) this.css.width="auto";
		this.cW=this.elm.offsetWidth; this.cH=this.elm.offsetHeight;
		this.css.width=tw; this.css.height=th; }
	else if (Br.ns4&&this.doc) {this.cW=this.doc.width; this.cH=this.doc.height;}
	else {this.cW=this.cH=0;}
}
Create_Object.prototype.WriteContent = function(html){
	//var s="<table cellspacing=0 cellpading=0 border=0><tr><td bgcolor="+this.bgColor+">"+((this.Wrap==true)?html:"<nobr>"+html+"</nobr>")+"</td></tr></table>";
	var s=((this.Wrap==true)?html:"<nobr>"+html+"</nobr>");
	if (Br.dom) this.elm.innerHTML=s;
	else if (Br.ns4&&this.doc){
		with(this.doc){open();write(s);close();}
		this.SetSize(this.W,this.H);}
	this.GetSize();
}
Create_Object.prototype.MakeBuffer = function(){
	if (this.BufferID==null&&Br.dom) {
		this.BufferID="LoadBuffer_"+this.ObjectName;
		var html="<iframe name='"+this.BufferID+"' id='"+this.BufferID+"' style='visibility:hidden;'></iframe>";
		if (Br.ns6mozilla) {
			var pe=self.document.body; r=pe.ownerDocument.createRange(); r.setStartBefore(pe);
			pe.appendChild(r.createContextualFragment(html)); } 
		else self.document.body.insertAdjacentHTML("BeforeEnd",html); }
	this.BufferMove=true;
}
Create_Object.prototype.LoadContent = function(url){
	this.MakeBuffer(); 
	if (Br.ie||Br.opera) self[this.BufferID].location=url;
	else if (Br.ns6mozilla) self.document.getElementById(this.BufferID).src=url;
	else if (Br.ns4) {this.css.obj=this; this.css.src=url;}
}
Create_Object.prototype.SubmitForm = function(frmName){ //only Br.dom !!!
	this.MakeBuffer();
	var fr=document.forms[frmName];
	fr.target=this.BufferID;
	fr.submit();
}
Create_Object.prototype.LoadContentFinish = function(onLoadFunc){
	if (Br.dom&&this.BufferMove==true) {//todo: look to improve
		this.WriteContent(self[this.BufferID].document.body.innerHTML);
		//var html=self[this.BufferID].document.body.innerHTML;
		//this.elm.innerHTML=((this.Wrap==true)?html:"<nobr>"+html+"</nobr>");
		}
	if (Br.dom) self[this.BufferID].document.body.innerHTML="";
	this.BufferMove=false;
	this.GetSize(); this.SetContPos(this.X,this.Y);
	if (onLoadFunc!=null) eval(onLoadFunc);
}
function LoadingComplete(onLoadFunc){
	if (Br.dom) {
		var oN=self.name.substring(self.name.indexOf("_")+1,self.name.length);
		if (oN.length>0) eval("if(typeof(parent."+oN+")=='object')var o=parent."+oN);
	} else if (Br.ns4) if (typeof(this.obj)=="object") {var o=this.obj;this.obj=null;}
	if (typeof(o)=="object") o.LoadContentFinish(onLoadFunc);
	return o;
}
function LoadingCompleteWrite(strHTML){
	if (Br.dom) {
		var oN=self.name.substring(self.name.indexOf("_")+1,self.name.length);
		if (oN.length>0) eval("if(typeof(parent."+oN+")=='object')var o=parent."+oN);
	} else if (Br.ns4) if (typeof(this.obj)=="object") {var o=this.obj;this.obj=null;}
	if (typeof(o)=="object") {
		o.WriteContent(strHTML);
		o.BufferMove=false;
		o.LoadContentFinish();
	} else document.write(strHTML);
}

		
//misc func
Create_Object.prototype.SetChildVar = function(vn,vd){
	eval("this."+vn+"="+vd+";");
	for (var i=0;i<this.Children.length;i++) this.Children[i].SetChildVar(vn,vd);
}

//Shortcuts:
C_O=Create_Object;
Create_Object.prototype.SP = Create_Object.prototype.SetPos;
Create_Object.prototype.GP = Create_Object.prototype.GetPos;
Create_Object.prototype.SS = Create_Object.prototype.SetSize;
Create_Object.prototype.GS = Create_Object.prototype.GetSize;
Create_Object.prototype.GV = Create_Object.prototype.GetVisible;
Create_Object.prototype.SV = Create_Object.prototype.SetVisible;
Create_Object.prototype.SC = Create_Object.prototype.SetClass;
Create_Object.prototype.GZ = Create_Object.prototype.GetZindex;
Create_Object.prototype.SZ = Create_Object.prototype.SetZindex;
Create_Object.prototype.WC = Create_Object.prototype.WriteContent;
Create_Object.prototype.LC = Create_Object.prototype.LoadContent;
Create_Object.prototype.SF = Create_Object.prototype.SubmitForm;




// *** Events implementation ***

//constructor
Create_Events = function(frame){
	this.DocW=this.DocH=32768; this.init=false;
	this.ModalL=0; this.isRoute=false;
}

Create_Events.prototype.Initialize = function(){
	this.Frame=self; this.Win=window; this.Win.elm=this.Win;
	this.Win.ModalL=0;
	this.Doc=this.Frame.document; this.Doc.elm=this.Doc; //this.Doc.ModalL=1000;
	if (Br.ns4&&this.init&&(this.Win.innerWidth!=this.DocW||this.Win.innerHeight!=this.DocH)) {location.reload(); return;}//history.go(0);
	this.GetDocSize();
	this.init=true;
}

Create_Events.prototype.GetDocSize = function(win){
	if (win==null) win=this.Win;
	this.DocW=(Br.ns||Br.mozilla)?win.innerWidth:win.document.body.offsetWidth;//clientWidth;
	this.DocH=(Br.ns||Br.mozilla)?win.innerHeight:win.document.body.offsetHeight;//clientHeight;
}

Create_Events.prototype.Add = function(o,e,f){
	var s="Func";
	if (o[e+s]==null){
		o[e+s]=[]; o.elm.ObjectRef=o; o.elm.EventsRef=this; o.elm["on"+e]=this.EventsHandler;
		if (Br.ns4) o.elm.captureEvents(Event[e.toUpperCase()]);}
	o[e+s][o[e+s].length]=f; 
	if (o.ModalL==null) o.ModalL=0;
}
Create_Events.prototype.Del = function(o,e,f){
	var s="Func"; var l=o[e+s].length;
	for(var i=0;i<l&&o[e+s][i]!=f;i++);
	if(i!=l){o[e+s][i]=o[e+s][l-1];o[e+s][l-1]=null;o[e+s].length--;}
}

Create_Events.prototype.EventsHandler = function(e){
	if (Br.ie) e=event;
	if (Br.ns4&&e.type=="load"&&this.ObjectRef==window&&this.EventsRef.init) {routeEvent(e); return false;}
	var b=this.ObjectRef.B=Br.ie?((e.button==2)?3:((e.button==4)?2:e.button)):e.which;
	var t=this.ObjectRef.Type=e.type;
	if (t!="load") {
		if ((Br.ns||Br.mozilla)&&e.target!=document) routeEvent(e);
		var x=this.EventsRef.X=Br.ie?e.x+this.EventsRef.Doc.body.scrollLeft:e.pageX;
		var y=this.EventsRef.Y=Br.ie?e.y+this.EventsRef.Doc.body.scrollTop:e.pageY;
	}
	var obj=o=this.ObjectRef;
	if (obj.ModalL>=this.EventsRef.ModalL) eval(obj[t+"Func"].join(';'));
	return Br.ns4?true:this.EventsRef.isRoute;
}
Create_Events.prototype.CancelBubble = function(e){
	if (Br.ie) var e=event;
	e.cancelBubble=true;
}
Create_Events.prototype.SetModal = function(o,m,l){
	if (l!=null) o.ModalL=l;
	else {
		if (m) this.ModalL++; else this.ModalL--;
		o.SetChildVar("ModalL",this.ModalL); }
}

//Default events object initialize
//!!! Must run Events.Initialize() after body onload !!!
if (typeof(Events)!="object") Events=new Create_Events(self);




// *** Drag implementation ***

//constructor
Create_Drag = function(){
	this.Obj=null; this.Array=[]; this.X=this.Y=0; this.Z=100;
}
Create_Drag.prototype.Initialize = function(){
	Events.Add(Events.Doc,"mousemove","Drag.MouseMove(x,y)");
	Events.Add(Events.Doc,"mouseup","Drag.MouseUp(x,y)");
	Events.SetModal(Events.Doc,null,1000);
}

Create_Drag.prototype.Add = function(o,t,r){
	this.SetGrab(o,0,0,o.W,o.H); this.Array[this.Array.length]=o;
	Events.Add(o,"mousedown","Drag.MouseDown(obj,x,y)");
	o.onDragStart=[]; o.onDragMove=[]; o.onDragEnd=[]; this.Z++;
	o.DragTruncated=(t==null)?true:t; o.DragResort=(r==null)?true:r;
}
Create_Drag.prototype.Del = function(o){
	var i=this.Index(o);
	if (i!=null){
		Events.Del(o,"mousedown","Drag.MouseDown(obj,x,y)");
		for (var k=i;k<=this.Array.length-2;k++) this.Array[k]=this.Array[k+1];
		this.Array[this.Array.length--]=null;
		o.onDragStart=o.onDragMove=o.onDragEnd=o.DragGrab=o.DragTruncated=o.DragResort=null;}
}
Create_Drag.prototype.SetGrab = function(o,x,y,w,h){ 
	o.DragGrab=new Array(x,y,w,h);
}
Create_Drag.prototype.ToTop = function(o){
	var i=this.Index(o); if (i!=null) o.SetZindex(this.Z++);
}
Create_Drag.prototype.AddStartFunc = function(o,f){
	var i=this.Index(o); if (i!=null) o.onDragStart[o.onDragStart.length]=f;
}
Create_Drag.prototype.AddMoveFunc = function(o,f){
	var i=this.Index(o); if (i!=null) o.onDragMove[o.onDragMove.length]=f;
}
Create_Drag.prototype.AddEndFunc = function(o,f){
	var i=this.Index(o); if (i!=null) o.onDragEnd[o.onDragEnd.length]=f;
}
Create_Drag.prototype.PointInGrab = function(o,x,y){
	var i=this.Index(o);
	if (i!=null){
		o.GetPagePos(); xR=o.pX+o.DragGrab[0]; yR=o.pY+o.DragGrab[1];
		if (x>=xR&&x<(xR+o.DragGrab[2])&&y>=yR&&y<(yR+o.DragGrab[3])) return true; }
	return false;
}
Create_Drag.prototype.Index = function(o){
	for (var i=0;i<this.Array.length;i++) if (this.Array[i]==o) return i;
	return null;
}

Create_Drag.prototype.MouseDown = function(obj,x,y){
	if (this.Obj) return true;
	if (this.PointInGrab(obj,x,y)){
		this.Obj=o=obj;
		this.X=x-o.pX+(o.pX-o.X); this.Y=y-o.pY+(o.pY-o.Y);
		if (o.DragResort) this.ToTop(o);
		eval(o.onDragStart.join(';'));
		return false; }
	else return true;
}
Create_Drag.prototype.MouseMove = function(x,y){
	if (!this.Obj) return true;
	var o=this.Obj;
	x=x<0?0:(x>Events.DocW)?Events.DocW:x;
	y=y<0?0:(y>Events.DocH)?Events.DocH:y;
	var aw=o.DragTruncated?((o.Parent!=null)?o.Parent.W:Events.DocW):32768;
	var ah=o.DragTruncated?((o.Parent!=null)?o.Parent.H:Events.DocH):32768;
	var nx=((o.DragTruncated&&(x-this.X))<0)?0:(x-this.X);
	nx=(((x-this.X)+o.W)>aw)?aw-o.W:nx;
	var ny=((o.DragTruncated&&(y-this.Y))<0)?0:(y-this.Y);
	ny=(((y-this.Y)+o.H)>ah)?ah-o.H:ny;
	o.SetPos(nx,ny); var obj=o; eval(o.onDragMove.join(';'));
	return false;
}
Create_Drag.prototype.MouseUp = function(x,y){
	if (!this.Obj) return true;
	var obj=this.Obj; eval(obj.onDragEnd.join(';'));
	this.Obj=null;
	return false;
}
//Default initialize 
//!!! Init in Events.Initialize() after body onload !!!
//!!! Must initialize after body onload !!!
//!!! Must run Drag.Initialize() after body onload !!!
if (typeof(Drag)!='object') Drag=new Create_Drag();




// *** Cookies implementation ***

Create_Cookies = function(){
	this.Set("testingcookies","yes",1);
	if (this.Get("testingcookies")=="yes"){
		this.Enable=true; this.Del("testingcookies");
	} else this.Enable=false;
}
Create_Cookies.prototype.Get = function(name){
	var ca=document.cookie.split(';'), c;
	name+="=";
	for(var i=0;i<ca.length;i++){
		c=ca[i];
		while (c.charAt(0)==' ') c=c.substring(1,c.length);
		if (c.indexOf(name)==0) return c.substring(name.length,c.length); }
	return null;
}
Create_Cookies.prototype.Set = function(name,value,days){
	var expires="";
	if (days){
		var today=new Date();
		today.setTime(today.getTime()+(days*86400000));
		expires="; expires="+today.toGMTString(); }
	document.cookie=name+"="+value+expires+"; path=/";
}
Create_Cookies.prototype.Del = function(name){
	this.Set(name,"",-1);
} 
//Default initialize
if (typeof(Cookies)!="object") Cookies=new Create_Cookies();




// *** Flash implementation ***

Create_Flash = function(){
	gDetectFlashVer=0;
	if (Br.ie){
		var f4=f5=f6=false;
		with (document) {
			write("<scr"+"ipt language='VBScript'\> \n");
			write("on error resume next \n");
			write('f4 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
			write('f5 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');
			write('f6 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');
			write('if f4 then gDetectFlashVer=4 \n');
			write('if f5 then gDetectFlashVer=5 \n');
			write('if f6 then gDetectFlashVer=6 \n');
			write("</scr"+"ipt\> \n"); }
	} else if (navigator.plugins) {
			if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
				var des=navigator.plugins["Shockwave Flash"+(navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"")].description;
				gDetectFlashVer=parseInt(des.charAt(des.indexOf(".")-1)); }
	}
	this.v=gDetectFlashVer;
	this.f4=(gDetectFlashVer==4);
	this.f5=(gDetectFlashVer==5);
	this.f6=(gDetectFlashVer==6);
}
Create_Flash.prototype.GetHTML = function(id,url,w,h,bg,trans,quality,menu){
	return this.GetHTML6(id,url,w,h,bg,trans,quality,menu);
}
Create_Flash.prototype.GetHTML6 = function(id,url,w,h,bg,trans,quality,menu){
	if (bg==null) bg="#000000";
	if (quality==null) quality="high";
	if (menu==true) menu="true"; else menu="false";
	var s="<OBJECT name='"+id+"' id='"+id+"' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' WIDTH="+w+" HEIGHT="+h+" BORDER=0><PARAM NAME=movie VALUE='"+url+"'><PARAM NAME=quality VALUE="+quality+"><PARAM NAME=menu VALUE="+menu+"><PARAM NAME=bgcolor VALUE="+bg+">"+(trans?"<PARAM NAME=wmode VALUE=transparent>":"");
	s+="<EMBED name='"+id+"' src='"+url+"' menu="+menu+" quality="+quality+" WIDTH="+w+" HEIGHT="+h+" bgcolor="+bg+" swLiveConnect=true TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer' "+(trans?"wmode=transparent":"")+"></EMBED></OBJECT>";
	return s;
}
Create_Flash.prototype.GetHTML5 = function(id,url,w,h,bg,trans,quality,menu){
	if (bg==null) bg="#000000";
	if (quality==null) quality="high";
	if (menu==true) menu="true"; else menu="false";
	var s="<OBJECT name='"+id+"' id='"+id+"' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' WIDTH="+w+" HEIGHT="+h+" BORDER=0><PARAM NAME=movie VALUE='"+url+"'><PARAM NAME=quality VALUE="+quality+"><PARAM NAME=menu VALUE="+menu+"><PARAM NAME=bgcolor VALUE="+bg+">"+(trans?"<PARAM NAME=wmode VALUE=transparent>":"");
	s+="<EMBED name='"+id+"' src='"+url+"' menu="+menu+" quality="+quality+" WIDTH="+w+" HEIGHT="+h+" bgcolor="+bg+" swLiveConnect=true TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' "+(trans?"wmode=transparent":"")+"></EMBED></OBJECT>";
	return s;
}
//Default initialize
if (typeof(Flash)!="object") Flash=new Create_Flash();




// *** Content Load Engine (CLE) implementation ***

Create_CLE = function(){
	this.data=new Array(20);
	for (var i=0;i<this.data.length;i++) this.data[i]=new Array(3);
}
Create_CLE.prototype.Load = function(c){
	var i,s="",a=this.Load.arguments;
	for (i=1;i<a.length;i++) s+=a[i]+"&";
	this.data[0][0]=c; this.data[0][1]=s; this.data[0][2]=0;
	myCLE_Do(c,s);
}
Create_CLE.prototype.LoadAdd = function(c){
	var i,n,s="",a=this.LoadAdd.arguments;
	this.data[0][2]=myCLE_GetY();
	for (i=this.data.length-1;i>0;i--) { for (n=0;n<this.data[0].length;n++) this.data[i][n]=this.data[i-1][n]; }
	for (i=1;i<a.length;i++) s+=a[i]+"&";
	this.data[0][0]=c; this.data[0][1]=s; this.data[0][2]=0;
	myCLE_Do(c,s);
}
Create_CLE.prototype.Back = function(d){
	for (var i=((!d?1:d)-1);i<this.data.length-1;i++) { for (var n=0;n<this.data[0].length;n++) this.data[i][n]=this.data[i+1][n]; }
	myCLE_Do(this.data[0][0],this.data[0][1]);
}
Create_CLE.prototype.LoadLast = function(){
	myCLE_Do(this.data[0][0],this.data[0][1]);
}
Create_CLE.prototype.GetName = function(){
	return this.data[0][0];
}
Create_CLE.prototype.OnLoad = function(){
	myCLE_SetY(this.data[0][2]);
}
//Default initialize
// need functions implement myCLE_Do(c,p), myCLE_GetY(), myCLE_SetY(y) !
if (typeof(top.CLE)!="object") top.CLE=CLE = new Create_CLE();
else CLE=top.CLE;




// *** Useful funcs implementation ***

function Add_URL_UNI(url){
	return url+((url.indexOf("?")>0)?"&":"?")+"UNI="+(new Date()).getTime();
}

function Add_ContextMenu(func){
	if (Br.ie||Br.ns6||Br.mozilla) Events.Add(Events.Doc,"contextmenu",func+";");
	else Events.Add(Events.Doc,"mousedown","if (b==3) { "+func+"; }");
}

function PreloadImages(){
	var i, a=PreloadImages.arguments;
	_pia=[];
	for (i=0;i<a.length;i++){_pia[i]=new Image; _pia[i].src=a[i];}
}

function SwopImage(img,url){
	img.src=url;
}

function GetURLParameter(url,pn){
	var s=url.indexOf(pn);
	if (s<0) return null;
	s+=pn.length+1;
	var e=url.indexOf("&",s);
	if (e<0) e=url.length;
	return unescape(url.substring(s,e));
}


