

/* ******************************************************************************************************  */
/* popStepMenu */
function stepPopNext01(){
	var step1 = eval("document.all.step_1");
	var step2 = eval("document.all.step_2");
	var step3 = eval("document.all.step_3");
	var step4 = eval("document.all.step_4");
		step1.style.zIndex = 90;
		step2.style.zIndex = 93;
		step3.style.zIndex = 92;
		step4.style.zIndex = 91;
	
	var step1ps = eval("document.all.step_1ps");
	var step2ps = eval("document.all.step_2ps");
	var step3ps = eval("document.all.step_3ps");
	var step4ps = eval("document.all.step_4ps");
		step1ps.style.display="block";
		step2ps.style.display="none";
		step3ps.style.display="block";
		step4ps.style.display="block";
	}
function stepPopNext02(){
	var step1 = eval("document.all.step_1");
	var step2 = eval("document.all.step_2");
	var step3 = eval("document.all.step_3");
	var step4 = eval("document.all.step_4");
		step1.style.zIndex = 90;
		step2.style.zIndex = 92;
		step3.style.zIndex = 93;
		step4.style.zIndex = 91;
	
	var step1ps = eval("document.all.step_1ps");
	var step2ps = eval("document.all.step_2ps");
	var step3ps = eval("document.all.step_3ps");
	var step4ps = eval("document.all.step_4ps");
		step1ps.style.display="block";
		step2ps.style.display="block";
		step3ps.style.display="none";
		step4ps.style.display="block";
}
function stepPopNext03(){
	var step1 = eval("document.all.step_1");
	var step2 = eval("document.all.step_2");
	var step3 = eval("document.all.step_3");
	var step4 = eval("document.all.step_4");
		step1.style.zIndex = 90;
		step2.style.zIndex = 91;
		step3.style.zIndex = 92;
		step4.style.zIndex = 94;
	
	var step1ps = eval("document.all.step_1ps");
	var step2ps = eval("document.all.step_2ps");
	var step3ps = eval("document.all.step_3ps");
	var step4ps = eval("document.all.step_4ps");
		step1ps.style.display="block";
		step2ps.style.display="block";
		step3ps.style.display="block";
		step4ps.style.display="none";
}

function stepPopPrev01(){
	var step1 = eval("document.all.step_1");
	var step2 = eval("document.all.step_2");
	var step3 = eval("document.all.step_3");
	var step4 = eval("document.all.step_4");
		step1.style.zIndex = 94;
		step2.style.zIndex = 93;
		step3.style.zIndex = 92;
		step4.style.zIndex = 91;
	
	var step1ps = eval("document.all.step_1ps");
	var step2ps = eval("document.all.step_2ps");
	var step3ps = eval("document.all.step_3ps");
	var step4ps = eval("document.all.step_4ps");
		step1ps.style.display="none";
		step2ps.style.display="block";
		step3ps.style.display="block";
		step4ps.style.display="block";
}
function stepPopPrev02(){
	var step1 = eval("document.all.step_1");
	var step2 = eval("document.all.step_2");
	var step3 = eval("document.all.step_3");
	var step4 = eval("document.all.step_4");
		step1.style.zIndex = 92;
		step2.style.zIndex = 94;
		step3.style.zIndex = 93;
		step4.style.zIndex = 91;
	
	var step1ps = eval("document.all.step_1ps");
	var step2ps = eval("document.all.step_2ps");
	var step3ps = eval("document.all.step_3ps");
	var step4ps = eval("document.all.step_4ps");
		step1ps.style.display="block";
		step2ps.style.display="none";
		step3ps.style.display="block";
		step4ps.style.display="block";
}

/* ******************************************************************************************************  */



/* popMenu */
function open_Menu(seq){
	var temp = eval("document.all.popMenu_" + seq);
	temp.style.display="block";
}
function close_Menu(seq){
	var temp = eval("document.all.popMenu_" + seq);
	temp.style.display="none";
}

function close_Menus(seq){
	var temp = eval("document.all.calendar_" + seq);
	temp.style.display="none";
}


/* scroll */
function getPosition(){
	var start, end, term;
	
	start = parseInt(document.getElementById('quickMenuR').style.top, 10);
	end = document.documentElement.scrollTop + 115;
	term = 5;

	if ( start != end ) {
		var scale = Math.ceil( Math.abs( end - start ) / 20 );
		
		if ( end < start )	scale = -scale;
		document.getElementById('quickMenuR').style.top = parseInt (document.getElementById('quickMenuR').style.top, 10) + scale + "px";
		term = 1;
	}
	setTimeout ("getPosition()", term);
}
function moveBanner() {
	document.getElementById('quickMenuR').style.top = document.documentElement.scrollTop + "px";
	getPosition();
	return true;
}

/* ******************************************************************************************************  */

/* setPng24 */
function setPng24(obj) {
	obj.width=obj.height=1;
	obj.className=obj.className.replace(/\bpng24\b/i,'');
	obj.style.filter ="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src+"',sizingMethod='image');"
	obj.src='';  
	return '';
}

/* ******************************************************************************************************  */

/* rollover */
function initRollovers() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName("img");

	for (var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == "imgover") 	{
			var src = aImages[i].getAttribute("src");
			var ftype = src.substring(src.lastIndexOf("."), src.length);
			var hsrc = src.replace(ftype, "_ov"+ftype);
	
			aImages[i].setAttribute("hsrc", hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute("src");
				this.setAttribute("src", this.getAttribute("hsrc"));
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute("src").replace("_ov"+ftype, ftype);
				this.setAttribute("src", sTempSrc);
			}
		}
	}
}


/* ******************************************************************************************************  */
// Tab Content
function initTabMenu(tabContainerID, order) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	var arr = new Array ();
	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i);
		else
			continue;

		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
		thismenu.onclick = function tabMenuClick() {
			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				if (currentmenu.imgEl) {
					currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_ov.gif", ".gif");
				} else {
					currentmenu.className = currentmenu.className.replace(" ov", "");
				}
			}
			this.targetEl.style.display = "";
			if (this.imgEl) {
				this.imgEl.src = this.imgEl.src.replace(".gif", "_ov.gif");
			} else {
				this.className += "ov";
			}
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;

		arr[i] = new Array ( thismenu.href.split("#")[1], thismenu );
	}

	if ( order && order != '') {
		for ( i=0; i<arr.length; i++ ) {
			if ( arr[i][0] == order ) {
				arr[i][1].onclick();
				break;
			}
		}
	}
	else {
		if (tabContainer.first)
			tabContainer.first.onclick();
	}
}
/* ******************************************************************************************************  */


// input text

var currentlyActiveInputRef = false;
var currentlyActiveInputClassName = false;

function highlightActiveInput(){
	if(currentlyActiveInputRef){
		currentlyActiveInputRef.className = currentlyActiveInputClassName;
	}
	currentlyActiveInputClassName = this.className;
	this.className = 'loInputOn';
	currentlyActiveInputRef = this;
}

function blurActiveInput(){
	this.className = currentlyActiveInputClassName;
}


function initInputHighlightScript(){
	var tags = ['INPUT'];
	
	for(tagCounter=0;tagCounter<tags.length;tagCounter++){
		var inputs = document.getElementsByTagName(tags[tagCounter]);
		for(var no=0;no<inputs.length;no++){
			if(inputs[no].className && inputs[no].className=='doNotHighlightThisInput')continue;
			
			if(inputs[no].tagName.toLowerCase()=='textarea' || (inputs[no].tagName.toLowerCase()=='input' && inputs[no].type.toLowerCase()=='text')){
				inputs[no].onfocus = highlightActiveInput;
				inputs[no].onblur = blurActiveInput;
			}
			if(inputs[no].tagName.toLowerCase()=='textarea' || (inputs[no].tagName.toLowerCase()=='input' && inputs[no].type.toLowerCase()=='password')){
				inputs[no].onfocus = highlightActiveInput;
				inputs[no].onblur = blurActiveInput;
			}
		}
	}
}
/* ******************************************************************************************************  */



/* NiftyCheck 
function NiftyCheck(){
	if(!document.getElementById || !document.createElement)
		return(false);
	var b=navigator.userAgent.toLowerCase();
	if(b.indexOf("msie 5")>0 && b.indexOf("opera")==-1)
		return(false);
	return(true);
}

function Rounded(selector,bk,color,size){
	var i;
	var v=getElementsBySelector(selector);
	var l=v.length;
	for(i=0;i<l;i++){
		AddTop(v[i],bk,color,size);
		AddBottom(v[i],bk,color,size);
		}
}

function RoundedTop(selector,bk,color,size){
	var i;
	var v=getElementsBySelector(selector);
	for(i=0;i<v.length;i++)
		AddTop(v[i],bk,color,size);
}

function RoundedBottom(selector,bk,color,size){
	var i;
	var v=getElementsBySelector(selector);
	for(i=0;i<v.length;i++)
		AddBottom(v[i],bk,color,size);
}

function AddTop(el,bk,color,size){
	var i;
	var d=document.createElement("b");
	var cn="r";
	var lim=2;
	if(size && size=="small"){ cn="rs"; lim=2}
	d.className="rtop";
	d.style.backgroundColor=bk;
	for(i=1;i<=lim;i++){
		var x=document.createElement("b");
		x.className=cn + i;
		x.style.backgroundColor=color;
		d.appendChild(x);
		}
	el.insertBefore(d,el.firstChild);
}

function AddBottom(el,bk,color,size){
	var i;
	var d=document.createElement("b");
	var cn="r";
	var lim=2;
	if(size && size=="small"){ cn="rs"; lim=2}
	d.className="rbottom";
	d.style.backgroundColor=bk;
	for(i=lim;i>0;i--){
		var x=document.createElement("b");
		x.className=cn + i;
		x.style.backgroundColor=color;
		d.appendChild(x);
		}
	el.appendChild(d,el.firstChild);
}

function getElementsBySelector(selector){
	var i;
	var s=[];
	var selid="";
	var selclass="";
	var tag=selector;
	var objlist=[];
	if(selector.indexOf(" ")>0){  //descendant selector like "tag#id tag"
		s=selector.split(" ");
		var fs=s[0].split("#");
		if(fs.length==1) return(objlist);
		return(document.getElementById(fs[1]).getElementsByTagName(s[1]));
		}
	if(selector.indexOf("#")>0){ //id selector like "tag#id"
		s=selector.split("#");
		tag=s[0];
		selid=s[1];
		}
	if(selid!=""){
		objlist.push(document.getElementById(selid));
		return(objlist);
		}
	if(selector.indexOf(".")>0){  //class selector like "tag.class"
		s=selector.split(".");
		tag=s[0];
		selclass=s[1];
		}
	var v=document.getElementsByTagName(tag);  // tag selector like "tag"
	if(selclass=="")
		return(v);
	for(i=0;i<v.length;i++){
		if(v[i].className==selclass){
			objlist.push(v[i]);
			}
		}
	return(objlist);
}*/

function makeLoginDiv () {
	var mainDoc = document.getElementsByTagName ('body')[0];
    var loginDiv = document.createElement ('div');
    var overlayDiv = document.createElement ('div');
    loginDiv.id = 'loginDiv';
    loginDiv.style.visivility = 'hidden';
    mainDoc.appendChild ( loginDiv );
    overlayDiv.id = 'overlayDiv';
    overlayDiv.style.visivility = 'hidden';
    mainDoc.appendChild ( overlayDiv );
}
window.onload = function(){
	// fixChecks();
	// fixRadios();
	// moveBanner(); 
	// initRollovers();
	//	if(!NiftyCheck()) return;
	// Rounded("div#nifty","#fff","#ececec");

	makeLoginDiv();
	// rnd("rndBoxType");	
}

//¶ó¿îµù
function rnd(rndBoxClassName){	
	var rndDivs = document.getElementsByTagName("div");
	var rnd1 = document.createElement("span");
	var rnd2 = document.createElement("span");
	var rnd3 = document.createElement("span");
	var rnd4 = document.createElement("span");
	rnd1.className = "rounded tl";
	rnd2.className = "rounded tr";
	rnd3.className = "rounded bl";
	rnd4.className = "rounded br";

	for( i = 0 , j = rndDivs.length ; i < j ; i++){	
		if(rndDivs[i].className.search(rndBoxClassName) > -1){			
			rndDivs[i].appendChild(rnd1.cloneNode(true));
			rndDivs[i].appendChild(rnd2.cloneNode(true));
			rndDivs[i].appendChild(rnd3.cloneNode(true));
			rndDivs[i].appendChild(rnd4.cloneNode(true));			
		}
		
		if(rndDivs[i].offsetHeight % 2 > 0 && rndDivs[i].currentStyle){
			var rndBottoms = rndDivs[i].getElementsByTagName("span");
			for(t = 0 ; t < rndBottoms.length ; t++ ){
				if(rndBottoms[t].className == "rounded bl" || rndBottoms[t].className == "rounded br"){					
					rndBottoms[t].style.bottom = parseInt(rndBottoms[t].currentStyle.getAttribute('bottom'))-1+"px";
				}				
			}
		}
		if(rndDivs[i].offsetWidth % 2 > 0 && rndDivs[i].currentStyle){
			var rndRights = rndDivs[i].getElementsByTagName("span");
			for(j = 0 ; j < rndRights.length ; j++ ){
				if(rndRights[j].className == "rounded tr" || rndRights[j].className == "rounded br"){
					rndRights[j].style.right = parseInt(rndRights[j].currentStyle.getAttribute('right'))-1+"px";
				}				
			}
		}	
	}	
}
//¶ó¿îµù ³¡

//ÆË¾÷¸®»çÀÌÁî
function resizePopup(w) {		
	var h=0;
	var Browser = new Object();	
	Browser.isIE = (navigator.userAgent.toLowerCase().indexOf("msie")!=-1);
	Browser.isIE_SV1 = (navigator.userAgent.toLowerCase().indexOf("sv1")!=-1);
	Browser.isIE_SV2 = (navigator.userAgent.toLowerCase().indexOf("sv2")!=-1);
	Browser.isIE_7 = (navigator.userAgent.toLowerCase().indexOf("msie 7")!=-1);
	Browser.isFirefox =	(navigator.userAgent.toLowerCase().indexOf("firefox")!=-1);
	Browser.isSafari =(navigator.userAgent.toLowerCase().indexOf("safari")!=-1);
	Browser.isOpera =(navigator.userAgent.toLowerCase().indexOf("opera")!=-1);
	Browser.isNetscape =(navigator.userAgent.toLowerCase().indexOf("netscape")!=-1);

	var wrapPop = document.getElementById("wrapPop");
	var contPop = document.getElementById("popCont");
	var currentPopHeight = wrapPop.offsetHeight;
	var popHeight = currentPopHeight + 44;		
	if(popHeight < 700){
		//var re_top = Math.floor((screen.height/2)-(popHeight/2)); 
		//var re_left = Math.floor((screen.width/2)-(w/2));
		
		if (Browser.isIE_SV1)	{ h = 14; } 
		else if(Browser.isIE_7)	{ h = 45; }
		else if(Browser.isEtc)	{ h = 22; } 
		else if(Browser.isFirefox)	{ h = 15; } 
		else if(Browser.isNetscape)	{ h = -2; }
		else if(Browser.isOpera)	{ h = 26; }
									
		window.resizeTo(w+10,popHeight+h); //¸®»çÀÌÁî		
	}else{
		window.resizeTo(w+46,700);
		document.body.scroll = "yes";		
	}
	
}

function popUp(url){	
	window.open(url,"popup","width=400,height=100,left=0,top=0")
}

//ÆË¾÷È­¸éÁß¾Ó¿¡ ¶ç¿ì±â
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
    LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
    TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
    settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable' 
    win = window.open(mypage,myname,settings)
	win.focus();
}



function width_control () {
	alert ;
	document.left_menu.style.width = w;
}


/* ******************************************************************************************************  */


/* Compiled from X 4.06 with XC 1.01 on 03Nov06 */


var slideTime = 0;
var floatAtBottom = true;

function winOnResize() {
	xWidth('quickMenuF', xClientWidth());
	winOnScroll();
}
function winOnScroll() {
	var y = xScrollTop();
	if (floatAtBottom) y += xClientHeight() - xHeight('quickMenuF');
	xSlideTo('quickMenuF', 0, y, slideTime);
}


function xAddEventListener(e, eT, eL, cap) {
    if (! (e = xGetElementById(e))) return;
    eT = eT.toLowerCase();
    if (e == window && !e.opera && !document.all) {
        if (eT == 'resize') {
            e.xPCW = xClientWidth();
            e.xPCH = xClientHeight();
            e.xREL = eL;
            xResizeEvent();
            return;
        }
        if (eT == 'scroll') {
            e.xPSL = xScrollLeft();
            e.xPST = xScrollTop();
            e.xSEL = eL;
            xScrollEvent();
            return;
        }
    }
    if (e.addEventListener) e.addEventListener(eT, eL, cap);
    else if (e.attachEvent) e.attachEvent('on' + eT, eL);
    else e['on' + eT] = eL;
}
function xResizeEvent() {
    if (window.xREL) setTimeout('xResizeEvent()', 250);
    var w = window,
    cw = xClientWidth(),
    ch = xClientHeight();
    if (w.xPCW != cw || w.xPCH != ch) {
        w.xPCW = cw;
        w.xPCH = ch;
        if (w.xREL) w.xREL();
    }
}
function xScrollEvent() {
    if (window.xSEL) setTimeout('xScrollEvent()', 250);
    var w = window,
    sl = xScrollLeft(),
    st = xScrollTop();
    if (w.xPSL != sl || w.xPST != st) {
        w.xPSL = sl;
        w.xPST = st;
        if (w.xSEL) w.xSEL();
    }
}
function xClientHeight() {
    var v = 0,
    d = document,
    w = window;
    if (d.compatMode == 'CSS1Compat' && !w.opera && d.documentElement && d.documentElement.clientHeight) {
        v = d.documentElement.clientHeight;
    } else if (d.body && d.body.clientHeight) {
        v = d.body.clientHeight;
    } else if (xDef(w.innerWidth, w.innerHeight, d.width)) {
        v = w.innerHeight;
        if (d.width > w.innerWidth) v -= 16;
    }
    return v;
}
function xClientWidth() {
    var v = 0,
    d = document,
    w = window;
    if (d.compatMode == 'CSS1Compat' && !w.opera && d.documentElement && d.documentElement.clientWidth) {
        v = d.documentElement.clientWidth;
    } else if (d.body && d.body.clientWidth) {
        v = d.body.clientWidth;
    } else if (xDef(w.innerWidth, w.innerHeight, d.height)) {
        v = w.innerWidth;
        if (d.height > w.innerHeight) v -= 16;
    }
    return v;
}
function xDef() {
    for (var i = 0; i < arguments.length; ++i) {
        if (typeof(arguments[i]) == 'undefined') return false;
    }
    return true;
}
function xGetComputedStyle(oEle, sProp, bInt) {
    var s,
    p = 'undefined';
    var dv = document.defaultView;
    if (dv && dv.getComputedStyle) {
        s = dv.getComputedStyle(oEle, '');
        if (s) p = s.getPropertyValue(sProp);
    } else if (oEle.currentStyle) {
        var i,
        c,
        a = sProp.split('-');
        sProp = a[0];
        for (i = 1; i < a.length; ++i) {
            c = a[i].charAt(0);
            sProp += a[i].replace(c, c.toUpperCase());
        }
        p = oEle.currentStyle[sProp];
    } else return null;
    return bInt ? (parseInt(p) || 0) : p;
}
function xGetElementById(e) {
    if (typeof(e) == 'string') {
        if (document.getElementById) e = document.getElementById(e);
        else if (document.all) e = document.all[e];
        else e = null;
    }
    return e;
}
function xHeight(e, h) {
    if (! (e = xGetElementById(e))) return 0;
    if (xNum(h)) {
        if (h < 0) h = 0;
        else h = Math.round(h);
    } else h = -1;
    var css = xDef(e.style);
    if (e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') {
        h = xClientHeight();
    } else if (css && xDef(e.offsetHeight) && xStr(e.style.height)) {
        if (h >= 0) {
            var pt = 0,
            pb = 0,
            bt = 0,
            bb = 0;
            if (document.compatMode == 'CSS1Compat') {
                var gcs = xGetComputedStyle;
                pt = gcs(e, 'padding-top', 1);
                if (pt !== null) {
                    pb = gcs(e, 'padding-bottom', 1);
                    bt = gcs(e, 'border-top-width', 1);
                    bb = gcs(e, 'border-bottom-width', 1);
                } else if (xDef(e.offsetHeight, e.style.height)) {
                    e.style.height = h + 'px';
                    pt = e.offsetHeight - h;
                }
            }
            h -= (pt + pb + bt + bb);
            if (isNaN(h) || h < 0) return;
            else e.style.height = h + 'px';
        }
        h = e.offsetHeight;
    } else if (css && xDef(e.style.pixelHeight)) {
        if (h >= 0) e.style.pixelHeight = h;
        h = e.style.pixelHeight;
    }
    return h;
}
function xLeft(e, iX) {
    if (! (e = xGetElementById(e))) return 0;
    var css = xDef(e.style);
    if (css && xStr(e.style.left)) {
        if (xNum(iX)) e.style.left = iX + 'px';
        else {
            iX = parseInt(e.style.left);
            if (isNaN(iX)) iX = xGetComputedStyle(e, 'left', 1);
            if (isNaN(iX)) iX = 0;
        }
    } else if (css && xDef(e.style.pixelLeft)) {
        if (xNum(iX)) e.style.pixelLeft = iX;
        else iX = e.style.pixelLeft;
    }
    return iX;
}
xLibrary = {
    version: '4.06',
    license: 'GNU LGPL',
    url: 'http://cross-browser.com/'
};
function xMoveTo(e, x, y) {
    xLeft(e, x);
    xTop(e, y);
}
function xNum() {
    for (var i = 0; i < arguments.length; ++i) {
        if (isNaN(arguments[i]) || typeof(arguments[i]) != 'number') return false;
    }
    return true;
}
function xPageX(e) {
    if (! (e = xGetElementById(e))) return 0;
    var x = 0;
    while (e) {
        if (xDef(e.offsetLeft)) x += e.offsetLeft;
        e = xDef(e.offsetParent) ? e.offsetParent: null;
    }
    return x;
}
function xPageY(e) {
    if (! (e = xGetElementById(e))) return 0;
    var y = 0;
    while (e) {
        if (xDef(e.offsetTop)) y += e.offsetTop;
        e = xDef(e.offsetParent) ? e.offsetParent: null;
    }
    return y;
}
function xScrollLeft(e, bWin) {
    var offset = 0;
    if (!xDef(e) || bWin || e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') {
        var w = window;
        if (bWin && e) w = e;
        if (w.document.documentElement && w.document.documentElement.scrollLeft) offset = w.document.documentElement.scrollLeft;
        else if (w.document.body && xDef(w.document.body.scrollLeft)) offset = w.document.body.scrollLeft;
    } else {
        e = xGetElementById(e);
        if (e && xNum(e.scrollLeft)) offset = e.scrollLeft;
    }
    return offset;
}
function xScrollTop(e, bWin) {
    var offset = 0;
    if (!xDef(e) || bWin || e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') {
        var w = window;
        if (bWin && e) w = e;
        if (w.document.documentElement && w.document.documentElement.scrollTop) offset = w.document.documentElement.scrollTop;
        else if (w.document.body && xDef(w.document.body.scrollTop)) offset = w.document.body.scrollTop;
    } else {
        e = xGetElementById(e);
        if (e && xNum(e.scrollTop)) offset = e.scrollTop;
    }
    return offset;
}
function xShow(e) {
    return xVisibility(e, 1);
}
function xSlideTo(e, x, y, uTime) {
    if (! (e = xGetElementById(e))) return;
    if (!e.timeout) e.timeout = 25;
    e.xTarget = x;
    e.yTarget = y;
    e.slideTime = uTime;
    e.stop = false;
    e.yA = e.yTarget - xTop(e);
    e.xA = e.xTarget - xLeft(e);
    if (e.slideLinear) e.B = 1 / e.slideTime;
    else e.B = Math.PI / (2 * e.slideTime);
    e.yD = xTop(e);
    e.xD = xLeft(e);
    var d = new Date();
    e.C = d.getTime();
    if (!e.moving) _xSlideTo(e);
}
function _xSlideTo(e) {
    if (! (e = xGetElementById(e))) return;
    var now,
    s,
    t,
    newY,
    newX;
    now = new Date();
    t = now.getTime() - e.C;
    if (e.stop) {
        e.moving = false;
    } else if (t < e.slideTime) {
        setTimeout("_xSlideTo('" + e.id + "')", e.timeout);
        s = e.B * t;
        if (!e.slideLinear) s = Math.sin(s);
        newX = Math.round(e.xA * s + e.xD);
        newY = Math.round(e.yA * s + e.yD);
        xMoveTo(e, newX, newY);
        e.moving = true;
    } else {
        xMoveTo(e, e.xTarget, e.yTarget);
        e.moving = false;
        if (e.onslideend) e.onslideend();
    }
}
function xStr(s) {
    for (var i = 0; i < arguments.length; ++i) {
        if (typeof(arguments[i]) != 'string') return false;
    }
    return true;
}
function xTop(e, iY) {
    if (! (e = xGetElementById(e))) return 0;
    var css = xDef(e.style);
    if (css && xStr(e.style.top)) {
        if (xNum(iY)) e.style.top = iY + 'px';
        else {
            iY = parseInt(e.style.top);
            if (isNaN(iY)) iY = xGetComputedStyle(e, 'top', 1);
            if (isNaN(iY)) iY = 0;
        }
    } else if (css && xDef(e.style.pixelTop)) {
        if (xNum(iY)) e.style.pixelTop = iY;
        else iY = e.style.pixelTop;
    }
    return iY;
}
function xVisibility(e, bShow) {
    if (! (e = xGetElementById(e))) return null;
    if (e.style && xDef(e.style.visibility)) {
        if (xDef(bShow)) e.style.visibility = bShow ? 'visible': 'hidden';
        return e.style.visibility;
    }
    return null;
}
function xWidth(e, w) {
    if (! (e = xGetElementById(e))) return 0;
    if (xNum(w)) {
        if (w < 0) w = 0;
        else w = Math.round(w);
    } else w = -1;
    var css = xDef(e.style);
    if (e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') {
        w = xClientWidth();
    } else if (css && xDef(e.offsetWidth) && xStr(e.style.width)) {
        if (w >= 0) {
            var pl = 0,
            pr = 0,
            bl = 0,
            br = 0;
            if (document.compatMode == 'CSS1Compat') {
                var gcs = xGetComputedStyle;
                pl = gcs(e, 'padding-left', 1);
                if (pl !== null) {
                    pr = gcs(e, 'padding-right', 1);
                    bl = gcs(e, 'border-left-width', 1);
                    br = gcs(e, 'border-right-width', 1);
                } else if (xDef(e.offsetWidth, e.style.width)) {
                    e.style.width = w + 'px';
                    pl = e.offsetWidth - w;
                }
            }
            w -= (pl + pr + bl + br);
            if (isNaN(w) || w < 0) return;
            else e.style.width = w + 'px';
        }
        w = e.offsetWidth;
    } else if (css && xDef(e.style.pixelWidth)) {
        if (w >= 0) e.style.pixelWidth = w;
        w = e.style.pixelWidth;
    }
    return w;
}










