/* © 2007, Uranium Design
   www.uraniumdesign.com */

function xGetObject(_o)
{ return (typeof(_o)!='object')? xFindObject(String(_o)) : _o;}
function xFindObject(n, d)
{ var p,i,x; if(!d) d=document; if((p=n.indexOf("@"))>0&&parent.frames.length)
{ d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=xFindObject(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x;}
function trimStyle(vStyle) { if(vStyle=="") return 0; var sV=vStyle; var iPx = vStyle.indexOf("px"); if(iPx>-1) sV=vStyle.substring(0,iPx); return(parseInt(sV));}
function xGetTarget(xTarget)
{ var xLV1; if(document.all && document.getElementById) xLV1 = document.all[xTarget]; if(document.layers) xLV1 = document.layers[xTarget]; if(document.addEventListener) xLV1 = document.getElementById(xTarget); return xLV1;}
function xGetPosition(xTarget,xProp)
{ var xLV1; if(xProp=='offsetLeft'){(!(document.layers))? xLV1 = xTarget.offsetLeft : xLV1 = xTarget.pageX;}
if(xProp=='offsetTop'){(!(document.layers))? xLV1 = xTarget.offsetTop : xLV1 = xTargetpageY;}
return xLV1;}
function xSetPosition(xTarget,xLeft,xTop)
{ (!(document.layers))? xTarget.style.left = xLeft+'px' : xTarget['left'] = xLeft; (!(document.layers))? xTarget.style.top = xTop+'px' : xTarget['top'] = xTop;}
function xSetVisibility(xTarget,xValue) { (!(document.layers))? xTarget.style.visibility = xValue : xTarget['visibility'] = xValue;}
function xSetDisplay(xTarget,xValue) { (!(document.layers))? xTarget.style.display = xValue : xTarget['display'] = xValue;}
function xSetSize(xTarget,xWidth,xHeight)
{ if (typeof(_o)!='object') xTarget=xGetObject(xTarget); if (xWidth!=null) (!(document.layers))? xTarget.style.width = xWidth+'px' : xTarget['width'] = xWidth; if (xHeight!=null) (!(document.layers))? xTarget.style.height = xHeight+'px' : xTarget['height'] = xHeight;}
function xGetNumByName(xString,xName)
{ var xRegExp = new RegExp("^"+xName, "i")
var xNum = xString.replace(xRegExp,""); return xNum;}
function xGetNumBySep(xString)
{ return xString.substr(xString.indexOf('_')+1,xString.length-1);}
function xGetNameBySep(xString)
{ return xString.substr(0,xString.indexOf('_'));}
function xPand(xTarget,xValue) { if (typeof(xTarget) == "string") { xTargetName = xTarget; xIcon = xGetTarget(xTargetName+"_i"); xTarget = xGetTarget(xTarget);} else { xRef = xTarget; xTargetName = xRef.id; xIcon = xGetTarget(xTargetName+"_i"); xTarget = xGetTarget(xTargetName+"_c");}
if (xValue && typeof(xTarget) == "object") { switch (xValue) { case 0: xTarget.style.display = "none";xTarget.xOpened = 0;break; case 1: xTarget.style.display = "block";xTarget.xOpened = 1;break;}
} else { if (xTarget.xOpened && typeof(xTarget) == "object") { if (xTarget.xOpened == 1) { xTarget.style.display = "none"; xTarget.xOpened = 0;} else { xTarget.style.display = "block"; xTarget.xOpened = 1;}
} else if (typeof(xTarget) == "object") { xTarget.style.display = "block"; xTarget.xOpened = 1; if (xIcon) xIcon.oSrc = xIcon.src;}
}
if (xIcon && typeof(xTarget) == "object") { if (!xIcon.oSrc) xIcon.oSrc = xIcon.src; if (xTarget.xOpened == 1) { xSep = xIcon.oSrc.indexOf(".jpg"); if (xSep < 0) xSep = xIcon.oSrc.indexOf(".gif"); if (xSep > 0) { xIcon.src = xIcon.oSrc.substr(0,xSep) + "_a" + xIcon.oSrc.substr(xSep,xIcon.oSrc.length);}
} else { xIcon.src = xIcon.oSrc;}
}
}
function xPandInit() {}
var xRegisteredImages = new Array(); function xRegImg(i) { xRegisteredImages.xPush(i);}
function xInitImgPreload() { var _a = xRegisteredImages; for(var i =0;i<=_a.length-1;i++)
{ var _o = _a[i]; if(typeof(_o)=='string') _o = xGetObject(_o); MM_preloadImages(xGetImgRollOverImg(_o.src));}
}
function xGetImgRollOverImg(s) { var _e = xGetImgExtention(s); var _i = xImgTrimExtention(s,_e); return _i+"_o"+_e;}
function xGetImgExtention(s) { return s.substr(s.lastIndexOf('.'), s.length-1);}
function xImgTrimExtention(s,e) { return s.substring(0,s.indexOf(e));}
function xGetImgName(s) { return s.substr(s.lastIndexOf('/')+1,s.length-1);}
function getFileName(xFile) { var tabFile = new Array(); var foundFileStart = false; var foundFileType = false; for (i=xFile.length;i>0;i--) { if (xFile.charAt(i) == "." && foundFileType == false) { foundFileType = true; var indexFileType = i+1;} else if (xFile.charAt(i) == "/" && foundFileStart == false) { foundFileStart = true; var indexFileStart = i+1;}
}
tabFile["xFileType"] = xFile.substr(indexFileType,xFile.length); tabFile["xFileName"] = xFile.substring(indexFileStart,indexFileType-1); tabFile["xFilePath"] = xFile.substring(0,indexFileStart); return(tabFile);}
function xMouseOver(xImg) { if (typeof(xImg) == "string") { xImg = document.images[xImg]; if (!xImg) xImg = xGetObject(xImg); if (!xImg || xImg == null) return false;}
if(xImg.src.indexOf('_o.')!=-1) return false; if(xImg.src.indexOf('_a.')!=-1) return false; var tabFile = getFileName(xImg.src); xImg.oSrc = tabFile["xFilePath"]+tabFile["xFileName"]+"."+tabFile["xFileType"]; xImg.src = tabFile["xFilePath"]+tabFile["xFileName"]+"_o."+tabFile["xFileType"]; return true;}
function xMouseOut(xImg) { if (typeof(xImg) == "string") { xImg = document.images[xImg]; if (!xImg) xImg = xGetObject(xImg); if (!xImg || xImg == null) return false;}
if(xImg.src.indexOf('_a.')!=-1) return false; if (xImg.oSrc) xImg.src = xImg.oSrc; return true;}
function xClassOver(xObject) { if (typeof(xObject) == "string") xObject = document.getElementById(xObject); if (!xObject || xObject == null) xObject = xGetObject(xObject); if (!xObject || xObject == null) return false; var xClassName = xObject.className; if(xClassName.indexOf('_o.')!=-1) return; xObject.xOldClassName = xClassName; xObject.className=xClassName+'_o'; return true;}
function xClassOut(xObject) { if (typeof(xObject) == "string") xObject = document.getElementById(xObject); if (!xObject || xObject == null) xObject = xGetObject(xObject); if (!xObject || xObject == null) return false; xObject.className=xObject.xOldClassName; return true;}
Array.prototype.xPush = function(v)
{ this[this.length] = v;}; Array.prototype.xSearchInArray = function(v)
{ var a = false
for (var i=0; i<this.length;i++) if(this[i] == v) a = true; return a;}; Array.prototype.xSplice = function(v)
{ var a = new Array(); for (var i=0; i<this.length;i++) if(this[i]!=v) a.xPush(this[i]); return a;}; function xExecuteArray(_a) { var _l = _a.length-1; if(_l!=-1) { for(var i = 0; i<=_l;i++)
{ var _s = _a[i]; var _l0 = _s.indexOf("["); var _l1 = _s.indexOf("]"); (_l0!=-1 && _l1!=-1)? eval(_s.substring(_l0+1,_l1)) : eval(_s);}
}
}
var xWin = null; function xPopup(xPage,xWidth,xHeight,xWinName,xLeft,xTop,xFeatures){ var xWinLeft; var xWinTop; (xLeft!=null)?xWinLeft=xLeft : xWinLeft=(screen.width-xWidth)/2; (xTop!=null)?xWinTop=xTop : xWinTop=(screen.height-xHeight)/2; xSettings='width='+xWidth+',height='+xHeight+',top='+xWinTop+',left='+xWinLeft+','+xFeatures+''; xWin=window.open(xPage,xWinName,xSettings); if(xWin!=null || xWin != undefined){ xWin.xParent = self; if(parseInt(navigator.appVersion) >= 4){xWin.window.focus();}
}
}
function xResizeWindow(xWidth,xHeight) { var NS = (navigator.appName=="Netscape")?true:false; xCurrentWidth = (NS)?window.innerWidth:document.body.clientWidth; xCurrentHeight = (NS)?window.innerHeight:document.body.clientHeight; self.resizeBy(xWidth-xCurrentWidth, xHeight-xCurrentHeight); self.focus();}
function xCenterWindow(xWidth,xHeight) { xWinLeft=(screen.width-xWidth)/2; xWinTop=(screen.height-xHeight)/2; window.moveTo(xWinLeft,xWinTop);}
function xCheckIfCookieEnable(){ var cookieEnabled=(navigator.cookieEnabled)? true : false; if (navigator.cookieEnabled=="undefined" && navigator.cookieEnabled==false){ xSetCookie("xHKTCook","xSet",1); cookieEnabled=(document.cookie=="xHKTCook")? true : false; xEraseCookie("xHKTCook");}
return cookieEnabled;}
function xSetCookie(xName,xValue,xDays) { var xDate = new Date(); var xExpires = new Date(xDate.getTime() + xDays * 24 * 60 * 60 * 1000); document.cookie=xName + "=" + xValue + "; expires=" + xExpires.toGMTString();}
function xGetCookie (CookieName) { var lf = "\n"; var CookieString = document.cookie; var CookieSet = CookieString.split (';'); var SetSize = CookieSet.length; var CookiePieces; var xReturnValue = ""; var x = 0; for (x = 0; ((x < SetSize) && (xReturnValue == "")); x++) { CookiePieces = CookieSet[x].split ('='); if (CookiePieces[0].substring (0,1) == ' ') {CookiePieces[0] = CookiePieces[0].substring (1, CookiePieces[0].length);}
if (CookiePieces[0] == CookieName) {xReturnValue = CookiePieces[1];}
}
if(xReturnValue==""){xReturnValue=null;}
if(xReturnValue!=null){ if(xReturnValue.indexOf("!")!=-1){ var xDataArray = xReturnValue.split("!"); return xDataArray;}
}else{ return xReturnValue;}
}
function xEraseCookie(xCName){ xSetCookie(xCName,"",0);}
function xSetDisplay(xTarget,xValue) {(!(document.layers))? xTarget.style.display = xValue : xTarget['display'] = xValue;}
function xGetDisplay(xTarget) { return (!(document.layers))? xTarget.style.display : xTarget['display'];}


