function dSwich(n,m) {
	if (m) {
		document.getElementById('pData'+n).style.display ='none';
		document.getElementById('pDataInput'+n).style.display='';
	} else {
		document.getElementById('pData'+n).style.display ='block';
		document.getElementById('pDataInput'+n).style.display='none';
	}
}

function chMen(n,m) {
	if (m) {
		document.getElementById('men_'+n).style.width = '31px';
		document.getElementById('men_'+n).style.height = '31px';
		document.getElementById('men_'+n).style.border = '0px solid #555';
		// if (document.getElementById('menA_'+n)) document.getElementById('menA_'+n).style.color = '';
		if (document.getElementById('menA_'+n)) document.getElementById('menA_'+n).style.fontWeight = '';
		window.clearTimeout(growth[n].timer);
		growth[n].style.left = growth[n].origLeft+'px';
		growth[n].style.top = growth[n].origTop+'px';
		growth[n].style.zIndex = 5;
		growth[n].counter = 0;
		setOpacity(growth[n],10);
	}	else {
		document.getElementById('men_'+n).style.width = '27px';
		document.getElementById('men_'+n).style.height = '27px';
		document.getElementById('men_'+n).style.border = '2px solid #555';
		// if (document.getElementById('menA_'+n)) document.getElementById('menA_'+n).style.color = '#999';
		if (document.getElementById('menA_'+n)) document.getElementById('menA_'+n).style.fontWeight = 'bold';
		growBox(n);
	}
}
var growth = Array();
var pixLink = new Object();
var icoLink = new Object();


function chPix() {
	if (document.getElementById('gImage')) obj = document.getElementById('gImage'); else return;
	if (obj.id=='gImage') pixLink = obj; else icoLink = obj;
	if (!obj.transp) obj.transp = 10;
	obj.transp -= 1;
	if (obj.transp > 0) {
		setOpacity(obj,obj.transp-1);
		if (obj.id=='gImage') window.setTimeout('chPix(pixLink)',20); else window.setTimeout('chPix(icoLink)',20);
		return false;
	}	else window.location.href = pixLink.parentNode.href;
}

var ua = navigator.userAgent.toLowerCase();
var isIE = (ua.indexOf('msie') != -1 && (ua.indexOf('webtv') == -1) ); 

function shPix(obj) {
	if (obj.id=='gImage') pixLink = obj; else icoLink = obj;
	if (!obj.id) obj = document.getElementById('gImage');
	obj.style.visibility = 'visible';
	
		var shs = new OpacityTween(obj,Tween.regularEaseOut, 0, 100, 0.5);
		shs.start();
}

function growBox (n) {
	var obj = document.getElementById('men_'+n);
	obj.style.position = "absolute";
	obj.style.zIndex = 10;
	
	if (!growth[n]) {
		obj.origLeft = obj.offsetLeft;
		obj.origTop = obj.offsetTop;
		obj.counter = 0;
	}
	obj.counter += 10;
	if (obj.style.left) obj.theX = obj.style.left.replace(/px/,'')*1; else obj.theX = obj.origLeft;
	if (obj.style.top) obj.theY = obj.style.top.replace(/px/,'')*1; else obj.theY = obj.origTop;
	obj.w = obj.style.width.replace(/px/,'');
	obj.h = obj.style.height.replace(/px/,'');
	
	obj.style.width = obj.w*1+2+'px';
	obj.style.height = obj.h*1+2+'px';
	obj.style.left = (obj.theX*1-1)+'px';
	obj.style.top = (obj.theY*1-1)+'px';
	if (obj.counter < 100) obj.timer = window.setTimeout('growBox('+n+')',(obj.w*5)/7);
	if (obj.counter < 100) setOpacity(obj,(100-obj.counter)/10); else {
		obj.style.width = '27px';
		obj.style.height = '27px';
		obj.style.left = growth[n].origLeft+'px';
		obj.style.top = growth[n].origTop+'px';
		obj.style.zIndex = 5;
		// setOpacity(obj,10);
		obj.transp = 0;
		shPix(obj);
		growth[n].counter = 0;
	}
	growth[n] = obj;
}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		do {
				curleft += obj.offsetLeft;
				curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
		return [curleft,curtop];
	}
}

function getPos(theObj){
  x = y = 0;
  h = theObj.offsetHeight;
  w = theObj.offsetWidth;
  while(theObj){
    x += theObj.offsetLeft;
    y += theObj.offsetTop;
    theObj = theObj.offsetParent;
  }
  return {height:h,width:w,x:x,y:y}
}


