var Gatex={ init:function(){ }, isIe:function(){ return navigator.userAgent.toLowerCase().indexOf("msie") != -1;}, isNetscape7:function(){ return navigator.userAgent.toLowerCase().indexOf("netscape") != -1;}, isSafari:function(){ return navigator.userAgent.toLowerCase().indexOf("khtml") != -1;}, isOpera:function(){ return navigator.userAgent.toLowerCase().indexOf("opera") != -1;}, isMozilla:function(){ return navigator.userAgent.toLowerCase().indexOf("gecko") != -1;}, getContextPath:function(){ return 'http://www.news.mn';}, getStaticContextPath:function(){ return 'http://static.news.mn';}, gotoTop:function(height){ if(height!=null){ window.scrollTo(0, height);}
else{ window.scrollTo(0, 0);}
}, setOpacity:function(element, opacity){ if (typeof element=="string")
element=document.getElementById(element); opacity=(opacity==100)?99.999:opacity; element.style.filter = "alpha(opacity="+opacity+")"; element.style.KHTMLOpacity = opacity/100; element.style.MozOpacity = opacity/100; element.style.opacity = opacity/100;}, removeElement:function(element){ if (typeof element=="string")
element=document.getElementById(element); if (element!=null)
element.parentNode.removeChild(element);}, setImageWidth:function(element, widthLimit, heightLimit){ var clientWidth=element.width; var clientHeight=element.height; var width=clientWidth; var height=clientHeight; var percent=0; if (height>heightLimit) { height=heightLimit; percent=(clientHeight/height); width=(clientWidth/percent);}
if (width>widthLimit) { width=widthLimit; percent=(clientWidth/width); height=(clientHeight/percent);}
return width;}, setImageHeight:function(element, widthLimit, heightLimit){ var clientWidth=element.width; var clientHeight=element.height; var width=clientWidth; var height=clientHeight; var percent=0; if (height>heightLimit) { height=heightLimit; percent=(clientHeight/height); width=(clientWidth/percent);}
if (width>widthLimit) { width=widthLimit; percent=(clientWidth/width); height=(clientHeight/percent);}
return height;}, setImageWH:function(type, width, height){ var percent; if (width>height)
percent=width/height; else
percent=height/width; width=parseInt(width/percent); height=parseInt(height/percent); if (type=="width")
return width; else if (type=="height")
return height;}, getOffsetLeft:function(element){ var currLeft = 0; if (element.offsetParent) { currLeft = element.offsetLeft
while (element = element.offsetParent) { currLeft += element.offsetLeft
}
}
return currLeft;}, getOffsetTop:function(element){ var currTop = 0; if (element.offsetParent) { currTop = element.offsetTop
while (element = element.offsetParent) { currTop += element.offsetTop
}
}
return currTop;}, emptyArray:function(arrayName){ arrayName.splice(0, arrayName.length);}, getArrayByTarget:function(arrayTarget){ var arrName=new Array(); var element=document.getElementById(arrayTarget); if(element!=null){ var childNodes=element.childNodes; var i=0; var ik=0; while (i<childNodes.length) { if (childNodes[i].tagName=="DIV") { arrName[ik]=new Array(); var childNodesJ=childNodes[i].childNodes; var j=0; var jk=0; while (j<childNodesJ.length) { if (childNodesJ[j].tagName=="DIV") { arrName[ik][jk]=childNodesJ[j].innerHTML; jk++;}
j++;}
ik++;}
i++;}
this.removeElement(element); return arrName;}
}, setArray:function(arrayName1, arrayName2){ for (var i=0; i<arrayName2.length; i++) { arrayName1[i] = new Array(); arrayName1[i] = arrayName2[i].split("|");}
}, setPrevNextButtonStyle:function(prevButton, nextButton, currIndex, length, scrLength, type){ if(document.getElementById(prevButton)!=null && document.getElementById(nextButton)!=null){ if(currIndex==0){ if(typeof prevButton=="string")
prevButton=document.getElementById(prevButton); if(prevButton!=null){ if(type!=null && type=="hidden")
prevButton.style.visibility="hidden"; else if(type!=null && type=="none")
prevButton.style.display="none"; else if(type!=null && type=="opacity")
Gatex.setOpacity(prevButton, 50); else
Gatex.setOpacity(prevButton, 50);}
if(length-scrLength<=0){ if(typeof nextButton=="string")
nextButton=document.getElementById(nextButton); if(nextButton!=null){ if(type!=null && type=="hidden")
nextButton.style.visibility="hidden"; else if(type!=null && type=="none")
nextButton.style.display="none"; else if(type!=null && type=="opacity")
Gatex.setOpacity(nextButton, 50); else
Gatex.setOpacity(nextButton, 50);}
}
else{ if(typeof nextButton=="string")
nextButton=document.getElementById(nextButton); if(nextButton!=null){ if(type!=null && type=="hidden")
nextButton.style.visibility="visible"; else if(type!=null && type=="none")
nextButton.style.display=""; else if(type!=null && type=="opacity")
Gatex.setOpacity(nextButton, 100); else
Gatex.setOpacity(nextButton, 100);}
}
}
else if(currIndex==length-scrLength){ if(typeof prevButton=="string")
prevButton=document.getElementById(prevButton); if(type!=null && type=="hidden")
prevButton.style.visibility="visible"; else if(type!=null && type=="none")
prevButton.style.display=""; else if(type!=null && type=="opacity")
Gatex.setOpacity(prevButton, 100); else
Gatex.setOpacity(prevButton, 100); if(typeof nextButton=="string")
nextButton=document.getElementById(nextButton); if(type!=null && type=="hidden")
nextButton.style.visibility="hidden"; else if(type!=null && type=="none")
nextButton.style.display="none"; else if(type!=null && type=="opacity")
Gatex.setOpacity(nextButton, 50); else
Gatex.setOpacity(nextButton, 50);}
else{ if(typeof prevButton=="string")
prevButton=document.getElementById(prevButton); if(type!=null && type=="hidden")
prevButton.style.visibility="visible"; else if(type!=null && type=="none")
prevButton.style.display=""; else if(type!=null && type=="opacity")
Gatex.setOpacity(prevButton, 100); else
Gatex.setOpacity(prevButton, 100); if (typeof nextButton=="string")
nextButton=document.getElementById(nextButton); if(type!=null && type=="hidden")
nextButton.style.visibility="visible"; else if(type!=null && type=="none")
nextButton.style.display=""; else if(type!=null && type=="opacity")
Gatex.setOpacity(nextButton, 100); else
Gatex.setOpacity(nextButton, 100);}
}
}, setLoadingImage:function(element, width, height){ var str=''; str+='<table border="0" cellpadding="0" cellspacing="0">'; str+='<tr>'; str+='<td height="40" align="right" valign="middle">'; str+='<img src="file:///D|/googoo/resources/API/interface/scripts/main/images/loading.gif" border="0" style="padding-left:10px;;"/>'; str+='</td>'; str+='<td align="left" valign="middle">'; str+='<div style="padding-left:10px;color:#AAAAAA; border:0px solid #000000;">Loading ...</div>'; str+='</td>'; str+='</tr>'; str+='</table>'; element.innerHTML=str; element.className="loading"; element.style.left=((width-element.offsetWidth)/2+10)+"px"; element.style.top=(height/2-30)+"px";}, removeLoadingImage:function(element, id, width, height){ element.style.width=Gatex.setImageWidth(element, width, height)+"px"; element.style.height=Gatex.setImageHeight(element, width, height)+"px"; element.style.visibility="visible"; setTimeout("Gatex.removeElement('"+id+"')", 0);}, reloadScript:function(element){ var scriptTags=element.getElementsByTagName("SCRIPT"); var i=0; while (i<scriptTags.length) { if (scriptTags[i].innerHTML!="") { eval(scriptTags[i].innerHTML);}
i++;}
}, ajaxRequest:function(url, target){ new Ajax.Request(url, { evalScripts:true, onSuccess: function(transport){ var response; response=transport.responseText || "no response text"; var element=document.getElementById(target); if(element!=null){ element.innerHTML=response;}
}, onComplete: function(transport) { }, onFailure: function(){ alert('Something went wrong...') }
});}, ajaxUpdater:function(url, target){ new Ajax.Updater(target, url, { evalScripts:true, onFailure: function(){ alert('Something went wrong...') }
});}, showLoading:function(){ var element=document.getElementById("divLoadTarget"); if(element!=null){ element.style.display=""; element.style.height=document.getElementById("body").offsetHeight+"px";}
var elementImgBg=document.getElementById("divLoadImgBgTarget"); if(elementImgBg!=null){ var topLoadingImgBgTop=0, topLoadingImgBgLeft=0; if(window.pageYOffset){ topLoadingImgBgTop = window.pageYOffset;}
else if(document.documentElement && document.documentElement.scrollTop){ topLoadingImgBgTop = document.documentElement.scrollTop;}
else if(document.body){ topLoadingImgBgTop = document.body.scrollTop;}
topLoadingImgBgTop+=parseInt(document.documentElement.clientHeight/2); topLoadingImgBgLeft+=parseInt(document.documentElement.clientWidth/2-120); elementImgBg.style.top=topLoadingImgBgTop+"px"; elementImgBg.style.left=topLoadingImgBgLeft+"px"; var elementImg=document.getElementById("divLoadImgTarget"); if(elementImg!=null){ elementImg.style.top=10+"px"; elementImg.style.left=10+"px"; elementImg.style.display="";}
elementImgBg.style.display="";}
}, hideLoading:function(){ setTimeout('Gatex.executeHideLoading()', 500);}, executeHideLoading:function(){ var element=document.getElementById("divLoadTarget"); if(element!=null){ element.style.display="none";}
var elementImgBg=document.getElementById("divLoadImgBgTarget"); if(elementImgBg!=null){ elementImgBg.style.display="none";}
var elementImg=document.getElementById("divLoadImgTarget"); if(elementImg!=null){ elementImg.style.display="none";}
}, setLocateLoading:function(e){ var left=0, top=0, pageX=0, pageY=0; if(!e){ var e = window.event;}
if(e.pageX){ pageX=e.pageX;}
else if(e.clientX){ pageX=e.clientX;}
var elementDivLoadImgTarget=document.getElementById("divLoadImgTarget"); if(elementDivLoadImgTarget){ elementDivLoadImgTarget.style.left=pageX+"px"; elementDivLoadImgTarget.style.top=pageY+"px";}
}
}
function changeStyle(id, style){ var element=document.getElementById(id); if(element!=null){ element.className=style;}
}
var ChangeStyle={ prevId : null, currId : null, prevObject : null, currObject : null, setActive: function(item, activeStyle, style) { if (typeof item=="object") { if (this.currObject==null)
this.currObject = item; else { this.prevObject = this.currObject; this.currObject = item; this.prevObject.className = style;}
this.currObject.className = activeStyle;}
else { if (this.currId==null)
this.currId = item; else { this.prevId = this.currId; this.currId = item; document.getElementById(this.prevId).className = style;}
document.getElementById(this.currId).className = activeStyle;}
}
}
var Rating={ text:new Array("маш муу", "муу", "дунд", "сайн", "маш сайн"), setImage:function(cI, t){ var i=1; while(i<cI+1){ var element=document.getElementById("rating"+i); if(element!=null){ var str=""; if(t=="over"){ str=element.src.replace("star2", "star1");}
else{ str=element.src.replace("star1", "star2");}
element.src=str;}
i++;}
var elementText=document.getElementById("ratingText"); if(elementText!=null){ if(t=="over"){ elementText.innerHTML=this.text[cI-1];}
else{ elementText.innerHTML="&nbsp;";}
}
}
}


/*val*/
function checkName(tName, min, max) { if (tName.length <= min || tName.length >= max) return false; var ss = /-/; tName = tName.replace('-', ''); var enExp = /^[a-zA-Z]+$/; var monExp = /^[а-яА-ЯөӨүҮ]+$/; if (tName.match(enExp))
return true; if (tName.match(monExp))
return true; return false;}
function checkPhone(val, min, maxCount) { var reg = /[0-9]+$/; var ss = /-/; val = val.replace(ss); if (val.match(reg)) return true; return false;}
function checkAge(val) { var reg = /[0-9]+$/; if (val.match(reg) && parseInt(val) < 100) { return true;}
return false;}
function checkLenght(val, min, max) { if (val.length > min && val.length < max) return true; else return false;}
function checkText(val, min, max) { var reg1 = /</; var reg2 = />/; if (reg1.exec(val) || reg2.exec(val)) return false; if (val.length <= min || val.length >= max) return false; return true;}
function checkEmail(emailStr) { if (emailStr.length == 0) { return true;}
var emailPat = /^(.+)@(.+)$/; var specialChars = "\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"; var validChars = "\[^\\s" + specialChars + "\]"; var quotedUser = "(\"[^\"]*\")"; var ipDomainPat = /^(\d{1,3})[.](\d{1,3})[.](\d{1,3})[.](\d{1,3})$/; var atom = validChars + '+'; var word = "(" + atom + "|" + quotedUser + ")"; var userPat = new RegExp("^" + word + "(\\." + word + ")*$"); var domainPat = new RegExp("^" + atom + "(\\." + atom + ")*$"); var matchArray = emailStr.match(emailPat); if (matchArray == null) { return false;}
var user = matchArray[1]; var domain = matchArray[2]; if (user.match(userPat) == null) { return false;}
var IPArray = domain.match(ipDomainPat); if (IPArray != null) { for (var i = 1; i <= 4; i++) { if (IPArray[i] > 255) { return false;}
}
return true;}
var domainArray = domain.match(domainPat); if (domainArray == null) { return false;}
var atomPat = new RegExp(atom, "g"); var domArr = domain.match(atomPat); var len = domArr.length; if ((domArr[domArr.length - 1].length < 2) || (domArr[domArr.length - 1].length > 3)) { return false;}
if (len < 2) { return false;}
return true;}
function isInt(val, maxCount) { var reg = /\d/; var vall = val.split(""); if (val.length <= maxCount) { var i = 0; while (i < val.length) { if (!(reg.exec(vall[i]))) { return false;}
i++;}
return true;}
return false;}
function isYear(val, maxCount) { var reg = /\d/; var vall = val.split(""); if (val.length == maxCount) { var i = 0; while (i < val.length) { if (!(reg.exec(vall[i]))) { return false;}
i++;}
return true;}
return false;}
function isEn(val, maxCount) { var reg = /A-Za-z/; var vall = val.split(""); if (val.length <= maxCount) { var i = 0; while (i < val.length) { if (!(reg.exec(vall[i]))) { return false;}
i++;}
return true;}
return false;}
function checkUserName(val, maxCount) { var reg = /^[a-zA-Z0-9_]+$/; var vall = val.split(""); if (val.length <= maxCount) { var i = 0; if (!val.match(reg)) { return false;}
return true;}
return false;}
function isNotNum(val, maxCount) { var reg = /\d/; if (val.length <= maxCount) { if (reg.exec(val)) { return false;}
}
return true;}
function checkNameLength(val, length) { while (val.length != 0) { if (val.indexOf(" ") == -1) { if (val.length > length) { return false;} else { return true;}
} else { var i = val.indexOf(" "); if (i > length) { return false;}
else { val = val.substring(i + 1, val.length);}
}
}
}
function checkDate(input) { var validformat = /^\d{4}\/\d{2}\/\d{2}$/
var returnval = false
if (!validformat.test(input.value))
alert("Invalid Date Format. Please correct and submit again."); else { var monthfield = input.value.split("/")[1]; var dayfield = input.value.split("/")[2]; var yearfield = input.value.split("/")[0]; var dayobj = new Date(yearfield, monthfield - 1, dayfield); if ((dayobj.getMonth() + 1 != monthfield) || (dayobj.getDate() != dayfield) || (dayobj.getFullYear() != yearfield))
alert("Invalid Day, Month, or Year range detected. Please correct and submit again."); else
returnval = true;}
if (returnval == false) input.select(); return returnval;}
function IsValidTime(timeStr) { var timePat = /^(\d{1,2}):(\d{2})(:(\d{2}))?(\s?(AM|am|PM|pm))?$/; var matchArray = timeStr.match(timePat); if (matchArray == null) { alert("Формат буруу байна."); return false;}
hour = matchArray[1]; minute = matchArray[2]; second = matchArray[4]; ampm = matchArray[6]; if (second=="") { second = null;}
if (ampm=="") { ampm = null }
if (hour < 0 || hour > 23) { return false;}
if (minute<0 || minute > 59) { return false;}
if (second != null && (second < 0 || second > 59)) { return false;}
return true;}



/* tab */
var Tab={ init:function(id, styleName){ var eB=document.getElementById(id+"B"); eB.className=styleName+"B"; var eP=document.getElementById(id+"P"); eP.className=styleName+"P"; var TabId=document.getElementById(id); TabId.className=styleName; var i=1; while(document.getElementById(id+"B"+i.toString()) != null){ document.getElementById(id+"B"+i.toString()).className=styleName+"B_Unselected"; document.getElementById(id+"B"+i.toString()+"P").style.display="none"; i++;}
document.getElementById(id+"B1").className=styleName+"B_Selected"; document.getElementById(id+"B1P").style.display="";}, selectTab:function(tab, styleName){ var id =tab.id.substring(0,tab.id.length-2); if(document.getElementById(id+"B1") == null)
id =tab.id.substring(0,tab.id.length-3); var i=1; while(document.getElementById(id+"B"+i.toString()) != null){ document.getElementById(id+"B"+i.toString()).className=styleName+"B_Unselected"; document.getElementById(id+"B"+i.toString()+"P").style.display="none"; i++;}
document.getElementById(tab.id).className=styleName+"B_Selected"; document.getElementById(tab.id+"P").style.display="";}
}
var TabMenu={ init:function(id){ var TabId=document.getElementById(id); var i=2; while(document.getElementById(id+i.toString()) != null){ document.getElementById(id+i.toString()+"S").style.display="none"; i++;}
document.getElementById(id+"1").style.display="none";}, selectTab:function (tab) { var id =tab.id.substring(0,tab.id.length-1); var i=1; while(document.getElementById(id+i.toString()) != null){ document.getElementById(id+i.toString()+"S").style.display="none"; document.getElementById(id+i.toString()).style.display=""; i++;}
document.getElementById(tab.id+"S").style.display=""; document.getElementById(tab.id).style.display="none";}
}
Tab.design1={ selectTab:function(u, classId, len, cI, callback){ var i=0; while(i<len){ var elementP=document.getElementById(u+"P_"+i); if(elementP!=null){ elementP.style.display='none'; if(i==cI){ elementP.style.display=''; if(elementP.innerHTML==''){ if(callback!=""){ eval(callback);}
}
}
}
i++;}
this.setStyle(u, classId, len, cI);}, setStyle:function(u, classId, len, cI){ var i=0; while(i<len){ var elementLeft=document.getElementById(u+"Left_"+i); if(elementLeft!=null){ elementLeft.className="Left"+classId;}
var elementCenter=document.getElementById(u+"Center_"+i); if(elementCenter!=null){ elementCenter.className="Center"+classId;}
var elementCenterA=document.getElementById(u+"CenterA_"+i); if(elementCenterA!=null){ elementCenterA.className="CenterA"+classId;}
var elementRight=document.getElementById(u+"Right_"+i); if(elementRight!=null){ elementRight.className="Right"+classId;}
if(i==cI){ var elementLeftS=document.getElementById(u+"Left_"+i); if(elementLeftS!=null){ elementLeftS.className="LeftS"+classId;}
var elementCenterS=document.getElementById(u+"Center_"+i); if(elementCenterS!=null){ elementCenterS.className="CenterS"+classId;}
var elementCenterAS=document.getElementById(u+"CenterA_"+i); if(elementCenterAS!=null){ elementCenterAS.className="CenterAS"+classId;}
var elementRightS=document.getElementById(u+"Right_"+i); if(elementRightS!=null){ elementRightS.className="RightS"+classId;}
}
i++;}
}, clear:function(u, classId, len){ var i=0; while(i<len){ var elementLeft=document.getElementById(u+"Left_"+i); if(elementLeft!=null){ elementLeft.className="Left"+classId;}
var elementCenter=document.getElementById(u+"Center_"+i); if(elementCenter!=null){ elementCenter.className="Center"+classId;}
var elementCenterA=document.getElementById(u+"CenterA_"+i); if(elementCenterA!=null){ elementCenterA.className="CenterA"+classId;}
var elementRight=document.getElementById(u+"Right_"+i); if(elementRight!=null){ elementRight.className="Right"+classId;}
i++;}
}
}
var TopMenu={ it:new Array(), init:function(t, cI){ this.len=t; this.cI=cI; this.tween=null; this.setStyle(this.cI);}, firstOnSelect:function(cI){ this.setStyle(cI); if(this.tween!=null){ clearTimeout(this.tween); this.tween=null;}
}, onSelectGetBySection:function(section){ var re=false; var i=0; while(i<this.it.length){ if(this.it[i]==section){ re=true; this.cI=i+1; if(this.tween!=null){ clearTimeout(this.tween); this.tween=null;}
this.setStyle(this.cI); break;}
i++;}
if(!re){ this.cI=0; if(this.tween!=null){ clearTimeout(this.tween); this.tween=null;}
this.setStyle(this.cI);}
}, onSelect:function(cI){ this.cI=cI; if(this.tween!=null){ clearTimeout(this.tween); this.tween=null;}
this.setStyle(this.cI);}, setStyle:function(cI){ var i=0; while(i<this.len){ var elementLeft=document.getElementById("topMenuLeft_"+i); if(elementLeft!=null){ elementLeft.className="Left9"; if(i==cI){ elementLeft.className="LeftS9";}
}
var elementRight=document.getElementById("topMenuRight_"+i); if(elementRight!=null){ elementRight.className="Right9"; if(i==cI){ elementRight.className="RightS9";}
}
var elementCenter=document.getElementById("topMenuCenter_"+i); if(elementCenter!=null){ elementCenter.className="Center9"; if(i==cI){ elementCenter.className="CenterS9";}
}
var elementCenterA=document.getElementById("topMenuCenterA_"+i); if(elementCenterA!=null){ elementCenterA.className="CenterA9"; if(i==cI){ elementCenterA.className="CenterAS9";}
}
var elementButtonSpace=document.getElementById("topMenuBSpace"+i); if(elementButtonSpace!=null){ elementButtonSpace.className="Seperator9";}
if(i==this.len-1){ var elementButtonSpaceLast=document.getElementById("topMenuBSpace"+(i+1)); if(elementButtonSpaceLast!=null){ elementButtonSpaceLast.className="Seperator9";}
}
var elementPanel=document.getElementById("topMenuB"+i+"P"); if(elementPanel!=null){ elementPanel.style.display="none";}
i++;}
var elementPanel1=document.getElementById("topMenuB"+cI+"P"); if(elementPanel1!=null){ elementPanel1.style.display="";}
}
}






/* ticker */
if(typeof(Ticker)=='undefined') var Ticker={ }
Ticker.perforate={ init:function(aT){ var element=document.getElementById(aT); if(element!=null){ this.items=new Array(); this.items=Gatex.getArrayByTarget(aT); this.currIndex=0; this.currElementsWidth=new Array(); this.type=null; this.tween=null; this.isTweenYStop=false; this.ind2=0; this.str2=""; this.currStr2=""; this.isWait=false;}
}, tweenZ:function(target, classId, isLink){ this.str2=this.items[this.currIndex][0].split(""); this.tweenPerforate(target, classId, isLink);}, prev:function(target, classId, isLink){ if(this.currIndex>0){ this.currIndex--;}
else{ this.currIndex=this.items.length-1 }
clearTimeout(this.tween); this.ind2=0; this.str2=this.items[this.currIndex][0].split(""); this.currStr2=""; this.isWait=false; var element=document.getElementById("tickerCursor"); if(element!=null){ element.style.display='none';}
this.tween=setTimeout("Ticker.perforate.tweenPerforate('"+target+"', '"+classId+"', "+isLink+")", 50);}, next:function(target, classId, isLink){ if(this.currIndex<this.items.length-1){ this.currIndex++;}
else{ this.currIndex=0;}
clearTimeout(this.tween); this.ind2=0; this.str2=this.items[this.currIndex][0].split(""); this.currStr2=""; this.isWait=false; var element=document.getElementById("tickerCursor"); if(element!=null){ element.style.display='none';}
this.tween=setTimeout("Ticker.perforate.tweenPerforate('"+target+"', '"+classId+"', "+isLink+")", 50);}, tweenPerforate:function(target, classId, isLink){ var element=document.getElementById(target); if(element!=null){ var elementCursor=document.getElementById("tickerCursor"); if(elementCursor!=null){ elementCursor.style.display='';}
if(this.ind2<this.str2.length){ this.currStr2+=this.str2[this.ind2]; var a=''; if(isLink){ a='<a href="'+Ticker.perforate.items[Ticker.perforate.currIndex][1]+'" class="TickerPerforateText'+classId+'" onmouseover="Ticker.perforate.tweenZStop()" onmouseout="Ticker.perforate.tweenZContinue(\''+target+'\', \''+classId+'\', '+isLink+')">'+this.currStr2+'</a> <span id="tickerCursor" class="tickerPerforateCursor'+classId+'">&nbsp;</span>';}
else{ a='<a href="javascript:void(0)" class="TickerPerforateText'+classId+'" onclick="'+Ticker.perforate.items[Ticker.perforate.currIndex][1]+'; return false;" onmouseover="Ticker.perforate.tweenZStop()" onmouseout="Ticker.perforate.tweenZContinue(\''+target+'\', \''+classId+'\', '+isLink+')">'+this.currStr2+'</a> <span id="tickerCursor" class="tickerPerforateCursor'+classId+'">&nbsp;</span>';}
element.innerHTML=a; this.ind2++;}
else{ this.isWait=true; this.ind2=0;}
if(this.isWait){ this.currStr2=""; this.isWait=false; if(this.currIndex<this.items.length-1){ this.currIndex++;}
else{ this.currIndex=0;}
this.str2=this.items[this.currIndex][0].split(""); var elementCursor1=document.getElementById("tickerCursor"); if(elementCursor1!=null){ elementCursor1.style.display='none';}
this.tween=setTimeout("Ticker.perforate.tweenPerforate('"+target+"', '"+classId+"', "+isLink+")", 1000);}
else{ this.tween=setTimeout("Ticker.perforate.tweenPerforate('"+target+"', '"+classId+"', "+isLink+")", 50);}
}
}, tweenZStop:function(){ clearTimeout(this.tween);}, tweenZContinue:function(target, classId, isLink){ this.tweenPerforate(target, classId, isLink);}
}


/* toolbar */
var Toolbar={ init:function(id, target){ this.isBegin=false; this.veryTopLimit=0; this.veryBottomLimit=0; this.firstTop=346; this.top=0; this.tweenTopVar=null; this.id=id; this.target=target; var element=document.getElementById(this.id); if(element!=null){ var elementTarget=document.getElementById(Toolbar.target); if(elementTarget!=null){ elementTarget.insertBefore(element, elementTarget.firstChild); element.style.left=(Gatex.getOffsetLeft(elementTarget)+3)+'px'; element.style.top=(Gatex.getOffsetTop(elementTarget)+3)+'px'; this.veryTopLimit=Gatex.getOffsetTop(elementTarget)+3; this.veryBottomLimit=Gatex.getOffsetTop(elementTarget)+elementTarget.offsetHeight-3; this.isBegin=true;}
element.style.display='';}
}, tweenTopInc:function(top, topLimit){ this.firstTop=this.top; if(this.tweenTopVar!=null){ clearTimeout(this.tweenTopVar);}
if(top<topLimit){ var element = document.getElementById(Toolbar.id); if(element!=null){ var step = 20; if(topLimit-top<step){ top=top+(topLimit-top);}
else{ top+=step;}
element.style.top=top+"px"; var time=0; if(Gatex.isIe()){ time=15;}
else if(Gatex.isMozilla()){ time=1;}
else{ time=1;}
this.tweenTopVar=setTimeout("Toolbar.tweenTopInc("+top+", "+topLimit+")", time);}
}
else{ clearTimeout(this.tweenTopVar);}
}, tweenTopDec:function(top, topLimit){ this.firstTop=this.top; if(this.tweenTopVar!=null){ clearTimeout(this.tweenTopVar);}
if(top>topLimit){ var element=document.getElementById(Toolbar.id); if(element!=null){ var step = 20; if(top-topLimit<step){ top=top-(top-topLimit);}
else{ top-=step;}
element.style.top=top+"px"; var time = 0; if(Gatex.isIe()){ time = 15;}
else if(Gatex.isMozilla()){ time = 1;}
else{ time = 1;}
this.tweenTopVar=setTimeout("Toolbar.tweenTopDec("+top+", "+topLimit+")", time);}
}
else{ clearTimeout(this.tweenTopVar);}
}, scroll:function(event){ if(Toolbar!=null && Toolbar.isBegin){ if(window.pageYOffset){ Toolbar.top = window.pageYOffset;}
else if(document.documentElement && document.documentElement.scrollTop){ Toolbar.top = document.documentElement.scrollTop;}
else if(document.body){ Toolbar.top = document.body.scrollTop;}
var element=document.getElementById(Toolbar.id); if(element!=null){ var elementTop=parseInt(element.offsetTop); var elementHeight=parseInt(element.offsetHeight); var top=0; var topLimit=0; if(Toolbar.top>Toolbar.firstTop){ if((elementTop)<Toolbar.top){ top=elementTop; topLimit=Toolbar.top+5; if(topLimit>Toolbar.veryBottomLimit-elementHeight){ topLimit=Toolbar.veryBottomLimit-elementHeight;}
if(Toolbar.tweenTopVar!=null){ clearTimeout(Toolbar.tweenTopVar);}
Toolbar.tweenTopVar=setTimeout("Toolbar.tweenTopInc("+top+", "+topLimit+")", 500);}
}
else{ if(Toolbar.top>elementTop+elementHeight){ }
else{ if(Toolbar.top+document.body.clientHeight<elementTop){ top=Toolbar.top+document.body.clientHeight; var telement=document.getElementById(Toolbar.target); if(telement!=null){ if(Gatex.getOffsetTop(telement)>Toolbar.top){ topLimit=Gatex.getOffsetTop(telement)+3;}
else{ topLimit=Toolbar.top+5;}
}
}
else{ top=elementTop; var telement=document.getElementById(Toolbar.target); if(telement!=null){ if(Gatex.getOffsetTop(telement)>Toolbar.top){ topLimit=Gatex.getOffsetTop(telement)+3;}
else{ topLimit=Toolbar.top+5;}
}
}
if(Toolbar.tweenTopVar!=null){ clearTimeout(Toolbar.tweenTopVar);}
Toolbar.tweenTopVar = setTimeout("Toolbar.tweenTopDec("+top+", "+topLimit+")", 500);}
}
}
}
}
}
window.onscroll = Toolbar.scroll;




/* userHistory1 */
UserHistory={ it:new Array(), maxLength:5, build:function(){ var i=0, str=''; str+='<span class="UserHistoryPrevTitle">Та энд байна:</span>&nbsp;&nbsp;'; while(i<this.it.length){ var lastStr=''; if(i<this.it.length-1){ lastStr='<span  class="UserHistoryArrow">&raquo;</span>&nbsp;&nbsp;';}
str+='<a href="javascript:UserHistory.execute('+this.it[i][2]+')" class="UserHistoryTitle">'+this.it[i][1]+'</a>&nbsp;'+lastStr; i++;}
var element=document.getElementById("userHistoryTarget"); if(element!=null){ element.innerHTML=str;}
}, add:function(sectionId, sectionName, callback){ if(this.check(sectionId)){ this.insert(sectionId, sectionName, callback);}
else{ this.update(sectionId, callback);}
this.clear(sectionId); this.build();}, insert:function(sectionId, sectionName, callback){ if(this.it.length<=0){ this.it[0]=new Array(); this.it[0][0]=sectionId; this.it[0][1]=sectionName; this.it[0][2]=callback;}
else{ if(this.maxLength<=this.it.length){ this.it.splice(0, 1);}
this.it[this.it.length]=new Array(); this.it[this.it.length-1][0]=sectionId; this.it[this.it.length-1][1]=sectionName; this.it[this.it.length-1][2]=callback;}
}, update:function(sectionId, callback){ var i=0; while(i<this.it.length){ if(this.it[i][0]==sectionId){ this.it[i][2]=callback;}
i++;}
}, check:function(sectionId){ var re=true; if(this.it.length==0){ return re;}
else if(this.it[this.it.length-1][0]==sectionId){ re=false; return re;}
return re;}, clear:function(sectionId){ var i=0; while(i<this.it.length-1){ if(sectionId==this.it[i][0]){ this.it.splice(i, 1);}
i++;}
}, execute:function(callback){ eval(callback);}
}



/* pageBreak */
var PageBreak={ init:function(dataTarget){ this.items=new Array(); if(Gatex.isIe()){ this.items=document.getElementById(dataTarget).innerHTML.split("<HR>");}
else{ this.items=document.getElementById(dataTarget).innerHTML.split("<hr>");}
this.currIndex=0; this.buildCurrItem(); if(this.items.length>1){ this.buildPageTitle(); this.buildScr();}
this.setStyle();}, buildCurrItem:function(){ if(this.items.length>1){ var str=''; str+=this.items[this.currIndex]; var element=document.getElementById("PageBreak_Target"); if(element!=null){ element.innerHTML=str;}
}
else{ var elementTarget=document.getElementById("PageBreak_Target"); if(elementTarget!=null){ elementTarget.style.display='none';}
var elementDataTarget=document.getElementById("PageBreak_DataTarget"); if(elementDataTarget!=null){ elementDataTarget.style.display='';}
}
}, buildPageTitle:function(){ var div=document.createElement("DIV"); div.id='PageBreak_PageTitle'; var str=''; str+='(Page'+(this.currIndex+1)+' of '+(this.items.length)+')'; div.innerHTML=str; var element=document.getElementById('PageBreak_Target'); if(element!=null){ element.parentNode.insertBefore(div, element);}
}, buildScr:function(){ var str=''; str+='<table border="0" cellpadding="0" cellspacing="3"><tr>'; str+='<td class="PageBreak_NextButton">Хуудас</td>'; var i=0; while(i<this.items.length){ str+='<td id="PageBreak_Button'+i+'" class="PageBreak_Button PageBreak_Hand" onclick="PageBreak.onclick('+i+');">'; str+=(i+1); str+='</td>'; i++;}
str+='</tr></table>'; var element=document.getElementById("PageBreak_Scr"); if(element!=null){ element.innerHTML=str;}
Gatex.setPrevNextButtonStyle("PageBreak_PrevButton", "PageBreak_NextButton", this.currIndex, this.items.length, 1, "hidden");}, onclick:function(i){ Gatex.gotoTop(0); this.currIndex=i; var str=''; str+=this.items[this.currIndex]; var element=document.getElementById("PageBreak_Target"); if(element!=null){ element.innerHTML=str;}
Gatex.setPrevNextButtonStyle("PageBreak_PrevButton", "PageBreak_NextButton", this.currIndex, this.items.length, 1, "hidden"); if(document.getElementById("PageBreak_PageTitle")!=null){ Gatex.removeElement("PageBreak_PageTitle");}
this.buildPageTitle(); this.setStyle(); Toolbar.init('delta', 'bannerScroll_Target');}, next:function(){ if(this.currIndex<this.items.length-1){ this.currIndex++; var str=''; str+=this.items[this.currIndex]; var element=document.getElementById("PageBreak_Target"); element.innerHTML=str; Gatex.setPrevNextButtonStyle("PageBreak_PrevButton", "PageBreak_NextButton", this.currIndex, this.items.length, 1, "hidden"); if(document.getElementById("PageBreak_PageTitle")!=null){ Gatex.removeElement("PageBreak_PageTitle");}
if(this.currIndex>0){ this.buildPageTitle();}
this.setStyle();}
}, prev:function(){ if(this.currIndex>0){ this.currIndex--; var str=''; str+=this.items[this.currIndex]; var element=document.getElementById("PageBreak_Target"); element.innerHTML=str; Gatex.setPrevNextButtonStyle("PageBreak_PrevButton", "PageBreak_NextButton", this.currIndex, this.items.length, 1, "hidden"); if(document.getElementById("PageBreak_PageTitle")!=null)
Gatex.removeElement("PageBreak_PageTitle"); if(this.currIndex>0)
this.buildPageTitle(); this.setStyle();}
}, setStyle:function(){ var i=0; while(i<this.items.length){ var element=document.getElementById("PageBreak_Button"+i); if(element!=null){ element.className="PageBreak_Button PageBreak_Hand"; if(i==this.currIndex){ element.className="PageBreak_Button_Selected PageBreak_Hand";}
}
i++;}
}
}






/* assistment */
var Assistment={}
Assistment.design1={ init:function(unique){ this.unique=unique; this.prevIndex=null; this.currIndex=null; this.tweenAddHeight=null; this.tweenDecTop=null; this.heights=new Array(); this.heights[0]=245; this.heights[1]=245; this.heights[2]=245; this.heights[3]=245; this.heights[4]=245; this.heights[5]=245; this.onMouseOverNav(0);}, onMouseOverNav:function(i){ this.setActive(i);}, setActive:function(i) { if(this.currIndex==null){ if(this.tweenAddHeight!=null){ clearTimeout(this.tweenAddHeight);}
if(document.getElementById("assistmentEmpty").style.display!="none"){ var element=document.getElementById("assistmentEmpty"); if(element!=null){ element.style.display="none";}
}
this.currIndex=i; var elementNav=document.getElementById("assistmentNav"+this.unique+"_"+this.currIndex); if(elementNav!=null){ elementNav.className="activeNav"+(i%3)+" hand";}
var elementPanel=document.getElementById("assistmentContentBox"+this.unique+"_"+this.currIndex); if(elementPanel!=null){ elementPanel.style.display=""; elementPanel.style.height=this.heights[this.currIndex]+"px";}
this.getContent(this.currIndex);}
else if(this.currIndex==i) { }
else{ if(this.tweenAddHeight!=null){ clearTimeout(this.tweenAddHeight);}
if(this.tweenDecTop!=null){ clearTimeout(this.tweenDecTop);}
var elementEmpty1=document.getElementById("assistmentEmpty"); if(elementEmpty1!=null){ if(elementEmpty1.style.display!="none"){ elementEmpty1.style.display="none";}
}
this.prevIndex=this.currIndex; this.currIndex=i; var elementPrevButton=document.getElementById("assistmentNav"+this.unique+"_"+this.prevIndex); if(elementPrevButton!=null){ elementPrevButton.className="nav"+(this.prevIndex%3)+" hand";}
var elementPrevPanel=document.getElementById("assistmentContentBox"+this.unique+"_"+this.prevIndex); if(elementPrevPanel!=null){ var elementPrevPanelDiv=document.getElementById("assistmentContentBoxDiv"+this.unique+"_"+this.prevIndex); if(elementPrevPanelDiv!=null){ elementPrevPanelDiv.style.display="none";}
elementPrevPanel.style.display="none";}
var elementButton=document.getElementById("assistmentNav"+this.unique+"_"+this.currIndex); if(elementButton!=null){ elementButton.className="activeNav"+(i%3)+" hand";}
var elementCurrPanel=document.getElementById("assistmentContentBox"+this.unique+"_"+this.currIndex); if(elementCurrPanel!=null){ var elementCurrPanelDiv=document.getElementById("assistmentContentBoxDiv"+this.unique+"_"+this.currIndex); if(elementCurrPanelDiv!=null){ elementCurrPanelDiv.style.display="none";}
elementCurrPanel.style.display="";}
if((this.prevIndex/3<1?0:1)!=(this.currIndex/3<1?0:1)){ this.addHeight(0, this.heights[i], i); if(parseInt(this.currIndex/3)>0){ var elementEmpty=document.getElementById("assistmentEmpty"); if(elementEmpty!=null){ elementEmpty.style.height=245+"px"; elementEmpty.style.display=""; this.decTop(this.heights[i], 0);}
}
}
else{ var elementContentBox=document.getElementById("assistmentContentBox"+this.unique+"_"+this.currIndex); if(elementContentBox!=null){ elementContentBox.style.height=this.heights[i]+"px";}
this.getContent(i);}
}
}, addHeight:function(height, limit, i){ if(height<limit){ var element=document.getElementById("assistmentContentBox"+this.unique+"_"+i); if(element!=null){ var element13=document.createElement("DIV"); element.appendChild(element13); var step=7; if(limit-height<step){ height=height+(limit-height);}
else{ height+=step;}
element.style.height=height+"px"; var time=0; if(Gatex.isIe()){ time=5;}
else if(Gatex.isMozilla()){ time=1;}
else if(Gatex.isNetscape7()){ time=1;}
else{ time=1;}
this.tweenAddHeight=setTimeout("Assistment.design1.addHeight("+height+", "+limit+", "+i+")", time);}
}
else{ this.getContent(i); clearTimeout(this.tweenAddHeight); this.tweenAddHeight=null;}
}, decTop:function(height, limit){ var element=document.getElementById("assistmentEmpty"); if(element!=null){ if(height>limit){ var step=10; if(height-limit<step){ height=height-(height-limit);}
else{ height-=step;}
element.style.height=height+"px"; var time=0; if(Gatex.isIe()){ time=8;}
else if(Gatex.isMozilla()){ time=1;}
else if(Gatex.isNetscape7()){ time=1;}
else{ time=1;}
this.tweenDecTop = setTimeout("Assistment.design1.decTop("+height+", "+limit+")", time);}
else{ clearTimeout(this.tweenDecTop); this.tweenDecTop=null; if(element!=null){ element.style.display="none";}
}
}
}, getContent:function(i){ var elementPanelDiv=document.getElementById("assistmentContentBoxDiv"+this.unique+"_"+i); if(elementPanelDiv!=null){ elementPanelDiv.style.display="";}
}
}


/* mediaPlayer */
var accepted_domains=new Array("an-archos.com","cafepress.com","192.168.1.13:8080")
var viddownloadLink='none'
var playerloop='no'
var mp3downloadLink='none'
var playerbg ='DDDDDD'
var playerleftbg='CCCCCC'
var playerrightbg='CCCCCC'
var playerrightbghover='CCCCCC'
var playerlefticon='000000'
var playerrighticon='000000'
var playerrighticonhover='FFFFFF'
var playertext='333333'
var playerslider='666666'
var playertrack='999999'
var playerloader='666666'
var playerborder='333333'
var flvwidth='600'
var flvheight='500'
var flvfullscreen='false'
var mp3playerstyle = 'vertical-align:bottom; margin:10px 0 5px 2px;'
var mp3imgmargin = '0.5em 0.5em -4px 5px'
var vidimgmargin = '0'
var domaincheck=document.location.href
var accepted_ok=false
if (domaincheck.indexOf("http")!=-1){ for (r=0;r<accepted_domains.length;r++){ if (domaincheck.indexOf(accepted_domains[r])!=-1){ accepted_ok=true
break
}
}
}
else
accepted_ok=true
if(typeof(Media)=='undefined') Media={}
Media.Mp3={ player: null, width: 290, currAudio: null, autoStart: null, rootPath: "file:///D|/ginterface/resources/jscripts/mediaPlayer/", play:function(target, width, contentId, autoStart){ var element=document.getElementById(target); if(width!=null)
Media.Mp3.width=width; if(autoStart!=null)
Media.Mp3.autoStart=autoStart; if(element!=null)
Media.Mp3.build(element, contentId);}, build:function(element, contentId){ if(Media.Mp3.currAudio==null)
Media.Mp3.currAudio=document.createElement('span'); Media.Mp3.currAudio.innerHTML='<object style="'+mp3playerstyle+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'+ 'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"'+ 'width="'+Media.Mp3.width+'" height="24" id="player" align="middle">'+ '<param name="wmode" value="transparent" />'+ '<param name="allowScriptAccess" value="sameDomain" />'+ '<param name="flashVars" value="bg=0x'+playerbg+'&amp;leftbg=0x'+playerleftbg+'&amp;rightbg=0x'+playerrightbg+'&amp;rightbghover=0x'+playerrightbghover+'&amp;lefticon=0x'+playerlefticon+'&amp;righticon=0x'+playerrighticon+'&amp;righticonhover=0x'+playerrighticonhover+'&amp;text=0x'+playertext+'&amp;slider=0x'+playerslider+'&amp;track=0x'+playertrack+'&amp;loader=0x'+playerloader+'&amp;border=0x'+playerborder+'&amp;autostart='+Media.Mp3.autoStart+'&amp;loop='+playerloop+'&amp;soundFile='+Media.Mp3.url+'&amp;contentId='+contentId+'" />'+ '<param name="movie" value="'+Media.Mp3.rootPath+'player.swf" /><param name="quality" value="high" />'+ '<embed style="'+mp3playerstyle+'" src="'+Media.Mp3.rootPath+'player.swf" flashVars="bg=0x'+playerbg+'&amp;leftbg=0x'+playerleftbg+'&amp;rightbg=0x'+playerrightbg+'&amp;rightbghover=0x'+playerrightbghover+'&amp;lefticon=0x'+playerlefticon+'&amp;righticon=0x'+playerrighticon+'&amp;righticonhover=0x'+playerrighticonhover+'&amp;text=0x'+playertext+'&amp;slider=0x'+playerslider+'&amp;track=0x'+playertrack+'&amp;loader=0x'+playerloader+'&amp;border=0x'+playerborder+'&amp;autostart='+Media.Mp3.autoStart+'&amp;loop='+playerloop+'&amp;soundFile='+Media.Mp3.url+'&amp;contentId='+contentId+'" '+ 'quality="high" wmode="transparent" width="'+Media.Mp3.width+'" height="24" name="player"'+ 'align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"'+ ' pluginspage="http://www.macromedia.com/go/getflashplayer" /></object><br />'; element.appendChild(Media.Mp3.currAudio);}, destroy:function(){ if(Media.Mp3.currAudio!=null)
Media.Mp3.currAudio.parentNode.removeChild(Media.Mp3.currAudio);}
}
if(typeof(Media)=='undefined') Media={}
Media.FLV={ flvWidth: 600, flvHeight: 500, currVideo: null, autoStart: true, rootPath: Gatex.getContextPath()+"/jscripts/mediaPlayer", rootImgPath: Gatex.getStaticContextPath()+"/jscripts/mediaPlayer", play:function(target, width, height, contentId, autoStart){ var element=document.getElementById(target); if(width!=null){ Media.FLV.flvWidth=width;}
if(height!=null){ Media.FLV.flvHeight=height;}
if(autoStart!=null){ Media.FLV.autoStart=autoStart;}
if(element!=null){ Media.FLV.build(element, contentId);}
}, build:function(element, contentId){ if(element!=null){ if(Media.FLV.currVideo==null){ Media.FLV.currVideo=document.createElement('span');}
Media.FLV.currVideo.innerHTML='<object type="application/x-shockwave-flash" wmode="transparent" data="'+Media.FLV.rootPath+'/flvplayer.swf?click='+Media.FLV.rootImgPath+'/images/flvplaybutton.jpg&file='+Media.FLV.url+'&showfsbutton='+flvfullscreen+'&autoStart='+Media.FLV.autoStart+'&contentId='+contentId+'" height="'+Media.FLV.flvHeight+'" width="'+Media.FLV.flvWidth+'">'+ '<param name="movie" value="'+Media.FLV.rootPath+'/flvplayer.swf?click='+Media.FLV.rootImgPath+'/images/flvplaybutton.jpg&file='+Media.FLV.url+'&showfsbutton='+flvfullscreen+'&autoStart='+Media.FLV.autoStart+'&contentId='+contentId+'">'+ '<param name="wmode" value="transparent">'+ '<embed src="'+Media.FLV.rootPath+'/flvplayer.swf?file='+Media.FLV.url+'&click='+Media.FLV.rootImgPath+'/images/flvplaybutton.jpg&showfsbutton='+flvfullscreen+'&autoStart='+Media.FLV.autoStart+'&contentId='+contentId+'" '+ 'width="'+Media.FLV.flvWidth+'" height="'+Media.FLV.flvHeight+'" name="flvplayer" align="middle" '+ 'play="true" loop="false" quality="high" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">'+ '</embed></object><br />'; element.appendChild(Media.FLV.currVideo);}
}, destroy:function(){ if(Media.FLV.currVideo!=null){ Media.FLV.currVideo.parentNode.removeChild(Media.FLV.currVideo);}
}
}


/* tree3 */
if(typeof(NTree)=='undefined') var NTree={ }
NTree.design3={ childItems:new Array(), it:new Array(), Index:1, init:function(target, dataTarget, u){ Gatex.emptyArray(this.it); this.target=target; this.getData(document.getElementById(dataTarget), 0); this.Index=1; this.rP=Gatex.getStaticContextPath()+"/jscripts/tree/"; Gatex.removeElement(dataTarget); myHM.pushDoubleArray(this.it, 'NTree.design3_'+u+'_It'); myHM.put('NTree.design3_'+u+'_ItW', new String(this.it.length)); myHM.put('NTree.design3_'+u+'_ItH', new String(4)); this.buildParent(u);}, getData:function(element, cPa){ var childs=element.childNodes; var i=0; while(i<childs.length){ if(childs[i].tagName=="LI"){ this.it[this.Index-1]=new Array(); this.it[this.Index-1][0]=this.Index; this.it[this.Index-1][1]=cPa; this.it[this.Index-1][2]=childs[i].firstChild.innerHTML; this.it[this.Index-1][3]=childs[i].firstChild.href; this.Index++; if(this.getDataHasChild(childs[i])){ this.getData(this.getDataGetChild(childs[i]), this.Index-1);}
}
i++;}
}, getDataGetChild:function(element){ var telement=null; var childs=element.childNodes; var i=0; while(i<childs.length){ if(childs[i].tagName=="UL"){ telement=childs[i]; break;}
i++;}
return telement;}, getDataHasChild:function(element){ var re=false; var childs=element.childNodes; var i=0; while(i<childs.length){ if(childs[i].tagName=="UL"){ re=true; break;}
i++;}
return re;}, buildParent:function(u){ this.it=myHM.getDoubleArray('NTree.design3_'+u+'_It', myHM.get('NTree.design3_'+u+'_ItW'), myHM.get('NTree.design3_'+u+'_ItH')); var parentItems=new Array(); parentItems=this.getParent(); var element=document.getElementById(this.target); var i=0; while(i<parentItems.length){ var div=document.createElement("DIV"); div.style.paddingLeft=0; div.className="treeParent"; var tableText=''; tableText+='<table border="0" cellpadding="0" cellspacing="0"><tr><td>'; var imageText=''; var imageSrc2=''; if(this.hasChild(parentItems[i][0])){ imageSrc2=this.rP+'images/square.gif';}
else{ imageSrc2=this.rP+'images/circle.gif';}
imageText+='<img id="Tree_Img'+u+parentItems[i][0]+'" src="'+imageSrc2+'" class="treeImage" onclick="NTree.design3.buildChilds('+parentItems[i][0]+', 0, \''+u+'\');"/>'; imageText+='<div id="Tree_Img'+u+parentItems[i][0]+'Parent" style="display:none;">'+parentItems[i][1]+'</div>'; tableText+=imageText; tableText+='</td><td>'; var aText=''; if(this.hasChild(parentItems[i][0])){aText+='<a id="Tree_A'+u+parentItems[i][0]+'" href="'+parentItems[i][3]+'" class="treeText1">'+parentItems[i][2]+'</a>';}
else{aText+='<a id="Tree_A'+u+parentItems[i][0]+'" href="'+parentItems[i][3]+'" class="treeText1">'+parentItems[i][2]+'</a>';}
tableText+=aText; tableText+='</td></tr></table>'; div.innerHTML+=tableText; element.appendChild(div); i++;}
Gatex.emptyArray(parentItems);}, buildChilds:function(id, paddingLeft, u){ this.it=myHM.getDoubleArray('NTree.design3_'+u+'_It', myHM.get('NTree.design3_'+u+'_ItW'), myHM.get('NTree.design3_'+u+'_ItH')); if(this.hasChild(id)){ var element=document.getElementById("Tree_Img"+u+id); if(element!=null){ element.src=this.rP+"images/square1.gif";}
}
paddingLeft+=20; this.childItems=this.getChilds(id); var tarr=new Array(); tarr=this.getNode(id); var i=this.childItems.length-1; while(i>=0){ var div=document.createElement("DIV"); div.style.paddingLeft=(paddingLeft)+"px"; div.className="treeParent"; var tableText=''; tableText+='<table border="0" cellpadding="0" cellspacing="0"><tr><td>'; var imageText=''; var imgSrc1=''; if(this.hasChild(this.childItems[i][0])){ imgSrc1=this.rP+'images/square.gif';}
else{ imgSrc1=this.rP+'images/circle.gif';}
imageText+='<img id="Tree_Img'+u+this.childItems[i][0]+'" src="'+imgSrc1+'" class="treeImage" onclick="NTree.design3.buildChilds('+this.childItems[i][0]+', '+paddingLeft+', \''+u+'\');"/>'; imageText+='<div id="Tree_Img'+u+this.childItems[i][0]+'Parent" style="display:none;">'+this.childItems[i][1]+'</div>'; tableText+=imageText; tableText+='</td><td>'; var aText=''; var className1=''; if(this.hasChild(this.childItems[i][0])){ className1='treeText1';}
else{ className1='treeText1';}
aText+='<a id="Tree_A'+u+this.childItems[i][0]+'" href="'+this.childItems[i][3]+'" class="'+className1+'">'+this.childItems[i][2]+'</a>'; tableText+=aText; tableText+='</td></tr></table>'; div.innerHTML+=tableText; var elementImg=document.getElementById("Tree_Img"+u+id); elementImg.onclick=function(){ NTree.design3.removeChilds(id, u);}
var elementA=document.getElementById("Tree_A"+u+id); elementA.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.insertBefore(div, elementA.parentNode.parentNode.parentNode.parentNode.parentNode.nextSibling); elementA.href=tarr[3]+""; i--;}
Gatex.emptyArray(this.childItems);}, removeChilds:function(id, u){ this.it=myHM.getDoubleArray('NTree.design3_'+u+'_It', myHM.get('NTree.design3_'+u+'_ItW'), myHM.get('NTree.design3_'+u+'_ItH')); var element1=document.getElementById("Tree_Img"+u+id); if(element1!=null){ element1.src=this.rP+"images/square.gif"; element1.onclick=function(){ NTree.design3.buildChilds(id, parseInt(element1.parentNode.parentNode.parentNode.parentNode.parentNode.style.paddingLeft), u);}
}
var element=document.getElementById("Tree_Img"+u+id); var parentId=parseInt(element.nextSibling.innerHTML); var telement=null; telement=element.parentNode.parentNode.parentNode.parentNode.parentNode; var i=1; while(telement){ if(this.isDelete(telement, parentId)){ telement.parentNode.removeChild(telement.nextSibling);}
else{ break;}
i++;}
}, getParent:function(){ var arr=new Array(); var i=0; var k=0; while(i<this.it.length){ if(this.it[i][1]==0){ arr[k]=this.it[i]; k++;}
i++;}
return arr;}, getChilds:function(id){ var arr=new Array(); var i=0; var k=0; while(i<this.it.length){ if(this.it[i][1]==id.toString()){ arr[k]=this.it[i]; k++;}
i++;}
return arr;}, getNode:function(id){ var i=0; while(i<this.it.length){ if(this.it[i][0]==id.toString()){ return this.it[i];}
i++;}
return 0;}, isOpen:function(id, u){ var re=false; var element=document.getElementById("Tree_A"+u+id); if(element!=null){ re=true;}
return re;}, hasChild:function(id){ var i=0; var isChild=false; while(i<this.it.length){ if(this.it[i][1]==id.toString()){ isChild=true; break;}
i++;}
return isChild;}, isDelete:function(element, parentId){ var re=true; if(element.nextSibling!=null){ var str=element.nextSibling.firstChild.firstChild.firstChild.firstChild.firstChild.nextSibling.innerHTML; var currParentId=parseInt(str); if(parentId==currParentId){ re=false; return re;}
return re;}
else{ re=false; return re;}
}
}
function getTypeFromNewTree(hiddenTagId, tagId, id, name){ var elementHiddenTag=document.getElementById(hiddenTagId); if(elementHiddenTag!=null){ elementHiddenTag.value=id;}
var elementTag=document.getElementById(tagId); if(elementTag!=null){ elementTag.value=name;}
}


/* scroll1 */
if(typeof(Scroll)=='undefined') var Scroll={}
Scroll.design1={ tweenDiv:null, rP:Gatex.getStaticContextPath()+"/jscripts/scroll/", buildAlertImage:function(i){ var str=''; str+='<img src="'+this.rP+'images/'+'alert3_'+i+'.gif" border="0" hspace="5" vspace="5"/>'; var element=document.getElementById("ScrollD1AlertImage"+this.u); if(element!=null){ element.innerHTML=str;}
}, imageUpDown:function(target, subTarget){ var div=document.getElementById(subTarget); var element=document.getElementById(target); if(div!=null && element!=null){ clearTimeout(Scroll.design1.tweenDiv); Scroll.design1.tweenDiv=null; Scroll.design1.tweenDivUp(subTarget, 4, div.offsetTop, ((-1)*div.offsetHeight+element.offsetHeight));}
}, imageDownDown:function(target, subTarget){ var div=document.getElementById(subTarget); var element=document.getElementById(target); if(div!=null && element!=null){ clearTimeout(Scroll.design1.tweenDiv); Scroll.design1.tweenDiv=null; Scroll.design1.tweenDivDown(subTarget, 4, div.offsetTop, 0);}
}, stop:function(){ if(Scroll.design1.tweenDiv!=null){ clearTimeout(Scroll.design1.tweenDiv); Scroll.design1.tweenDiv=null;}
}, tweenDivUp:function(subTarget, step, top, limit){ if(top>limit){ this.buildAlertImage('m'); var element=document.getElementById(subTarget); if(element!=null){ if(top-limit<step){ top=top-(top-limit);}
else{ top-=step;}
element.style.top=top+"px"; var time=0; if(Gatex.isIe()){ time=15;}
else if(Gatex.isMozilla()){ time=1;}
else if(Gatex.isNetscape7()){ time=1;}
else{ time=1;}
this.tweenDiv = setTimeout("Scroll.design1.tweenDivUp('"+subTarget+"', "+step+", "+top+", "+limit+")", time);}
}
else{ clearTimeout(this.tweenDiv); this.tweenDiv=null; this.buildAlertImage('d');}
}, tweenDivDown:function(subTarget, step, top, limit){ if(top<limit){ this.buildAlertImage('m'); var element=document.getElementById(subTarget); if(element!=null){ if(limit-top<step){ top=top+(limit-top);}
else{ top+=step;}
element.style.top=top+"px"; var time=0; if(Gatex.isIe()){ time=15;}
else if(Gatex.isMozilla()){ time=1;}
else if(Gatex.isNetscape7()){ time=1;}
else{ time=1;}
this.tweenDiv=setTimeout("Scroll.design1.tweenDivDown('"+subTarget+"', "+step+", "+top+", "+limit+")", time);}
}
else{ clearTimeout(this.tweenDiv); this.tweenDiv=null; this.buildAlertImage('u');}
}
}
Scroll.design2={ tweenDiv:null, rP:"../../../scripts/scroll/", init:function(){ }, buildAlertImage:function(i){ try{ var str=''; str+='<img src="'+this.rP+'images/'+'alert3_'+i+'.gif" border="0" hspace="5" vspace="5"/>'; var element=document.getElementById("ScrollD2AlertImage"+this.u); if(element!=null){ element.innerHTML=str;}
}
catch(e){ }
}, imageRightDown:function(target, subTarget){ var div=document.getElementById(subTarget); var element=document.getElementById(target); if(div!=null && element!=null){ clearTimeout(Scroll.design2.tweenDiv); Scroll.design2.tweenDiv=null; Scroll.design2.tweenDivUp(subTarget, 4, div.offsetLeft, ((-1)*div.offsetWidth+element.offsetWidth));}
}, imageLeftDown:function(target, subTarget){ var div=document.getElementById(subTarget); var element=document.getElementById(target); if(div!=null && element!=null){ clearTimeout(Scroll.design2.tweenDiv); Scroll.design2.tweenDiv=null; Scroll.design2.tweenDivDown(subTarget, 4, div.offsetLeft, 0);}
}, stop:function(){ if(Scroll.design2.tweenDiv!=null){ clearTimeout(Scroll.design2.tweenDiv); Scroll.design2.tweenDiv=null;}
}, tweenDivUp:function(subTarget, step, top, limit){ if(top>limit){ this.buildAlertImage('m'); var element=document.getElementById(subTarget); if(top-limit<step){ top=top-(top-limit);}
else{ top-=step;}
element.style.left=top+"px"; var time=0; if(Gatex.isIe()){ time=15;}
else if(Gatex.isMozilla()){ time=1;}
else if(Gatex.isNetscape7()){ time=1;}
else{ time=1;}
this.tweenDiv=setTimeout("Scroll.design2.tweenDivUp('"+subTarget+"', "+step+", "+top+", "+limit+")", time);}
else{ clearTimeout(this.tweenDiv); Scroll.design2.tweenDiv=null; this.buildAlertImage('d');}
}, tweenDivDown:function(subTarget, step, top, limit){ if(top<limit){ this.buildAlertImage('m'); var element=document.getElementById(subTarget); if(limit-top<step){ top=top+(limit-top);}
else{ top+=step;}
element.style.left=top+"px"; var time=0; if(Gatex.isIe()){ time=15;}
else if(Gatex.isMozilla()){ time=1;}
else if(Gatex.isNetscape7()){ time=1;}
else{ time=1;}
this.tweenDiv=setTimeout("Scroll.design2.tweenDivDown('"+subTarget+"', "+step+", "+top+", "+limit+")", time);}
else{ clearTimeout(this.tweenDiv); Scroll.design2.tweenDiv=null; this.buildAlertImage('u');}
}
}
Scroll.design3={ init:function(aT, tar, u, iW, scrH, scL, scrPrevButtonId, scrNextButtonId, type){ this.u=u; this.it=new Array(); var element=document.getElementById(aT); if(element!=null){ this.it=Gatex.getArrayByTarget(aT); myHM.pushDoubleArray(this.it, "ScrollD3_"+this.u+'_It'); myHM.put('ScrollD3_'+this.u+'_ItW', new String(this.it.length)); myHM.put('ScrollD3_'+this.u+'_ItH', new String(1)); this.tar=tar; this.iW=iW; this.scrH=scrH; this.scL=scL; myHM.put('ScrollD3_'+this.u+'_scL', new String(this.scL)); this.tweenLeft=null; this.tweenRight=null; this.buttonOnclick=null; this.scrPrevButtonId=scrPrevButtonId; myHM.put('ScrollD3_'+this.u+'_scrPrevButtonId', new String(this.scrPrevButtonId)); this.scrNextButtonId=scrNextButtonId; myHM.put('ScrollD3_'+this.u+'_scrNextButtonId', new String(this.scrNextButtonId)); this.type=type; this.scI=0; if(this.type=="relatedContent"){ this.cellpadding=5; this.cellspacing=5; this.tdBorder=1; this.tdBorderColor="#BABABA"; this.tableBgColor="#EBEFF0"; this.tdBgColor="#FFFFFF";}
else if(this.type=="inside"){ this.cellpadding=5; this.cellspacing=1; this.tdBorder=0; this.tdBorderColor="#FFFFFF"; this.tableBgColor="#BBBBBB"; this.tdBgColor="#FFFFFF";}
myHM.put('ScrollD3_'+this.u+'_ScI', new String(this.scI)); this.buildScr(); this.buildAlertImage(this.scI, this.it.length, this.scL); var element=document.getElementById(this.tar); if(element!=null){ element.className="ScrollD3_Scr";; element.style.width=(this.scL*(this.iW+(2*this.cellpadding+this.cellspacing))+this.cellspacing+2*this.scL*this.tdBorder)+"px"; element.style.height=this.scrH+"px";}
Gatex.setPrevNextButtonStyle(this.scrPrevButtonId+this.u, this.scrNextButtonId+this.u, 0, this.it.length, this.scL);}
}, buildScr:function(){ var str=''; str+='<div id="scrollD4_Data'+this.u+'" class="ScrollD3_Data"><table height="100%" border="0" cellpadding="'+this.cellpadding+'" cellspacing="'+this.cellspacing+'" style="background:'+this.tableBgColor+';"><tr>'; var i=0; while(i<this.it.length){ str+='<td width="'+this.iW+'" valign="top" style="border:'+this.tdBorder+'px solid '+this.tdBorderColor+'; background:'+this.tdBgColor+';">'; if(this.it[i][0]!=""){ str+='<div style="width:'+this.iW+'px; height:100%;">' + this.it[i][0] + '</div>';}
str+='</td>'; i++;}
str+='</tr></table></div>'; var element=document.getElementById(this.tar); if(element!=null){ element.innerHTML+=str;}
}, buildAlertImage:function(currIndex, length, scrLength){ var i; var j; if(length-scrLength>1) i=3; else i=2; if (currIndex==0) j="l"; else if (currIndex==length-scrLength) j="r"; else j="c"; try{ var str=''; str+='<img src="'+this.rP+'images/alert'+i+'_'+j+'.gif" border="0" hspace="5" vspace="0"/>'; var element=document.getElementById("scrollD4_AlertImage"+this.u); if(element!=null){ element.innerHTML=str;}
}
catch(e){}
}, scrOnClick:function(id, u){ window.alert("ta screen hesegt darsan baina.");}, scrNextOnClick:function(id, u){ this.u=u; this.scI=parseInt(myHM.get('ScrollD3_'+this.u+'_ScI')); this.it=myHM.getDoubleArray('ScrollD3_'+this.u+'_It', myHM.get('ScrollD3_'+this.u+'_ItW'), myHM.get('ScrollD3_'+this.u+'_ItH')); if(this.tweenLeft==null && this.tweenRight==null){ this.scL=parseInt(myHM.get('ScrollD3_'+this.u+'_scL')); if(this.scI<this.it.length-this.scL){ this.scI++; this.scrPrevButtonId=myHM.get('ScrollD3_'+this.u+'_scrPrevButtonId'); this.scrNextButtonId=myHM.get('ScrollD3_'+this.u+'_scrNextButtonId'); Gatex.setPrevNextButtonStyle(this.scrPrevButtonId+this.u, this.scrNextButtonId+this.u, this.scI, this.it.length, this.scL); this.buildAlertImage(this.scI, this.it.length, this.scL); var button=null; try{ button=document.getElementById(id); this.buttonOnclick=button.onclick; button.onclick="void(null);";}
catch(e){}
var element=null; try{ element=document.getElementById("scrollD4_Data"+this.u);}
catch(e){}
this.moveLeft(element.offsetLeft, element.offsetLeft-this.iW-(2*this.cellpadding+this.cellspacing+2*this.tdBorder), id);}
}
myHM.put('ScrollD3_'+this.u+'_ScI', new String(this.scI));}, scrPrevOnClick:function(id, u){ this.u=u; this.scI=parseInt(myHM.get('ScrollD3_'+this.u+'_ScI')); this.it=myHM.getDoubleArray('ScrollD3_'+this.u+'_It', myHM.get('ScrollD3_'+this.u+'_ItW'), myHM.get('ScrollD3_'+this.u+'_ItH')); if(this.tweenLeft==null && this.tweenRight==null){ this.scL=parseInt(myHM.get('ScrollD3_'+this.u+'_scL')); if(this.scI>0){ this.scI--; this.scrPrevButtonId=myHM.get('ScrollD3_'+this.u+'_scrPrevButtonId'); this.scrNextButtonId=myHM.get('ScrollD3_'+this.u+'_scrNextButtonId'); Gatex.setPrevNextButtonStyle(this.scrPrevButtonId+this.u, this.scrNextButtonId+this.u, this.scI, this.it.length, this.scL); this.buildAlertImage(this.scI, this.it.length, this.scL); var button=null; try{ button=document.getElementById(id); this.buttonOnclick=button.onclick; button.onclick="void(null);";}
catch(e){}
var element=document.getElementById("scrollD4_Data"+this.u); if(element!=null){ this.moveRight(element.offsetLeft, element.offsetLeft + this.iW+(2*this.cellpadding+this.cellspacing+2*this.tdBorder), id);}
}
}
myHM.put('ScrollD3_'+this.u+'_ScI', new String(this.scI));}, moveLeft:function(left, limit, id){ if(left>limit){ var element=document.getElementById("scrollD4_Data"+this.u); var step=10; if(left-limit<step) left=left-(left-limit); else left-=step; element.style.left=left+"px"; var time=0; if(Gatex.isIe()) time=20; else if(Gatex.isMozilla()) time=1; else if(Gatex.isNetscape7()) time=1; else time=1; this.tweenLeft=setTimeout("Scroll.design3.moveLeft("+left+", "+limit+", '"+id+"')", time);}
else{ try{ clearTimeout(this.tweenLeft); this.tweenLeft=null;}
catch(e){}
var button=null; try{ button=document.getElementById(id); button.onclick=this.buttonOnclick;}
catch(e){}
}
}, moveRight:function(left, limit, id){ if(left<limit){ var element=document.getElementById("scrollD4_Data"+this.u); var step=10; if(limit-left<step) left=left+(limit-left); else left+=step; element.style.left=left+"px"; var time=0; if(Gatex.isIe()) time=20; else if(Gatex.isMozilla()) time=1; else if(Gatex.isNetscape7()) time=1; else time=1; this.tweenRight=setTimeout("Scroll.design3.moveRight("+left+", "+limit+", '"+id+"')", time);}
else { try { clearTimeout(this.tweenRight); this.tweenRight=null;}
catch(e){}
var button=null; try { button=document.getElementById(id); button.onclick=this.buttonOnclick;}
catch(e){}
}
}
}
Scroll.design4={ init:function(aT, u, content, iW, scrH, scL){ this.u=u; this.it=new Array(); var element=document.getElementById(aT); if(element!=null){ this.it=Gatex.getArrayByTarget(aT); if(this.it.length){ myHM.pushDoubleArray(this.it, "ScrollD4_"+this.u+'_It'); myHM.put('ScrollD4_'+this.u+'_ItW', new String(this.it.length)); myHM.put('ScrollD4_'+this.u+'_ItH', new String(3)); if(content.indexOf("photoNews", 0)!=-1){ var tarr=content.split("|"); this.content=tarr[0]; this.contentId=tarr[1];}
else if(content=="photoAlbum"){ this.content=content;}
else if(content.indexOf("specialNews", 0)!=-1){ var tarr=content.split("|"); this.content=tarr[0]; this.specialNewsView=tarr[1]; this.specialNewsSection=tarr[2];}
this.iW=iW; this.scrH=scrH; this.scL=scL; this.tweenLeft=null; this.tweenRight=null; this.buttonOnclick=null; this.prevButtonId="scrollD4_PrevB"; this.nextButtonId="scrollD4_NextB"; this.scrPrevButtonId="scrollD4_ScrPrevB"; this.scrNextButtonId="scrollD4_ScrNextB"; this.currItemTarget='scrollD4_CurrItemTarget'; this.total='ScrollD4_Total'; this.currItemNumber='ScrollD4_CurrItemNumber'; this.speed='scrollD4_Speed'; this.scI=0; this.cI=0; this.ispause=false; this.isplay=false; myHM.put('ScrollD4_'+this.u+'_CI', new String(this.cI)); myHM.put('ScrollD4_'+this.u+'_ScI', new String(this.scI)); if(this.content=="photoNews"){ this.buildScr();}
else if(this.content=="photoAlbum"){ this.buildScr();}
else if(this.content=="specialNews"){ this.buildScrSpecialNews();}
this.buildAlertImage(this.scI, this.it.length, this.scL); if(this.it.length<2){ if(this.content=="specialNews"){ var elementPlayButton=document.getElementById("scrollD4_PlayB1"); if(elementPlayButton!=null){ elementPlayButton.style.display="none";}
var elementScr=document.getElementById("scrollD4_Target"); if(elementScr!=null){ elementScr.style.display="none";}
}
}
if(this.content!="specialNews"){ var element=document.getElementById('scrollD4_Target'); if(element!=null){ element.className="ScrollD4_Scr"; element.style.width=(this.scL*(this.iW+11)+1)+"px";}
}
Gatex.setPrevNextButtonStyle(this.prevButtonId+this.u, this.nextButtonId+this.u, 0, this.it.length, 1); Gatex.setPrevNextButtonStyle(this.scrPrevButtonId+this.u, this.scrNextButtonId+this.u, 0, this.it.length, this.scL); this.setTotal(); this.setCurrItemNumber(); if(this.content=="photoNews"){ _handleRequest('scrollD4_CurrItemTarget', 'core', 'content='+this.content+'&object='+this.content+'Item&action=showItem&view=showItem&newsId='+this.contentId+'&photoId='+this.it[this.cI][0],false);}
else if(this.content=="photoAlbum"){ _handleRequest('scrollD4_CurrItemTarget', 'core', 'content='+this.content+'&object='+this.content+'Item&action=showItem&view=showItem&photoName='+this.it[this.cI][2]+'&photoId='+this.it[this.cI][0],false);}
else if(this.content=="specialNews"){ _handleRequest('scrollD4_CurrItemTarget','core','content='+this.it[this.cI][1]+'&action=showShortInfo&view='+this.specialNewsView+'&id='+this.it[this.cI][0]+'&section='+this.specialNewsSection,false);}
}
else{ var elementPlayButton=document.getElementById("scrollD4_PlayB1"); if(elementPlayButton!=null){ elementPlayButton.style.display='none';}
var elementPauseButton=document.getElementById("scrollD4_PauseB1"); if(elementPauseButton!=null){ elementPauseButton.style.display='none';}
var elementCurrItemTarget=document.getElementById("scrollD4_CurrItemTarget"); if(elementCurrItemTarget!=null){ elementCurrItemTarget.innerHTML='Энд мэдээлэл алга.';}
}
}
}, buildScrSpecialNews:function(){ var str=''; str+='<table border="0" cellpadding="0" cellspacing="5">'; str+='<tr>'; var i=0; while(i<this.it.length){ str+='<td width="19" height="19" align="center" class="rootSpecial2" onclick="Scroll.design4.scrOnClick('+this.u+', '+i+')">'+(i+1)+'</td>'; i++;}
str+='</tr>'; str+='</table>'; var element=document.getElementById('scrollD4_Target'); if(element!=null){ element.innerHTML=str;}
}, buildScr:function(){ var str=''; str+='<div id="scrollD4_Data'+this.u+'" class="ScrollD4_Data">'; str+='<table border="0" cellpadding="5" cellspacing="1">'; str+='<tr>'; var i=0; while(i<this.it.length){ str+='<td width="'+this.iW+'" height="'+this.scrH+'" valign="middle">'; if(this.it[i][1]!=""){ str+='<div style="width:'+this.iW+'px;">' + this.it[i][1] + '</div>';}
str+='</td>'; i++;}
str+='</tr>'; str+='</table>'; str+='</div>'; var element=document.getElementById('scrollD4_Target'); if(element!=null){ element.innerHTML+=str;}
}, setTotal:function(){ var element=document.getElementById(this.total); if(element!=null){ element.innerHTML=this.it.length;}
}, setCurrItemNumber:function(){ var element=document.getElementById(this.currItemNumber); if(element!=null){ element.innerHTML=(this.cI+1);}
}, showInfo:function(windowTitle, x, y, x1, y1, target){ window.top.Dialog.design1.show(windowTitle, x, y, x1, y1, '_handleRequest("'+target+'", "'+Gatex.getContextPath()+'/core", "content=photo&action=showInfo&view=showInfo&id='+this.it[this.cI][0]+'", false)');}, buildAlertImage:function(currIndex, length, scrLength){ var i; var j; if(length-scrLength>1){ i=3;}
else{ i=2;}
if(currIndex==0){ j="l";}
else if(currIndex==length-scrLength){ j="r";}
else{ j="c";}
var str=''; var element=document.getElementById("scrollD4_AlertImage"+this.u); if(element!=null){ element.innerHTML=str;}
}, scrOnClick:function(u, cI){ this.isplay=false; if(this.tween!=null){ clearTimeout(this.tween); this.tween=null;}
this.cI=cI; myHM.put('ScrollD4_'+this.u+'_CI', new String(this.cI)); if(this.content=="photoNews"){ _handleRequest('scrollD4_CurrItemTarget', 'core', 'content='+this.content+'&object='+this.content+'Item&action=showItem&view=showItem&newsId='+this.contentId+'&photoId='+this.it[this.cI][0],false);}
else if(this.content=="photoAlbum"){ _handleRequest('scrollD4_CurrItemTarget', 'core', 'content='+this.content+'&object='+this.content+'Item&action=showItem&view=showItem&photoName='+this.it[this.cI][2]+'&photoId='+this.it[this.cI][0],false);}
else if(this.content=="specialNews"){ _handleRequest('scrollD4_CurrItemTarget','core','content='+this.it[this.cI][1]+'&action=showShortInfo&view='+this.specialNewsView+'&id='+this.it[this.cI][0]+'&section='+this.specialNewsSection,false);}
Gatex.setPrevNextButtonStyle(this.prevButtonId+this.u, this.nextButtonId+this.u, this.cI, this.it.length, 1); this.setPlayPauseButton('play'); this.ispause=false; this.setCurrItemNumber();}, nextOnClick:function(u){ this.isplay=false; if(this.tween!=null){ clearTimeout(this.tween); this.tween=null;}
this.cI=parseInt(myHM.get('ScrollD4_'+this.u+'_CI')); if(this.cI<this.it.length-1){ this.cI++; myHM.put('ScrollD4_'+this.u+'_CI', new String(this.cI)); Gatex.setPrevNextButtonStyle(this.prevButtonId+this.u, this.nextButtonId+this.u, this.cI, this.it.length, 1); this.setPlayPauseButton('play'); if(this.content=="photoNews"){ _handleRequest('scrollD4_CurrItemTarget', 'core', 'content='+this.content+'&object='+this.content+'Item&action=showItem&view=showItem&newsId='+this.contentId+'&photoId='+this.it[this.cI][0],false);}
else if(this.content=="photoAlbum"){ _handleRequest('scrollD4_CurrItemTarget', 'core', 'content='+this.content+'&object='+this.content+'Item&action=showItem&view=showItem&photoName='+this.it[this.cI][2]+'&photoId='+this.it[this.cI][0],false);}
this.ispause=false; this.setCurrItemNumber();}
}, prevOnClick:function(u){ this.isplay=false; if(this.tween!=null){ clearTimeout(this.tween); this.tween=null;}
this.cI=parseInt(myHM.get('ScrollD4_'+this.u+'_CI')); if(this.cI>0){ this.cI--; myHM.put('ScrollD4_'+this.u+'_CI', new String(this.cI)); Gatex.setPrevNextButtonStyle(this.prevButtonId+this.u, this.nextButtonId+this.u, this.cI, this.it.length, 1); this.setPlayPauseButton('play'); if(this.content=="photoNews"){ _handleRequest('scrollD4_CurrItemTarget', 'core', 'content='+this.content+'&object='+this.content+'Item&action=showItem&view=showItem&newsId='+this.contentId+'&photoId='+this.it[this.cI][0],false);}
else if(this.content=="photoAlbum"){ _handleRequest('scrollD4_CurrItemTarget', 'core', 'content='+this.content+'&object='+this.content+'Item&action=showItem&view=showItem&photoName='+this.it[this.cI][2]+'&photoId='+this.it[this.cI][0],false);}
this.ispause=false; this.setCurrItemNumber();}
}, setPlayPauseButton:function(button){ var play=document.getElementById("scrollD4_PlayB"+this.u); var pause=document.getElementById("scrollD4_PauseB"+this.u); if(play!=null && pause!=null){ if(button=="pause"){ play.style.display='none'; pause.style.display='';}
else if(button=="play"){ play.style.display=''; pause.style.display='none';}
}
}, play:function(u){ this.isplay=true; this.u=u; this.cI=parseInt(myHM.get('ScrollD4_'+this.u+'_CI')); if(!this.ispause){ if(this.cI!=0){ this.cI=-1;}
else{ this.cI=0;}
myHM.put('ScrollD4_'+this.u+'_CI', new String(this.cI));}
else{ this.ispause=false;}
this.setPlayPauseButton('pause'); this.tween=setTimeout('Scroll.design4.play1()', 1000);}, pause:function(u){ this.isplay=false; if(this.tween!=null){ clearTimeout(this.tween); this.tween=null;}
this.setPlayPauseButton('play'); this.ispause=true;}, stop:function(u){ this.isplay=false; clearTimeout(this.tween); this.tween=null; this.cI=0; myHM.put('ScrollD4_'+this.u+'_CI', new String(this.cI)); if(this.content=="photoNews"){ _handleRequest('scrollD4_CurrItemTarget', 'core', 'content='+this.content+'&object='+this.content+'Item&action=showItem&view=showItem&newsId='+this.contentId+'&photoId='+this.it[this.cI][0],false);}
else if(this.content=="photoAlbum"){ _handleRequest('scrollD4_CurrItemTarget', 'core', 'content='+this.content+'&object='+this.content+'Item&action=showItem&view=showItem&photoName='+this.it[this.cI][2]+'&photoId='+this.it[this.cI][0],false);}
Gatex.setPrevNextButtonStyle(this.prevButtonId+this.u, this.nextButtonId+this.u, this.cI, this.it.length, 1); this.setPlayPauseButton('play'); this.ispause=false; this.setCurrItemNumber();}, play1:function(){ this.cI=parseInt(myHM.get('ScrollD4_'+this.u+'_CI')); if(this.cI<this.it.length-1){ this.cI++; myHM.put('ScrollD4_'+this.u+'_CI', new String(this.cI)); if(this.content=="photoNews"){ _handleRequest('scrollD4_CurrItemTarget', 'core', 'content='+this.content+'&object='+this.content+'Item&action=showItem&view=showItem&newsId='+this.contentId+'&photoId='+this.it[this.cI][0],false);}
else if(this.content=="photoAlbum"){ _handleRequest('scrollD4_CurrItemTarget', 'core', 'content='+this.content+'&object='+this.content+'Item&action=showItem&view=showItem&photoName='+this.it[this.cI][2]+'&photoId='+this.it[this.cI][0],false);}
else if(this.content=="specialNews"){ _handleRequest('scrollD4_CurrItemTarget','core','content='+this.it[this.cI][1]+'&action=showShortInfo&view='+this.specialNewsView+'&id='+this.it[this.cI][0]+'&section='+this.specialNewsSection,false);}
Gatex.setPrevNextButtonStyle(this.prevButtonId+this.u, this.nextButtonId+this.u, this.cI, this.it.length, 1); this.setCurrItemNumber();}
else{ this.isplay=false; clearTimeout(this.tween); this.cI=0; myHM.put('ScrollD4_'+this.u+'_CI', new String(this.cI)); if(this.content=="photoNews"){ _handleRequest('scrollD4_CurrItemTarget', 'core', 'content='+this.content+'&object='+this.content+'Item&action=showItem&view=showItem&newsId='+this.contentId+'&photoId='+this.it[this.cI][0],false);}
else if(this.content=="photoAlbum"){ _handleRequest('scrollD4_CurrItemTarget', 'core', 'content='+this.content+'&object='+this.content+'Item&action=showItem&view=showItem&photoName='+this.it[this.cI][2]+'&photoId='+this.it[this.cI][0],false);}
else if(this.content=="specialNews"){_handleRequest('scrollD4_CurrItemTarget','core','content='+this.it[this.cI][1]+'&action=showShortInfo&view='+this.specialNewsView+'&id='+this.it[this.cI][0]+'&section='+this.specialNewsSection,false);}
Gatex.setPrevNextButtonStyle(this.prevButtonId+this.u, this.nextButtonId+this.u, this.cI, this.it.length, 1); this.setPlayPauseButton('play'); this.ispause=false; this.setCurrItemNumber();}
}, scrPrevOnClick:function(id, u){ this.u=u; this.scI=parseInt(myHM.get('ScrollD4_'+this.u+'_ScI')); this.it=myHM.getDoubleArray('ScrollD4_'+this.u+'_It', myHM.get('ScrollD4_'+this.u+'_ItW'), myHM.get('ScrollD4_'+this.u+'_ItH')); if(this.tweenLeft==null && this.tweenRight==null){ if(this.scI<this.it.length-this.scL){ this.scI++; Gatex.setPrevNextButtonStyle(this.scrPrevButtonId+this.u, this.scrNextButtonId+this.u, this.scI, this.it.length, this.scL); this.buildAlertImage(this.scI, this.it.length, this.scL); var button=null; try{ button=document.getElementById(id); this.buttonOnclick=button.onclick; button.onclick="void(null);";}
catch(e){}
var element=null; try{ element=document.getElementById("scrollD4_Data"+this.u);}
catch(e){}
this.moveLeft(element.offsetLeft, element.offsetLeft-this.iW-11, id);}
}
myHM.put('ScrollD4_'+this.u+'_ScI', new String(this.scI));}, scrNextOnClick:function(id, u){ this.u=u; this.scI=parseInt(myHM.get('ScrollD4_'+this.u+'_ScI')); this.it=myHM.getDoubleArray('ScrollD4_'+this.u+'_It', myHM.get('ScrollD4_'+this.u+'_ItW'), myHM.get('ScrollD4_'+this.u+'_ItH')); if(this.tweenLeft==null && this.tweenRight==null){ if(this.scI>0){ this.scI--; Gatex.setPrevNextButtonStyle(this.scrPrevButtonId+this.u, this.scrNextButtonId+this.u, this.scI, this.it.length, this.scL); this.buildAlertImage(this.scI, this.it.length, this.scL); var button=null; try{ button=document.getElementById(id); this.buttonOnclick=button.onclick; button.onclick="void(null);";}
catch(e){}
var element=document.getElementById("scrollD4_Data"+this.u); if(element!=null){ this.moveRight(element.offsetLeft, element.offsetLeft + this.iW+11, id);}
}
}
myHM.put('ScrollD4_'+this.u+'_ScI', new String(this.scI));}, moveLeft:function(left, limit, id){ if(left>limit){ var element=document.getElementById("scrollD4_Data"+this.u); var step=10; if(left-limit<step){ left=left-(left-limit);}
else{ left-=step;}
element.style.left=left+"px"; var time=0; if(Gatex.isIe()){ time=20;}
else if(Gatex.isMozilla()){ time=1;}
else if(Gatex.isNetscape7()){ time=1;}
else{ time=1;}
this.tweenLeft=setTimeout("Scroll.design4.moveLeft("+left+", "+limit+", '"+id+"')", time);}
else{ clearTimeout(this.tweenLeft); this.tweenLeft=null; var button=document.getElementById(id); if(button!=null){ button.onclick=this.buttonOnclick;}
}
}, moveRight:function(left, limit, id){ if(left<limit){ var element=document.getElementById("scrollD4_Data"+this.u); var step=10; if(limit-left<step){ left=left+(limit-left);}
else{ left+=step;}
element.style.left=left+"px"; var time=0; if(Gatex.isIe()){ time=20;}
else if(Gatex.isMozilla()){ time=1;}
else if(Gatex.isNetscape7()){ time=1;}
else{ time=1;}
this.tweenRight=setTimeout("Scroll.design4.moveRight("+left+", "+limit+", '"+id+"')", time);}
else{ clearTimeout(this.tweenRight); this.tweenRight=null; var button=document.getElementById(id); if(button!=null){ button.onclick=this.buttonOnclick;}
}
}
}


/*inside*/
Inside={isTween:true,step:186,prev:function(id){var _2=$(id);if(_2!=null){this.tween(_2,parseInt(_2.offsetLeft),parseInt(_2.offsetLeft)+this.step);}},next:function(id){var _4=$(id);if(_4!=null){this.tween(_4,parseInt(_4.offsetLeft),parseInt(_4.offsetLeft)-this.step);}},tween:function(_5,_6,_7){var _8=new Tween(_5.style,"left",Tween.regularEaseOut,_6,_7,0.5,"px");_8.onMotionFinished=function(){Inside.isTween=true;Inside.move(_5,_6,_7);};if(this.isTween){_8.start();this.isTween=false;}},move:function(_9,_a,_b){if(_a>_b){_9.insert({bottom:_9.childElements()[0]});_9.style.left=(parseInt(_9.style.left)+this.step)+"px";}else{_9.insert({top:_9.childElements()[_9.childElements().length-1]});_9.style.left=(parseInt(_9.style.left)-this.step)+"px";}},hideButton:function(_c){if(_c<=6){var _d=$("insideContent_Home");if(_d!=null){_d.style.left="0px";}}if(_c<=6){var _e=$("insideButtonPrev");if(_e!=null){_e.style.visibility="hidden";}var _f=$("insideButtonNext");if(_f!=null){_f.style.visibility="hidden";}}}};





/*tween*/
function Delegate() {}
Delegate.create = function (o, f) { var a = new Array() ; var l = arguments.length ; for(var i = 2 ; i < l ; i++) a[i - 2] = arguments[i] ; return function() { var aP = [].concat(arguments, a) ; f.apply(o, aP);}
}
Tween = function(obj, prop, func, begin, finish, duration, suffixe){ this.init(obj, prop, func, begin, finish, duration, suffixe)
}
var t = Tween.prototype; t.obj = new Object(); t.prop=''; t.func = function (t, b, c, d) { return c*t/d + b;}; t.begin = 0; t.change = 0; t.prevTime = 0; t.prevPos = 0; t.looping = false; t._duration = 0; t._time = 0; t._pos = 0; t._position = 0; t._startTime = 0; t._finish = 0; t.name = ''; t.suffixe = ''; t._listeners = new Array(); t.setTime = function(t){ this.prevTime = this._time; if (t > this.getDuration()) { if (this.looping) { this.rewind (t - this._duration); this.update(); this.broadcastMessage('onMotionLooped',{target:this,type:'onMotionLooped'});} else { this._time = this._duration; this.update(); this.stop(); this.broadcastMessage('onMotionFinished',{target:this,type:'onMotionFinished'});}
} else if (t < 0) { this.rewind(); this.update();} else { this._time = t; this.update();}
}
t.getTime = function(){ return this._time;}
t.setDuration = function(d){ this._duration = (d == null || d <= 0) ? 100000 : d;}
t.getDuration = function(){ return this._duration;}
t.setPosition = function(p){ this.prevPos = this._pos; var a = this.suffixe != '' ? this.suffixe : ''; this.obj[this.prop] = Math.round(p) + a; this._pos = p; this.broadcastMessage('onMotionChanged',{target:this,type:'onMotionChanged'});}
t.getPosition = function(t){ if (t == undefined) t = this._time; return this.func(t, this.begin, this.change, this._duration);}; t.setFinish = function(f){ this.change = f - this.begin;}; t.geFinish = function(){ return this.begin + this.change;}; t.init = function(obj, prop, func, begin, finish, duration, suffixe){ if (!arguments.length) return; this._listeners = new Array(); this.addListener(this); if(suffixe) this.suffixe = suffixe; this.obj = obj; this.prop = prop; this.begin = begin; this._pos = begin; this.setDuration(duration); if (func!=null && func!='') { this.func = func;}
this.setFinish(finish);}
t.start = function(){ this.rewind(); this.startEnterFrame(); this.broadcastMessage('onMotionStarted',{target:this,type:'onMotionStarted'});}
t.rewind = function(t){ this.stop(); this._time = (t == undefined) ? 0 : t; this.fixTime(); this.update();}
t.fforward = function(){ this._time = this._duration; this.fixTime(); this.update();}
t.update = function(){ this.setPosition(this.getPosition(this._time));}
t.startEnterFrame = function(){ this.stopEnterFrame(); this.isPlaying = true; this.onEnterFrame();}
t.onEnterFrame = function(){ if(this.isPlaying) { this.nextFrame(); setTimeout(Delegate.create(this, this.onEnterFrame), 0);}
}
t.nextFrame = function(){ this.setTime((this.getTimer() - this._startTime) / 1000);}
t.stop = function(){ this.stopEnterFrame(); this.broadcastMessage('onMotionStopped',{target:this,type:'onMotionStopped'});}
t.stopEnterFrame = function(){ this.isPlaying = false;}
t.continueTo = function(finish, duration){ this.begin = this._pos; this.setFinish(finish); if (this._duration != undefined)
this.setDuration(duration); this.start();}
t.resume = function(){ this.fixTime(); this.startEnterFrame(); this.broadcastMessage('onMotionResumed',{target:this,type:'onMotionResumed'});}
t.yoyo = function (){ this.continueTo(this.begin,this._time);}
t.addListener = function(o){ this.removeListener (o); return this._listeners.push(o);}
t.removeListener = function(o){ var a = this._listeners; var i = a.length; while (i--) { if (a[i] == o) { a.splice (i, 1); return true;}
}
return false;}
t.broadcastMessage = function(){ var arr = new Array(); for(var i = 0; i < arguments.length; i++){ arr.push(arguments[i])
}
var e = arr.shift(); var a = this._listeners; var l = a.length; for (var i=0; i<l; i++){ if(a[i][e])
a[i][e].apply(a[i], arr);}
}
t.fixTime = function(){ this._startTime = this.getTimer() - this._time * 1000;}
t.getTimer = function(){ return new Date().getTime() - this._time;}
Tween.backEaseIn = function(t,b,c,d,a,p){ if (s == undefined) var s = 1.70158; return c*(t/=d)*t*((s+1)*t - s) + b;}
Tween.backEaseOut = function(t,b,c,d,a,p){ if (s == undefined) var s = 1.70158; return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;}
Tween.backEaseInOut = function(t,b,c,d,a,p){ if (s == undefined) var s = 1.70158; if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;}
Tween.elasticEaseIn = function(t,b,c,d,a,p){ if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (!a || a < Math.abs(c)) { a=c; var s=p/4;}
else
var s = p/(2*Math.PI) * Math.asin (c/a); return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;}
Tween.elasticEaseOut = function (t,b,c,d,a,p){ if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (!a || a < Math.abs(c)) { a=c; var s=p/4;}
else var s = p/(2*Math.PI) * Math.asin (c/a); return (a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b);}
Tween.elasticEaseInOut = function (t,b,c,d,a,p){ if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) var p=d*(.3*1.5); if (!a || a < Math.abs(c)) {var a=c; var s=p/4;}
else var s = p/(2*Math.PI) * Math.asin (c/a); if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;}
Tween.bounceEaseOut = function(t,b,c,d){ if ((t/=d) < (1/2.75)) { return c*(7.5625*t*t) + b;} else if (t < (2/2.75)) { return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;} else if (t < (2.5/2.75)) { return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;} else { return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;}
}
Tween.bounceEaseIn = function(t,b,c,d){ return c - Tween.bounceEaseOut (d-t, 0, c, d) + b;}
Tween.bounceEaseInOut = function(t,b,c,d){ if (t < d/2) return Tween.bounceEaseIn (t*2, 0, c, d) * .5 + b; else return Tween.bounceEaseOut (t*2-d, 0, c, d) * .5 + c*.5 + b;}
Tween.strongEaseInOut = function(t,b,c,d){ return c*(t/=d)*t*t*t*t + b;}
Tween.regularEaseIn = function(t,b,c,d){ return c*(t/=d)*t + b;}
Tween.regularEaseOut = function(t,b,c,d){ return -c *(t/=d)*(t-2) + b;}
Tween.regularEaseInOut = function(t,b,c,d){ if ((t/=d/2) < 1) return c/2*t*t + b; return -c/2 * ((--t)*(t-2) - 1) + b;}
Tween.strongEaseIn = function(t,b,c,d){ return c*(t/=d)*t*t*t*t + b;}
Tween.strongEaseOut = function(t,b,c,d){ return c*((t=t/d-1)*t*t*t*t + 1) + b;}
Tween.strongEaseInOut = function(t,b,c,d){ if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; return c/2*((t-=2)*t*t*t*t + 2) + b;}



/* dialog */
var Dialog={}
var dummy_mc=null; Dialog.design1={ fX:0, fY:0, tween:null, isOpen:false, init:function(){ }, show:function(windowTitle, x, y, x1, y1, content){ if(!this.isOpen){ this.windowTitle=windowTitle; this.fX=x; this.fY=y; this.content=content; dummy_mc = document.getElementById('dialogIframe'); dummy_mc.style.left=x+"px"; dummy_mc.style.top=y+"px"; dummy_mc.style.width='30px'; dummy_mc.style.height='16px'; dummy_mc.style.display=''; ctop=0; if(Gatex.isMozilla()){ ctop=parseInt(window.pageYOffset);}
else if(Gatex.isIe()){ ctop=parseInt(document.documentElement.scrollTop);}
else if(Gatex.isOpera()){ ctop=parseInt(window.pageYOffset);}
else{ ctop=parseInt(document.body.scrollTop);}
this.isOpen=true; zzX = new Tween(document.getElementById('dialogIframe').style, 'left', Tween.backEaseInOut, parseInt(dummy_mc.style.left), x1, 1, 'px'); zzX.start(); zzY = new Tween(document.getElementById('dialogIframe').style, 'top', Tween.backEaseInOut, parseInt(dummy_mc.style.top), ctop+y1, 1, 'px'); zzY.onMotionFinished = function(){ if(Dialog.design1.isOpen){ if(Dialog.design1.windowTitle=='Сэтгэгдэл'){ dummy_mc.src=Gatex.getContextPath()+'/jscripts/dialog/blankComment.html';}
else{ dummy_mc.src=Gatex.getContextPath()+'/jscripts/dialog/blank.html';}
dummy_mc.className='Dialog_Window_Opacity'; dummy_mc.style.width='380px'; dummy_mc.style.height='400px'; dummy_mc.style.display='';}
else{ dummy_mc.style.display='none';}
}; zzY.start();}
}, hide:function(){ dummy_mc = document.getElementById('dialogIframe'); if(dummy_mc!=null){ dummy_mc.style.width=30+'px'; dummy_mc.style.height=16+'px'; dummy_mc.className='Dialog_Window_UnOpacity'; this.isOpen=false; zzX = new Tween(document.getElementById('dialogIframe').style, 'left', Tween.backEaseInOut, parseInt(dummy_mc.style.left), this.fX, 1, 'px'); zzX.start(); zzY = new Tween(document.getElementById('dialogIframe').style, 'top', Tween.backEaseInOut, parseInt(dummy_mc.style.top), this.fY, 1, 'px'); zzY.onMotionFinished = function(){ dummy_mc.style.display='none';}; zzY.start();}
}
}




/* calendar */
var Calendar={ smallWeek:new Array("Да", "Мя", "Лх", "Пү", "Ба", "Бя", "Ня"), smallMonth:new Array("01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"), smallDay:new Array("01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31"), format:"yyyy/mm/dd", init:function(format){ this.firstIndex=0; this.format=format;}, buildTinyCalendar:function(target){ var str=''; str+='<table border="0" cellpadding="0" cellspacing="0"><tr>'; var i=this.firstIndex; var isave=i; while(i<=isave+6){ var tyear=this.dayAddSub(this.currYear, this.currMonth, this.currDay, "+", i, "year"); var tmonth=this.dayAddSub(this.currYear, this.currMonth, this.currDay, "+", i, "month"); var tday=this.dayAddSub(this.currYear, this.currMonth, this.currDay, "+", i, "day"); str+='<td class="Cal_Week">'+this.smallWeek[this.getWeekDay(tyear, tmonth, tday)-1]+'</td>'; i++;}
str+='</tr></table>'; str+='<table border="0" cellpadding="0" cellspacing="0"><tr>'; i=this.firstIndex; isave=i; while(i<=isave+6){ var className=''; if(this.dayAddSub(this.currYear, this.currMonth, this.currDay, "+", i, "day")==this.currDay){ className='Cal_CurrDay';}
else{ className='Cal_Day';}
var tday=0; tday=this.dayAddSub(this.currYear, this.currMonth, this.currDay, "+", i, "day"); if(tday<10){ tday="0"+tday;}
str+='<td class="Cal_Day"><a id="calA_'+this.u+'_'+i+'" href="javascript:Calendar.onclick(\''+this.u+'\', \''+this.callback+'\', \''+this.dayAddSub(this.currYear, this.currMonth, this.currDay, "+", i, "date")+'\', '+isave+', '+i+')" class="'+className+'">'+tday+'</a></td>'; i++;}
str+='</tr></table>'; var element=document.getElementById(target); if(element!=null){ element.innerHTML=str;}
}, show:function(u, target, callback, year, month, day, prevLimit, firstIndex, nextLimit){ this.u=u; this.callback=callback; this.currYear=year; this.currMonth=month; this.currDay=day; this.prevLimit=prevLimit; this.firstIndex=firstIndex; this.nextLimit=nextLimit; this.buildTinyCalendar(target);}, onclick:function(u, callback, date, isave, cI){ this.u=u; this.callback=callback; eval(this.callback+"('"+date+"')"); this.setStyle(isave, cI);}, setStyle:function(isave, cI){ var i=isave; while(i<isave+6){ var className=''; if(this.dayAddSub(this.currYear, this.currMonth, this.currDay, "+", i, "day")==this.currDay){ className='Cal_CurrDay';}
else{ className='Cal_Day';}
var element=document.getElementById('calA_'+this.u+'_'+i); if(element!=null){ element.className=className; if(i==cI){ element.className="Cal_OnclickDay";}
}
i++;}
}, prevDay:function(u, target, callback){ this.u=u; this.callback=callback; if(this.firstIndex>this.prevLimit){ this.firstIndex--;}
this.buildTinyCalendar(target);}, nextDay:function(u, target, callback){ this.u=u; this.callback=callback; if(this.firstIndex<this.nextLimit){ this.firstIndex++;}
this.buildTinyCalendar(target);}, dayAddSub:function(year, month, day, operator, deltaDay, returnType){ var daysave=day; if(operator=="+" && deltaDay>=0 || operator=="-" && deltaDay<0){ day=day+Math.abs(deltaDay); if(Calendar.getTotalDayOfMonth(year, month)<day){ day=Math.abs(deltaDay)-(Calendar.getTotalDayOfMonth(year, month)-daysave); month++; if(month>12){ month=1; year++;}
}
}
else if(operator=="+" && deltaDay<0 || operator=="-" && deltaDay>=0){ day=day-Math.abs(deltaDay); if(day<1){ month--; if(month<1){ month=12; year--;}
day=Calendar.getTotalDayOfMonth(year, month)-(Math.abs(deltaDay)-daysave);}
}
if(returnType=="year") return year; else if(returnType=="month") return month; else if(returnType=="day") return day; else if(returnType=="date"){ if(Calendar.format=="yyyy/mm/dd"){ return year+"/"+month+"/"+day;}
else if(Calendar.format=="yyyy-mm-dd"){ return year+"-"+month+"-"+day;}
else{ return year+"/"+month+"/"+day;}
}
else{ if(Calendar.format=="yyyy/mm/dd"){ return year+"/"+month+"/"+day;}
if(Calendar.format=="yyyy-mm-dd"){ return year+"-"+month+"-"+day;}
else{ return year+"/"+month+"/"+day;}
}
}, getTotalDayOfMonth:function(year, month){ if(month==1) return 31; else if(month==2){ if(year%4){ return 28;} return 29;}
else if(month==3) return 31; else if(month==4) return 30; else if(month==5) return 31; else if(month==6) return 30; else if(month==7) return 31; else if(month==8) return 31; else if(month==9) return 30; else if(month==10) return 31; else if(month==11) return 30; else if(month==12) return 31; else{ return null;}
}, getWeekDayOfMonthFirstDay:function(year, month){ var totalDay=this.getTotalDay(year, month); if(totalDay%7==6) return 1; return totalDay%7+2;}, getWeekDay:function(year, month, day){ var total=0; total=this.getTotalDay(year, month)+day; if(total%7==0) return 1; return total-(parseInt(total/7)*7)+1;}, getTotalDayOfXMonth:function(year, month){ var total=0; var i=1; while(i<=month){ total=total+this.getTotalDayOfMonth(year, i); i++;}
return total;}, getTotalDay:function(year, month) { var total; total = (year - 1980) * 365; total+=parseInt((year - 1980)/4)+1; if(parseInt((year - 1980)/4)>=1 && (year - 1980)%4==0 && month<=2){ total-=1;}
return total+this.getTotalDayOfXMonth(year, month-1);}
}








/* dhtmlHistory */
window.dhtmlHistory = { initialize: function() { if (this.isInternetExplorer() == false) { return;}
if (historyStorage.hasKey("DhtmlHistory_pageLoaded") == false) { this.fireOnNewListener = false; this.firstLoad = true; historyStorage.put("DhtmlHistory_pageLoaded", true);}
else { this.fireOnNewListener = true; this.firstLoad = false;}
}, addListener: function(callback) { this.listener = callback; if (this.fireOnNewListener == true) { this.fireHistoryEvent(this.currentLocation); this.fireOnNewListener = false;}
}, add: function(newLocation, historyData) { var self = this; var addImpl = function() { if (self.currentWaitTime > 0)
self.currentWaitTime = self.currentWaitTime - self.WAIT_TIME; newLocation = self.removeHash(newLocation); var idCheck = document.getElementById(newLocation); if (idCheck != undefined || idCheck != null) { var message = "Exception: History locations can not have " + "the same value as _any_ id's " + "that might be in the document, " + "due to a bug in Internet " + "Explorer; please ask the " + "developer to choose a history " + "location that does not match " + "any HTML id's in this " + "document. The following ID " + "is already taken and can not " + "be a location: " + newLocation; throw message;}
historyStorage.put(newLocation, historyData); self.ignoreLocationChange = true; this.ieAtomicLocationChange = true; self.currentLocation = newLocation; window.location.hash = newLocation; if (self.isInternetExplorer())
self.iframe.src = "blank.html?" + newLocation; this.ieAtomicLocationChange = false;}; window.setTimeout(addImpl, this.currentWaitTime); this.currentWaitTime = this.currentWaitTime + this.WAIT_TIME;}, isFirstLoad: function() { if (this.firstLoad == true) { return true;}
else { return false;}
}, isInternational: function() { return false;}, getVersion: function() { return "0.03";}, getCurrentLocation: function() { var currentLocation = this.removeHash(window.location.hash); return currentLocation;}, currentLocation: null, listener: null, iframe: null, ignoreLocationChange: null, WAIT_TIME: 200, currentWaitTime: 0, fireOnNewListener: null, firstLoad: null, ieAtomicLocationChange: null, create: function() { var initialHash = this.getCurrentLocation(); this.currentLocation = initialHash; if (this.isInternetExplorer()) { document.write("<iframe style='border: 0px; width: 1px; " + "height: 1px; position: absolute; bottom: 0px; " + "right: 0px; visibility: visible;' " + "name='DhtmlHistoryFrame' id='DhtmlHistoryFrame' " + "src='blank.html?" + initialHash + "'>" + "</iframe>"); this.WAIT_TIME = 400;}
var self = this; window.onunload = function() { self.firstLoad = null;}; if (this.isInternetExplorer() == false) { if (historyStorage.hasKey("DhtmlHistory_pageLoaded") == false) { this.ignoreLocationChange = true; this.firstLoad = true; historyStorage.put("DhtmlHistory_pageLoaded", true);}
else { this.ignoreLocationChange = false; this.fireOnNewListener = true;}
}
else { this.ignoreLocationChange = true;}
if (this.isInternetExplorer()) { this.iframe = document.getElementById("DhtmlHistoryFrame");}
var self = this; var locationHandler = function() { self.checkLocation();}; setInterval(locationHandler, 100);}, fireHistoryEvent: function(newHash) { var historyData = historyStorage.get(newHash); this.listener.call(null, newHash, historyData);}, checkLocation: function() { if (this.isInternetExplorer() == false
&& this.ignoreLocationChange == true) { this.ignoreLocationChange = false; return;}
if (this.isInternetExplorer() == false
&& this.ieAtomicLocationChange == true) { return;}
var hash = this.getCurrentLocation(); if (hash == this.currentLocation)
return; this.ieAtomicLocationChange = true; if (this.isInternetExplorer()
&& this.getIFrameHash() != hash) { this.iframe.src = "blank.html?" + hash;}
else if (this.isInternetExplorer()) { return;}
this.currentLocation = hash; this.ieAtomicLocationChange = false; this.fireHistoryEvent(hash);}, getIFrameHash: function() { var historyFrame = document.getElementById("DhtmlHistoryFrame"); var doc = historyFrame.contentWindow.document; var hash = new String(doc.location.search); if (hash.length == 1 && hash.charAt(0) == "?")
hash = ""; else if (hash.length >= 2 && hash.charAt(0) == "?")
hash = hash.substring(1); return hash;}, removeHash: function(hashValue) { if (hashValue == null || hashValue == undefined)
return null; else if (hashValue == "")
return ""; else if (hashValue.length == 1 && hashValue.charAt(0) == "#")
return ""; else if (hashValue.length > 1 && hashValue.charAt(0) == "#")
return hashValue.substring(1); else
return hashValue;}, iframeLoaded: function(newLocation) { if (this.ignoreLocationChange == true) { this.ignoreLocationChange = false; return;}
var hash = new String(newLocation.search); if (hash.length == 1 && hash.charAt(0) == "?")
hash = ""; else if (hash.length >= 2 && hash.charAt(0) == "?")
hash = hash.substring(1); if (this.pageLoadEvent != true) { window.location.hash = hash;}
this.fireHistoryEvent(hash);}, isInternetExplorer: function() { var userAgent = navigator.userAgent.toLowerCase(); if (document.all && userAgent.indexOf('msie')!=-1) { return true;}
else { return false;}
}
}; window.historyStorage = { debugging: false, storageHash: new Object(), hashLoaded: false, put: function(key, value) { this.assertValidKey(key); if (this.hasKey(key)) { this.remove(key);}
this.storageHash[key] = value; this.saveHashTable();}, get: function(key) { this.assertValidKey(key); this.loadHashTable(); var value = this.storageHash[key]; if (value == undefined)
return null; else
return value;}, remove: function(key) { this.assertValidKey(key); this.loadHashTable(); delete this.storageHash[key]; this.saveHashTable();}, reset: function() { this.storageField.value = ""; this.storageHash = new Object();}, hasKey: function(key) { this.assertValidKey(key); this.loadHashTable(); if (typeof this.storageHash[key] == "undefined")
return false; else
return true;}, isValidKey: function(key) { if (typeof key != "string")
key = key.toString(); var matcher = /^[a-zA-Z0-9_ \!\@\#\$\%\^\&\*\(\)\+\=\:\;\,\.\/\?\|\\\~\{\}\[\]]*$/; return matcher.test(key);}, storageField: null, init: function() { var styleValue = "position: absolute; top: -1000px; left: -1000px;"; if (this.debugging == true) { styleValue = "width: 30em; height: 30em;";}
var newContent = "<form id='historyStorageForm' " + "method='GET' " + "style='" + styleValue + "'>" + "<textarea id='historyStorageField' " + "style='" + styleValue + "'" + "left: -1000px;' " + "name='historyStorageField'></textarea>" + "</form>"; document.write(newContent); this.storageField = document.getElementById("historyStorageField");}, assertValidKey: function(key) { if (this.isValidKey(key) == false) { throw "Please provide a valid key for " + "win.historyStorage, key= " + key;}
}, loadHashTable: function() { if (this.hashLoaded == false) { var serializedHashTable = this.storageField.value; if (serializedHashTable != "" &&
serializedHashTable != null) { this.storageHash = eval('(' + serializedHashTable + ')');}
this.hashLoaded = true;}
}, saveHashTable: function() { this.loadHashTable(); var serializedHashTable = JSON.stringify(this.storageHash); this.storageField.value = serializedHashTable;}
}; Array.prototype.______array = '______array'; var JSON = { org: 'http://www.JSON.org', copyright: '(c)2005 JSON.org', license: 'http://www.crockford.com/JSON/license.html', stringify: function (arg) { var c, i, l, s = '', v; switch (typeof arg) { case 'object':
if (arg) { if (arg.______array == '______array') { for (i = 0; i < arg.length; ++i) { v = this.stringify(arg[i]); if (s) { s += ',';}
s += v;}
return '[' + s + ']';} else if (typeof arg.toString != 'undefined') { for (i in arg) { v = arg[i]; if (typeof v != 'undefined' && typeof v != 'function') { v = this.stringify(v); if (s) { s += ',';}
s += this.stringify(i) + ':' + v;}
}
return '{' + s + '}';}
}
return 'null'; case 'number':
return isFinite(arg) ? String(arg) : 'null'; case 'string':
l = arg.length; s = '"'; for (i = 0; i < l; i += 1) { c = arg.charAt(i); if (c >= ' ') { if (c == '\\' || c == '"') { s += '\\';}
s += c;} else { switch (c) { case '\b':
s += '\\b'; break; case '\f':
s += '\\f'; break; case '\n':
s += '\\n'; break; case '\r':
s += '\\r'; break; case '\t':
s += '\\t'; break; default:
c = c.charCodeAt(); s += '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);}
}
}
return s + '"'; case 'boolean':
return String(arg); default:
return 'null';}
}, parse: function (text) { var at = 0; var ch = ' '; function error(m) { throw { name: 'JSONError', message: m, at: at - 1, text: text
};}
function next() { ch = text.charAt(at); at += 1; return ch;}
function white() { while (ch != '' && ch <= ' ') { next();}
}
function str() { var i, s = '', t, u; if (ch == '"') { outer: while (next()) { if (ch == '"') { next(); return s;} else if (ch == '\\') { switch (next()) { case 'b':
s += '\b'; break; case 'f':
s += '\f'; break; case 'n':
s += '\n'; break; case 'r':
s += '\r'; break; case 't':
s += '\t'; break; case 'u':
u = 0; for (i = 0; i < 4; i += 1) { t = parseInt(next(), 16); if (!isFinite(t)) { break outer;}
u = u * 16 + t;}
s += String.fromCharCode(u); break; default:
s += ch;}
} else { s += ch;}
}
}
error("Bad string");}
function arr() { var a = []; if (ch == '[') { next(); white(); if (ch == ']') { next(); return a;}
while (ch) { a.push(val()); white(); if (ch == ']') { next(); return a;} else if (ch != ',') { break;}
next(); white();}
}
error("Bad array");}
function obj() { var k, o = {}; if (ch == '{') { next(); white(); if (ch == '}') { next(); return o;}
while (ch) { k = str(); white(); if (ch != ':') { break;}
next(); o[k] = val(); white(); if (ch == '}') { next(); return o;} else if (ch != ',') { break;}
next(); white();}
}
error("Bad object");}
function num() { var n = '', v; if (ch == '-') { n = '-'; next();}
while (ch >= '0' && ch <= '9') { n += ch; next();}
if (ch == '.') { n += '.'; while (next() && ch >= '0' && ch <= '9') { n += ch;}
}
if (ch == 'e' || ch == 'E') { n += 'e'; next(); if (ch == '-' || ch == '+') { n += ch; next();}
while (ch >= '0' && ch <= '9') { n += ch; next();}
}
v = +n; if (!isFinite(v)) { error("Bad number");} else { return v;}
}
function word() { switch (ch) { case 't':
if (next() == 'r' && next() == 'u' && next() == 'e') { next(); return true;}
break; case 'f':
if (next() == 'a' && next() == 'l' && next() == 's' &&
next() == 'e') { next(); return false;}
break; case 'n':
if (next() == 'u' && next() == 'l' && next() == 'l') { next(); return null;}
break;}
error("Syntax error");}
function val() { white(); switch (ch) { case '{':
return obj(); case '[':
return arr(); case '"':
return str(); case '-':
return num(); default:
return ch >= '0' && ch <= '9' ? num() : word();}
}
return val();}
}; window.historyStorage.init(); window.dhtmlHistory.create();


/* accent */
function Accent(){ this.currIndex=0; this.tween=null; this.speed=3000; this.status='stop'; this.repeat='no'; this.playButton=null; this.pauseButton=null; this.stopButton=null; this.prevButton=null; this.nextButton=null; this.onclick=function(cI){ this.status='stop'; this.showPlayButton(); this.currIndex=cI; this.execute();}; this.prev=function(){ this.status='stop'; this.showPlayButton(); this.clearTween(); if(this.repeat=='no'){ if(this.currIndex>0){ this.currIndex--;}
}
else if(this.repeat=='yes'){ if(this.currIndex>0){ this.currIndex--;}
else{ this.currIndex=this.items.length-1;}
}
this.execute();}; this.next=function(){ this.status='stop'; this.showPlayButton(); this.clearTween(); if(this.repeat=='no'){ if(this.currIndex<this.items.length-1){ this.currIndex++;}
}
else if(this.repeat=='yes'){ if(this.currIndex<this.items.length-1){ this.currIndex++;}
else{ this.currIndex=0;}
}
this.execute();}; this.play=function(){ if(this.status=='pause'){ this.currIndex--; this.playContinue();}
else{ if(this.currIndex==0){ this.currIndex=1; this.createTween();}
else{ this.currIndex=0; this.execute();}
}
this.showPauseButton(); this.status='playing';}; this.playContinue=function(){ if(this.currIndex==0){ this.currIndex=0; this.status='stop'; this.showPlayButton(); this.execute(); this.clearTween();}
else if(this.currIndex<this.items.length-1){ this.currIndex++; this.createTween();}
else if(this.currIndex==this.items.length-1){ this.currIndex=0; this.createTween();}
}; this.pause=function(){ this.status='pause'; this.clearTween();}; this.createTween=function(){ this.tween=setTimeout(this.objName+'.execute()', this.speed);}; this.clearTween=function(){ this.showPlayButton(); clearTimeout(this.tween); this.tween=null;}; this.showPlayButton=function(){ if(this.playButton!=null && this.pauseButton!=null){ $(this.playButton).style.display=''; $(this.pauseButton).style.display='none';}
}; this.showPauseButton=function(){ if(this.playButton!=null && this.pauseButton!=null){ $(this.playButton).style.display='none'; $(this.pauseButton).style.display='';}
}; this.execute=function(){ this.build(); this.setStyle(); if(this.status=='playing'){ this.playContinue();}
}; this.setStyle=function(){ }; this.build=function(){ };}
function AccentHome(){ this.items=new Array(); this.repeat='yes'; this.playButton='accentHomePlayButton'; this.pauseButton='accentHomePauseButton'; this.init=function(target, data, objName){ var element=$(data); if(element!=null){ this.target = target; this.items=Gatex.getArrayByTarget(data); this.objName = objName; this.build();}
}; this.setStyle=function(){ var i=0; while(i<this.items.length){ $('accentHomeScrItem_'+i).className='accentHomeScrItem'; if(i==this.currIndex){ $('accentHomeScrItem_'+i).className='accentHomeScrItemS';}
i++;}
}; this.build=function(){ $(this.target).innerHTML=this.items[this.currIndex][0];};}
AccentHome.prototype=new Accent(); var accentHome=new AccentHome();  
