﻿var meunBase = function (member)
{
	if (!(this.constructor.prototype instanceof arguments.callee)) this.constructor = arguments.callee;
    if (member.prototype) for (var i in member.prototype) this[i] = member.prototype[i];
	with({name:"m",overpic:"indexbt.gif",outpic:"indexbt.gif",overcolor:"#FF9933",outcolor:"#000000",nshow:1,cshow:1,swidth:1002,xvalue:0,yvalue:0})
	with(member)
	{
		this.name = name;
		this.overpic = overpic;
		this.outpic = outpic;
		this.overcolor = overcolor;
		this.outcolor = outcolor;
		this.nshow = nshow;
		this.cshow = cshow;
		this.swidth = swidth;
		this.xvalue = xvalue;
		this.yvalue = yvalue;
	}
};

//--------------------------------------------------------------------------------------------------------------------

var meunm = function (member){
    if (!(this.constructor instanceof arguments.callee)) this.constructor = arguments.callee;
    this.constructor.prototype.constructor.call(this, member);
};
var meuna = function (member) {
    if (!(this.constructor.prototype instanceof arguments.callee)) this.constructor = arguments.callee;
    this.constructor.prototype.constructor.call(this, member); 
};
var meunr = function (member) {
    if (!(this.constructor.prototype instanceof arguments.callee)) this.constructor = arguments.callee;
    this.constructor.prototype.constructor.call(this, member); 
};

//-------------------------------------------------------------------------------------------------------------------------------

meunBase.prototype = {
	id : function(name)
	{
		return document.getElementById(name);
	}
	,getAbsolutePos : function(e)
	{
		var sl = 0, st = 0;
		var isdiv = /^div$/i.test(e.tagName);
		if (isdiv && e.scrollLeft) sl = e.scrollLeft;
		if (isdiv && e.scrollTop) st = e.scrollTop;
		var r = { x : e.offsetLeft - sl, y : e.offsetTop - st };
		if (e.offsetParent)
		{
			var tmp = this.getAbsolutePos(e.offsetParent);
			r.x += tmp.x;
			r.y += tmp.y;
		}
		return r;
	}
};

//------------------------------------------------------------------------------------------------------------

meunm.prototype = new meunBase({ prototype : {
	over : function(n)
	{
		for(var i=1;i<=this.nshow;i++)
		{
			this.id(this.name+i).src = "images/"+this.outpic.substring(0,this.outpic.indexOf("."))+"-"+i+this.outpic.substring(this.outpic.indexOf("."));
		}
		this.id(this.name+n).src = "images/"+this.overpic.substring(0,this.overpic.indexOf("."))+"-"+n+"-act"+this.overpic.substring(this.overpic.indexOf("."));
	}
	,out : function()
	{
		for(var i=1;i<=this.nshow;i++)
		{
			this.id(this.name+i).src = "images/"+this.outpic.substring(0,this.outpic.indexOf("."))+"-"+i+this.outpic.substring(this.outpic.indexOf("."));
		}
		this.id(this.name+this.cshow).src = "images/"+this.overpic.substring(0,this.overpic.indexOf("."))+"-"+this.cshow+"-act"+this.overpic.substring(this.overpic.indexOf("."));
	}
	,bgover : function(n)
	{
		for(var i=1;i<=this.nshow;i++)
		{
			this.id(this.name+i).style.backgroundImage = "url(images/"+this.outpic+")";
			if(this.id(this.name+"a"+i) != null)
			{
				this.id(this.name+"a"+i).style.color = this.outcolor;
			}
		}
		this.id(this.name+n).style.backgroundImage = "url(images/"+this.overpic+")";
		if(this.id(this.name+"a"+n) != null)
		{
			this.id(this.name+"a"+n).style.color = this.overcolor;
		}
	}
	,bgout : function()
	{
		for(var i=1;i<=this.nshow;i++)
		{
			this.id(this.name+i).style.backgroundImage = "url(images/"+this.outpic+")";
			if(this.id(this.name+"a"+i) != null)
			{
				this.id(this.name+"a"+i).style.color = this.outcolor;
			}
		}
		this.id(this.name+this.cshow).style.backgroundImage = "url(images/"+this.overpic+")";
		if(this.id(this.name+"a"+this.cshow) != null)
		{
			this.id(this.name+"a"+this.cshow).style.color = this.overcolor;
		}
	}
}});

//----------------------------------------------------------------------------------------------------------------------

meuna.prototype = new meunBase({ prototype : {
	over : function(n) 
	{
		var tp = this.getAbsolutePos(this.id("pcshow"+n))
		for(var i=1;i<=this.nshow;i++)
		{
			this.id(this.name+i).src = "images/"+this.outpic.substring(0,this.outpic.indexOf("."))+"-"+i+this.outpic.substring(this.outpic.indexOf("."));
			this.id(this.name+"d"+i).style.display = "none";
		}
		this.id(this.name+"d"+n).style.display = "block";
		tp.x = tp.x + this.id(this.name+n).xvalue;
		if(tp.x + this.id(this.name+"d"+n).offsetWidth > this.swidth)
		{
			tp.x -= tp.x + this.id(this.name+"d"+n).offsetWidth - this.swidth;
		}
		this.id(this.name+n).src = "images/"+this.overpic.substring(0,this.overpic.indexOf("."))+"-"+n+"-act"+this.overpic.substring(this.overpic.indexOf("."));
		this.id(this.name+"d"+n).style.left = tp.x;
		this.id(this.name+"d"+n).style.top = tp.y + this.yvalue;
	}
	,out : function()
	{
		for(var i=1;i<=this.nshow;i++)
		{
			this.id(this.name+i).src = "images/"+this.outpic.substring(0,this.outpic.indexOf("."))+"-"+i+this.outpic.substring(this.outpic.indexOf("."));
			this.id(this.name+"d"+i).style.display = "none";
		}
	}
	,bgover : function(n) 
	{
		var tp = this.getAbsolutePos(this.id("pcshow"+n))
		for(var i=1;i<=this.nshow;i++)
		{
			this.id(this.name+i).style.backgroundImage = "url(images/"+this.outpic+")";
			if(this.id(this.name+"a"+i) != null)
			{
				this.id(this.name+"a"+i).style.color = this.outcolor;
			}
			this.id(this.name+"d"+i).style.display = "none";
		}
		this.id(this.name+"d"+n).style.display = "block";
		tp.x = tp.x + this.id(this.name+n).xvalue;
		if(tp.x + this.id(this.name+"d"+n).offsetWidth > this.swidth)
		{
			tp.x -= tp.x + this.id(this.name+"d"+n).offsetWidth - this.swidth;
		}
		this.id(this.name+n).style.backgroundImage = "url(images/"+this.overpic+")";
		if(this.id(this.name+"a"+n) != null)
		{
			this.id(this.name+"a"+n).style.color = this.overcolor;
		}
		this.id(this.name+"d"+n).style.left = tp.x;
		this.id(this.name+"d"+n).style.top = tp.y + this.yvalue;
	}
	,bgout : function()
	{
		for(var i=1;i<=this.nshow;i++)
		{
			this.id(this.name+i).style.backgroundImage = "url(images/"+this.outpic+")";
			if(this.id(this.name+"a"+i) != null)
			{
				this.id(this.name+"a"+i).style.color = this.outcolor;
			}
			this.id(this.name+"d"+i).style.display = "none";
		}
	}
}});

//----------------------------------------------------------------------------------------------------------------------------

meunr.prototype = new meunBase({ prototype : {
	over : function(n)
	{
		for(var i=1;i<=this.nshow;i++)
		{
			this.id(this.name+i).src = "images/"+this.outpic.substring(0,this.outpic.indexOf("."))+"-"+i+this.outpic.substring(this.outpic.indexOf("."));
			this.id(this.name+"d"+i).style.display = "none";
		}
		this.id(this.name+"d"+n).style.display = "block";
		var tp = parseInt(this.id(this.name+n).xvalue);
		if(tp + this.id(this.name+"d"+n).offsetWidth > this.swidth)
		{
			tp -= tp + this.id(this.name+"d"+n).offsetWidth - this.swidth;
		}
		this.id(this.name+n).src = "images/"+this.overpic.substring(0,this.overpic.indexOf("."))+"-"+n+"-act"+this.overpic.substring(this.overpic.indexOf("."));
		this.id(this.name+"d"+n).style.marginLeft = tp;
	}
	,out : function()
	{
		for(var i=1;i<=this.nshow;i++)
		{
			this.id(this.name+i).src = "images/"+this.outpic.substring(0,this.outpic.indexOf("."))+"-"+i+this.outpic.substring(this.outpic.indexOf("."));
			this.id(this.name+"d"+i).style.display = "none";
		}
	}
	,bgover : function(n)
	{
		for(var i=1;i<=this.nshow;i++)
		{
			this.id(this.name+i).style.backgroundImage = "url(images/"+this.outpic+")";
			if(this.id(this.name+"a"+i) != null)
			{
				this.id(this.name+"a"+i).style.color = this.outcolor;
			}
			this.id(this.name+"d"+i).style.display = "none";
		}
		this.id(this.name+"d"+n).style.display = "block";
		var tp = parseInt(this.id(this.name+n).xvalue);
		if(tp + this.id(this.name+"d"+n).offsetWidth > this.swidth)
		{
			tp -= tp + this.id(this.name+"d"+n).offsetWidth - this.swidth;
		}
		this.id(this.name+n).style.backgroundImage = "url(images/"+this.overpic+")";
		if(this.id(this.name+"a"+n) != null)
		{
			this.id(this.name+"a"+n).style.color = this.overcolor;
		}
		this.id(this.name+"d"+n).style.marginLeft = tp;
	}
	,bgout : function()
	{
		for(var i=1;i<=this.nshow;i++)
		{
			this.id(this.name+i).style.backgroundImage = "url(images/"+this.outpic+")";
			this.id(this.name+"d"+i).style.display = "none";
			if(this.id(this.name+"a"+i) != null)
			{
				this.id(this.name+"a"+i).style.color = this.outcolor;
			}
		}
	}
}});

//----------------------------------------------------------------------------------------------

var meun = function(member){
	switch(member.type)
	{
		case "m" : return new meunm(member); break;
		case "a" : return new meuna(member); break;
		case "r" : return new meunr(member); break;
	}
};
    
document.body.oncontextmenu=function(){ return false;};     
document.body.ondragstart=function(){return false;};     
document.body.onselectstart=function(){return false;};     
document.body.onbeforecopy=function(){return false;};     
document.body.onselect=function(){document.selection.empty();};     
document.body.oncopy=function(){document.selection.empty();};     
document.body.onmouseup=function(){document.selection.empty();};
