// JavaScript Document
var colors;
function init(c) {
	colors = c;
	var colArr = new Array('blue','pink','green','orange');
	for(i=0;i<4;i++) { 
		bimg = document.getElementById('i'+colArr[i]);
		if(colArr[i]=='blue') { 
			bimg.src = bimg.imgFrom = 'img/blue_small_'+colors+'.gif';
			bimg.imgTo = 'img/blue_small-on_'+colors+'.gif';
		} else { 
			bimg.src = bimg.imgFrom = 'img/'+colArr[i]+'_small.gif';
			bimg.imgTo = 'img/'+colArr[i]+'_small-on.gif';
		}
		bimg.txtId = "d"+colArr[i];
		bimg.parentNode.t = bimg;
		bimg.parentNode.onmouseover = function () { shLayer(this.t.txtId); this.t.src = this.t.imgTo; }
		bimg.parentNode.onmouseout = function () { shLayer(this.t.txtId); this.t.src = this.t.imgFrom; }
	}
	preload('img/blue_small-on_'+colors+'.gif','img/pink_small-on.gif','img/green_small-on.gif','img/orange_small-on.gif');
	if(headList = document.getElementById('hList')) {
		orList=document.getElementById('aList');
		d = document.createElement('div');
		d.className = "back_"+colors;
		d.style.top = d.style.left = "-500px";
		d.innerHTML = orList.innerHTML;
		orList.innerHTML = "";
		orList.removeNode();
		orList = null;
		d.id = "aList";
		d.style.display = "block";
		tmp = document.body.appendChild(d);
		headList.d = tmp;
		headList.onmouseover = function() { 
			var sc = getScreenSize();
			if (this.d.filters) this.d.style.filter = "alpha(opacity=92)"; 
			else this.d.style.opacity = 0.92;
			if(this.d.offsetWidth>sc[0]/2) this.d.style.width = (sc[0]/2)+"px";
			if((this.d.offsetHeight+(this.offsetTop+this.offsetHeight+12))>sc[1]) this.d.style.top =sc[1]-this.d.offsetHeight+"px";
			else this.d.style.top = this.offsetTop+this.offsetHeight+12+"px";
			this.d.style.left = this.offsetLeft+this.offsetWidth+"px";
		}	
		headList.onmouseout = function() { this.d.style.top = this.d.style.left = "-500px"; }
		headList.style.cursor = "help";
		headList.style.textDecoration = "underline";
	}
	pResize();
	window.onresize=pResize;
}
function init_i() {
	preload('img/blue_bigmenu-on.jpg','img/pink_bigmenu-on.jpg','img/green_bigmenu-on.jpg','img/orange_bigmenu-on.jpg');
	iResize();
	window.onresize=iResize;
}
function iResize() {
	d = document.getElementById("menu");
	t = document.getElementById("topleft");
	d.style.display="block";
	d.style.top = (t.offsetHeight-111)+"px";
	d.style.left = (t.offsetWidth-133)+"px";
}
function pResize() {
	d = document.getElementById("menu");
	t = document.getElementById("topleft");
	sc=getScreenSize();
	t.style.height=(sc[1]/2)+"px";
	d.style.display="block";
	d.style.top = (t.offsetHeight-25)+"px";
	d.style.left = (t.offsetWidth-32)+"px";
	if(a = document.getElementById('aList')) {
		//a.style.width = (sc[0]/2)+"px";
	}
}
function sLayer(id) {
	d = document.getElementById(id);
	if(d.style.visibility=="visible") d.style.visibility="hidden";
	else d.style.visibility="visible";
}
function shLayer(id) {
	d = document.getElementById(id);
	if(d.style.display=="block") d.style.display="none";
	else d.style.display="block";
}
function preload()
{ 
  var args = preload.arguments;
  document.imageArray = new Array(args.length);
  for(var i=0; i<args.length; i++)
  {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = args[i];
  }
}
function sImg(imgName, imgSrc) {
  if (document.images) { if (imgSrc != "none") document.images[imgName].src = imgSrc; }
}
function getScreenSize() {
	var bbx,bby;
	if (self.innerHeight)
	{
		bbx = self.innerWidth;
		bby = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
	{
		bbx = document.documentElement.clientWidth;
		bby = document.documentElement.clientHeight;
	}
	else if (document.body)
	{
		bbx = document.body.clientWidth;
		bby = document.body.clientHeight;
	}
	return Array(bbx,bby);
}
if(!document.removeNode && !HTMLElement.removeNode) {
	HTMLElement.prototype.removeNode = function() {
		this.parentNode.removeChild(this);
	}
}