loaded = false; 
layer_name = new Array();
layer_obj = new Array();
end = "";
pause = "pause";
jump = "jump";
layers = new Array();
pager1_values = new Array();
pager1_values[0] = "nothing";
_d = document;
_l = layer;
function voidOut() {
	}
	
function runMe(c){}
		
function layer(name,father) {
	this.name = name;
 if(father){this.father = father};
	if(!father){this._l = name_layer(name);}
 else{this._l = layer_nest(name,father);}
	this.obj_name = 'layer_' + name;
 if(_d.all){_d.all[this.name].jsobj = this;}else{this._l.jsobj = this;}
 if(_d.getElementById){_d.getElementById(this.name).jsobj = this;}
 if(_d.layers){this._l.document.jsobj = this;}
	this.refresh = layer_refresh;this.refresh();
	
	this.hide = layer_hide;this.show = layer_show;
	this.bounce = layer_bounce;this.changeBg = layer_changeBg;
	this.setEvent = layer_setEvent;
	this.setmouseover = "";this.setmousedown = "";this.setmouseout = "";
	this.runmouseover = layer_mouseover;this.runmousedown = layer_mousedown;this.runmouseout = layer_mouseout;
	} 
 
function layer_refresh() {
	if(_d.all) {
	this.top = parseInt(this._l.pixelTop);
	this.left = parseInt(this._l.pixelLeft);
	this.height = _d.all[this.name].offsetHeight;
	this.width = _d.all[this.name].offsetWidth;
	this.zIndex = this._l.zIndex;
	this.visibility = this._l.visibility;
 this.bgColor = this._l.backgroundColor;
	}
	else if (_d.layers) {
	this.top = this._l.top;
	this.left = this._l.left;
	this.height = this._l.clip.height;
	this.width = this._l.clip.width;
	this.zIndex = this._l.zIndex;
	this.visibility = this._l.visibility;
 this.bgColor = this._l.bgColor;
	}
 else if (_d.getElementById) {
	this.top = parseInt(this._l.top);
	this.left = parseInt(this._l.left);
	this.height = eval('_d.getElementById("'+this.name+'")').offsetHeight;
	this.width = eval('_d.getElementById("'+this.name+'")').offsetWidth;
	this.zIndex = this._l.zIndex;
	this.visibility = this._l.visibility;
 this.bgColor = this._l.bgColor;
	}
	else {
	this.top = 0;
	this.left = 0;
	this.height = 0;
	this.width = 0;
	this.zIndex = 0;
	this.visibility = null;
	} 
}
 
function name_layer(name) {
 if (_d.getElementById) {
 	return(eval('_d.getElementById("'+name+'").style'));
	}
 else if (_d.layers) {
	return(eval('_d.layers["'+name+'"]'));
 	}
 else if (_d.all) {
	return(eval('_d.all["' + name + '"].style'));
	}
 else{return("empty");}
}
 
function layer_setEvent(event,action) { 
	if (event == "onmouseover"){eventCI = "MOUSEOVER";handler = "this.runmouseover";this.setmouseover += action;}
	if (event == "onmousedown"){eventCI = "MOUSEDOWN";handler = "this.runmousedown";this.setmousedown += action}
	if (event == "onmouseout"){eventCI = "MOUSEOUT";handler = "this.runmouseout";this.setmouseout += action}
	if(_d.all){ 
 eval("_d.all['"+this.name+"']."+event+"="+handler);
 }
 else if(_d.getElementById) {
 eval("_d.captureEvents(Event."+eventCI+")");
 eval("_d.getElementById('"+this.name+"')."+event+" ="+ handler);
 }
 else if(_d.layers) {
 eval(this.obj_name+"._l.captureEvents(Event."+eventCI+")");
 eval(this.obj_name+"._l."+event+" = "+handler);
 }
}
 
function layer_mousedown(event) {
 if(_d.layers) {
 tgt = event.target.jsobj;
 }
 if(_d.all) {
 tgt = window.event.srcElement.jsobj; 
 }
 else if(_d.getElementById) {
 tgt = event.target.jsobj;
 }
 if(tgt){eval(tgt.setmousedown)};
 }
function layer_mouseover(event) {
 if(_d.layers) {
 tgt = event.target.jsobj;
 }
 if(_d.all) {
 tgt = window.event.srcElement.jsobj;
 }
 else if(_d.getElementById) {
 tgt = event.target.jsobj;
 }
 if(tgt){eval(tgt.setmouseover)};
 }
 function layer_mouseout(event) {
 if(_d.layers) {
 tgt = event.target.jsobj;
 }
 if(_d.all) {
 tgt = window.event.srcElement.jsobj;
 }
 else if(_d.getElementById) {
 tgt = event.target.jsobj;
 }
 if(tgt){eval(tgt.setmouseout)};
 }

			
function setWatch(event,action) {
	handler = "";
 if (_d.all) {
 eval("_d."+event+" = "+action);
 }
 else if (_d.getElementById) {
		if (event == "onmousemove"){handler = "MOUSEMOVE";}
		eval("_d.captureEvents(Event."+handler+")");
 eval("_d."+event+" = "+action);
		}
	else if (_d.layers) {
		if (event == "onmousemove"){handler = "MOUSEMOVE";}
		eval("_d.captureEvents(Event."+handler+")");
 eval("_d."+event+" = "+action);
		}
	}
 
function setPager1(top,left,bottom,right,action) {
	thisArray = new Array(top,left,bottom,right,action);
	pl = pager1_values.length;
	pager1_values[pl]=thisArray;
	}
	
function catchPager1(event) {
 if(_d.all){thisY=window.event.clientY;thisX=window.event.clientX;}
	else {thisY=event.pageY;thisX=event.pageX;}
	for (plv = 1; plv < pager1_values.length; plv++) {
		eval("pagerTop = " + pager1_values[plv][0]);
		eval("pagerLeft = " + pager1_values[plv][1]);
		eval("pagerBottom = " + pager1_values[plv][2]);
		eval("pagerRight = " + pager1_values[plv][3]);
		if(thisY > pagerTop && thisY < pagerBottom
			&& thisX > pagerLeft && thisX < pagerRight) {eval(pager1_values[plv][4]);}
		}
	}

function family(name,father) {
 this.name = name
 this.members = new Array();
 this.cM = "";
		this.pM = "";
 this.addMembersByName = family_addMembersByName;
 this.runFamily = familyRunMe;
		this.stackFamily = family_stack;
 }
 
function family_addMembersByName(idtag) {
 for (n = 0; n < layers.length; n++) {
 if(layers[n].name.indexOf(idtag) >= 0) {
 this.members[this.members.length] = layers[n];
 }
 }
 }

function family_stack(xTop,xLeft,c) {
 	for (fl = 1; fl < this.members.length; fl++) {
	 this.pM = this.members[fl-1];
		this.cM = this.members[fl];
		newTop = parseInt(this.pM.top)+parseInt(xTop);
		newLeft = parseInt(this.pM.left)+parseInt(xLeft); 
		this.cM.bounce(newTop+"px",newLeft+"px");
 		}
	}
	 
function familyRunMe(c){
if(c && c != "undefined" && c != "end"){
 for (fl = 0; fl < this.members.length; fl++) {
 this.cM = this.members[fl];
 this.cM.c = c.split("|");
 for(cl = 0; cl < this.cM.c.length; cl) {
 if( this.cM.c[cl] != "end") {
 			 this.cM.c[cl] = this.cM.obj_name + "." + this.cM.c[cl];
 }
 cl = cl + 3;
 }
			direction = this.cM.c[0];
			distance = this.cM.c[1];
			speed = this.cM.c[2];
			if (direction && direction != "jump" && direction != "pause") {
				this.cM.c.reverse(); 
 		 this.cM.c.length = this.cM.c.length - 3;
	 		this.cM.c_jump = this.cM.c.reverse();
 if( direction != "end") {
	 			this.cM.c_jump = this.cM.c_jump.join('|');
	 			setc = direction+'('+distance+','+speed+',"'+this.cM.c_jump+'")';
	 			eval(setc);
 
		 		}
 }
			}
 }
		}
		
function layer_changeBg(color,y,c) {
 if(_d.all || _d.getElementById){this._l.backgroundColor = color} else{this._l.bgColor = color;}
 this.refresh();
 }
	
function layer_show(x,y,c){
	this._l.visibility = "visible";
	this.refresh();
	if (c){runMe(c);}
	}
	
function layer_hide(x,y,c){
	this._l.visibility = "hidden";
	this.refresh();
	if (c){runMe(c);}
	}
	
function layer_bounce(top,left,c){
	if(_d.layers){
	 this._l.top = parseInt(top);
	 this._l.left = parseInt(left);
	 }else{
	 this._l.top = top;
	 this._l.left = left;
	 }
	this.refresh();
	if (c){runMe(c);}
	}