




function showele(ele) {
	if(typeof(ele)=='string') ele=document.getElementById(ele);
	ele.style.display="block";/*ele.style.display="";*/ ele.style.visibility="visible";
}
function hideele(ele) {
	if(typeof(ele)=='string') ele=document.getElementById(ele);
	ele.style.visibility="hidden"; ele.style.display="none";
}
function iselevisible(ele) {
	if(typeof(ele)=='string') ele=document.getElementById(ele);
	if (ele.style.display=="none"||ele.style.visibility=="hidden") return false;
	else return true;
}





function geteleabsxv1(eleid) {
	var ele=document.getElementById(eleid);
	if (document.getBoxObjectFor) return document.getBoxObjectFor(ele).x;
	else return ele.getBoundingClientRect().left;
}
function geteleabsyv1(eleid) {
	var ele=document.getElementById(eleid);
	if (document.getBoxObjectFor) return document.getBoxObjectFor(ele).y;
	else return ele.getBoundingClientRect().top;
}
function geteleabsxv2(elemID) {
    var offsetTrail = document.getElementById(elemID);
    var offsetLeft = 0;
    while (offsetTrail) {
        offsetLeft += offsetTrail.offsetLeft;
        if (offsetTrail.scrollLeft) offsetLeft-=offsetTrail.scrollLeft;
        offsetTrail = offsetTrail.offsetParent;
    }
    if (navigator.userAgent.indexOf("Mac") != -1 && 
        typeof document.body.leftMargin != "undefined") {
        offsetLeft += document.body.leftMargin;
    }
    return offsetLeft;
}
function geteleabsyv2(elemID) {
    var offsetTrail = document.getElementById(elemID);
    var offsetTop = 0;
    while (offsetTrail) {
        offsetTop += offsetTrail.offsetTop;
        if (offsetTrail.scrollTop) offsetTop-=offsetTrail.scrollTop;
        offsetTrail = offsetTrail.offsetParent;
    }
    if (navigator.userAgent.indexOf("Mac") != -1 && 
        typeof document.body.leftMargin != "undefined") {
        offsetTop += document.body.topMargin;
    }
	return offsetTop;
}
function geteleabsxv3(eleid) {
	var oElement=document.getElementById(eleid);
	if( typeof( oElement.offsetParent ) != 'undefined' ) {
		var originalElement = oElement;
		for( var posX = 0; oElement; oElement = oElement.offsetParent ) {
			posX += oElement.offsetLeft;
			if( oElement != originalElement && oElement != document.body && oElement != document.documentElement ) { posX -= oElement.scrollLeft; }
		}
		return posX;
	} else { return oElement.x; }
}
function geteleabsyv3(eleid) {
	var oElement=document.getElementById(eleid);
	if( typeof( oElement.offsetParent ) != 'undefined' ) {
		var originalElement = oElement;
		for( var posY = 0; oElement; oElement = oElement.offsetParent ) {
			posY += oElement.offsetTop;
			if( oElement != originalElement && oElement != document.body && oElement != document.documentElement ) { posY -= oElement.scrollTop; }
		}
		return posY;
	} else { return oElement.y; }
}
function geteleabsx(ele) {
	var oElement=(typeof(ele)=='string')?document.getElementById(ele):ele;
	if( typeof( oElement.offsetParent ) != 'undefined' ) {
		var originalElement = oElement;
		for( var posX = 0; oElement; oElement = oElement.offsetParent ) { posX += oElement.offsetLeft; }
		if( !originalElement.parentNode || !originalElement.style || typeof( originalElement.scrollLeft ) == 'undefined' ) { /*older browsers cannot check element scrolling*/ return posX; }
		oElement = getNextAncestor(originalElement);
		while( oElement && oElement != document.body && oElement != document.documentElement ) {
			posX -= oElement.scrollLeft;
			oElement = getNextAncestor(oElement);
		}
		return posX;
	} else { return oElement.x; }
}
function geteleabsy(ele) {
	var oElement=(typeof(ele)=='string')?document.getElementById(ele):ele;
	if( typeof( oElement.offsetParent ) != 'undefined' ) {
		var originalElement = oElement;
		for( var posY = 0; oElement; oElement = oElement.offsetParent ) { posY += oElement.offsetTop; }
		if( !originalElement.parentNode || !originalElement.style || typeof( originalElement.scrollTop ) == 'undefined' ) { /*older browsers cannot check element scrolling*/ return posY; }
		oElement = getNextAncestor(originalElement);
		while( oElement && oElement != document.body && oElement != document.documentElement ) {
			posY -= oElement.scrollTop;
			oElement = getNextAncestor(oElement);
		}
		return posY;
	} else { return oElement.y; }
}
function getNextAncestor( oElement ) {
	var actualStyle;
	if( window.getComputedStyle ) { actualStyle = getComputedStyle(oElement,null).position; }
	else if( oElement.currentStyle ) { actualStyle = oElement.currentStyle.position; }
	//fallback for browsers with low support - only reliable for inline styles
	else { actualStyle = oElement.style.position; }
	//the offsetParent of a fixed position element is null so it will stop
	if( actualStyle == 'absolute' || actualStyle == 'fixed' ) { return oElement.offsetParent; }
	return oElement.parentNode;
}





function getelex(ele) {
	if(typeof(ele)=='string') ele=document.getElementById(ele);
	return parseInt(ele.style.left);
}
function geteley(ele) {
	if(typeof(ele)=='string') ele=document.getElementById(ele);
	return parseInt(ele.style.top);
}
function setelex(ele,x) {
	if(typeof(ele)=='string') ele=document.getElementById(ele);
	if(isNaN(x)) ele.style.left=x;
	else ele.style.left=Math.round(x)+'px';
}
function seteley(ele,y) {
	if(typeof(ele)=='string') ele=document.getElementById(ele);
	if(isNaN(y)) ele.style.top=y;
	else ele.style.top=Math.round(y)+'px';
}





function getelew(ele) {
	if(typeof(ele)=='string') ele=document.getElementById(ele);
	return ele.offsetWidth;
}
function geteleh(ele) {
	if(typeof(ele)=='string') ele=document.getElementById(ele);
	return ele.offsetHeight;
}
function setelew(ele,w) {
	if(typeof(ele)=='string') ele=document.getElementById(ele);
	if(isNaN(w)) ele.style.width=w;
	else if(w>=0) {
		ele.style.width=Math.round(w)+'px';
		if (isie()&&w==0) ele.style.visibility='hidden';
	}
}
function seteleh(ele,h) {
	if(typeof(ele)=='string') ele=document.getElementById(ele);
	if(isNaN(h)) ele.style.height=h;
	else if(h>=0) {
		ele.style.height=Math.round(h)+'px';
		if (isie()&&h==0) ele.style.visibility='hidden';
	}
}





function getelealpha(ele) {
	if(typeof(ele)=='string') ele=document.getElementById(ele);
	if(typeof(ele.style.filter)!='undefined') {
		if(typeof(ele.filters.alpha)=='undefined') ele.style.filter='alpha(opacity=100)';
		return +(ele.filters.alpha.opacity);
	} else if(typeof(ele.style.opacity)!='undefined') return ele.style.opacity*100;
	else if(typeof(ele.style.MozOpacity)!='undefined') return ele.style.MozOpacity*100;
}
function setelealpha(ele,alpha) {
	if (alpha<0) return;
	if(typeof(ele)=='string') ele=document.getElementById(ele);
	if(typeof(ele.style.filter)!='undefined') {
		if(typeof(ele.filters.alpha)=='undefined') ele.style.filter='alpha(opacity='+alpha+')';
		else ele.filters.alpha.opacity=alpha;
	} else if(typeof(ele.style.opacity)!='undefined') ele.style.opacity=alpha/100;
	else if(typeof(ele.style.MozOpacity)!='undefined') ele.style.MozOpacity=alpha/100;
}





function getscreenw() {
	var winW=0;
	if (parseInt(navigator.appVersion)>3) {
		if (navigator.appName=="Netscape") { winW = window.innerWidth-16; }
		if (navigator.appName.indexOf("Microsoft")!=-1) { winW = document.body.offsetWidth-20; }
	}
	return winW;
}
function getscreenh() {
	var winH=0;
	if (parseInt(navigator.appVersion)>3) {
		if (navigator.appName=="Netscape") { winH = window.innerHeight-16; }
		if (navigator.appName.indexOf("Microsoft")!=-1) { winH = document.body.offsetHeight-20; }
	}
	return winH;
}
function getscreenx0() {
	return document.body.scrollLeft;
}
function getscreeny0() {
	return document.body.scrollTop;
}
function getscreenctx() {
	return document.body.scrollLeft+(getscreenw()/2);
}
function getscreencty() {
	return document.body.scrollTop+(getscreenh()/2);
}






function fixdivdim(divele,w,h,oflow) {
	if(typeof(divele)=='string') divele=document.getElementById(divele);
	setelew(divele,w);
	seteleh(divele,h);
	divele.style.overflow=oflow;
}





function setfinger(ele) {
	if(typeof(ele)=='string') ele=document.getElementById(ele);
	addevent(ele,'mouseover',function(){this.style.cursor='pointer';});
}





