var TabsControl={tabs:{}};
TabsControl.setDefaultTab=function(_1,_2){
TabsControl.tabs[_1]=1;
var _3=TabsControl.getHashTabNo(_1);
if(_3==-1){
TabsControl.setTab(_1,_2,true);
}else{
}
};
TabsControl.setTabHash=function(_4,_5){
var _6=_4.substring(1).split("=");
TabsControl.setTab(_6[0],_6[1],_5);
};
TabsControl.setTab=function(_7,id,_9){
HashControl.setParam(_7,id,_9);
var _a=$("#"+_7+"_content_"+id);
if(_a.parents(".vertical_tabs").exists()&&_a.find(".paging_container").exists()){
_a.find(".paging_container").each(function(){
var _b=$(this);
var _c=_b.find(".paging_panel .page_no").first();
_c.click();
});
}
};
TabsControl.getHashTabNo=function(_d){
var _e=HashControl.getParam(_d,-1);
var _f=Number(_e);
return isNaN(_f)?-1:_f;
};
TabsControl._intervalFixHeights=null;
TabsControl._selectTab=function(_10,id){
var _12=$("#"+_10+"_header_"+id);
if(_12.size()==0){
setTimeout(function(){
TabsControl.setTab(_10,TabsControl.tabs[_10],true);
},100);
return;
}
var _13=$("#"+_10+"_content_"+id);
if(id==this.tabs[_10]){
verticalTabsFix();
}
var _14=$("#"+_10+"_header_"+TabsControl.tabs[_10]);
var _15=_14.parents(".tab_status").eq(0);
_15.removeClass("active opened");
var _16=$("#"+_10+"_content_"+TabsControl.tabs[_10]);
_16.hide();
var _17=_12.parents(".tab_status").eq(0);
_17.addClass("active opened");
_13.show();
verticalTabsFix();
TabsControl.tabs[_10]=id;
function verticalTabsFix(){
clearInterval(TabsControl._intervalFixHeights);
if(_13.parents(".vertical_tabs").length>0){
TabsControl._intervalFixHeights=setInterval(function(){
fn.syncVerticalTabsHeight.changeContentHeight(_12);
},500);
}
}
};
TabsControl._onHashChange=function(_18){
for(var _19 in this.tabs){
if(this.tabs.hasOwnProperty(_19)){
var _1a=TabsControl.getHashTabNo(_19);
TabsControl._selectTab(_19,_1a);
}
}
};
var HashControl={hash:"",hashChangeListeners:[],inited:false,timeout:null};
HashControl.setHash=function(_1b,_1c){
_1c=_1c||false;
if(_1c){
var _1d=document.location.href.replace(/#.*/,"");
_1d+=_1b;
document.location.replace(_1d);
}else{
document.location.hash=_1b;
}
setFavicon();
};
HashControl.addHashChangeListener=function(_1e){
this.hashChangeListeners.push(_1e);
};
HashControl._timedUrlCheck=function(){
var _1f=document.location.hash;
if(this.hash!=_1f){
for(var i=0;i<this.hashChangeListeners.length;i++){
this.hashChangeListeners[i].call(window,_1f);
}
this.hash=_1f;
}
if(this.inited){
this.timeout=setTimeout(function(){
HashControl._timedUrlCheck();
},100);
}
};
HashControl.init=function(){
if(this.inited){
return;
}
this.inited=true;
HashControl._timedUrlCheck();
};
HashControl.stop=function(){
clearTimeout(this.timeout);
this.inited=false;
};
HashControl.getParam=function(_21,_22){
var _23=document.location.hash;
if(_23.length>0){
_23=_23.substring(1);
}else{
return _22;
}
var _24=_23.split("&");
for(var i=0;i<_24.length;i++){
var _26=_24[i].split("=");
if(_26[0]==_21){
if(!_26[1]){
return _22;
}
return _26[1];
}
}
return _22;
};
HashControl.setParam=function(_27,_28,_29){
var _2a;
var _2b=false;
var _2c=[];
var _2d=document.location.hash;
if(_2d.length>0){
_2d=_2d.substring(1);
}
if(_2d.length>0){
_2c=_2d.split("&");
}
for(var i=0;i<_2c.length;i++){
var _2f=_2c[i].split("=");
if(_2f[0]==_27){
_2a=_2f[1];
if(_2a!=_28){
_2c[i]=_27+"="+_28;
}
_2b=true;
break;
}
}
if(!_2b){
_2c.push(_27+(_28!==undefined?"="+_28:""));
}
HashControl.setHash("#"+_2c.join("&"),_29);
return _2a;
};
HashControl.getNonPairedHashElements=function(){
var _30=document.location.hash;
var _31=[];
var _32=[];
if(_30.length>0){
_30=_30.substring(1);
}
if(_30.length>0){
_31=_30.split("&");
}
for(var i=0;i<_31.length;i++){
var _34=_31[i].split("=");
if(!_34[1]){
_32.push(_34[0]);
}
}
return _32;
};
var IframeHashStore={iframe:null,interval:null,hash:"",count:0,inited:false};
IframeHashStore.init=function(_35){
if(this.inited){
return;
}
this.inited=true;
this.iframe=typeof _35=="string"?document.getElementById(_35):_35;
if(this.iframe==null){
return;
}
IframeHashStore.storeHash(document.location.hash);
HashControl.addHashChangeListener(function(_36){
IframeHashStore._onHashChange(_36);
});
};
IframeHashStore._onHashChange=function(_37){
this.storeHash(_37);
};
IframeHashStore._intervalCheck=function(){
if(!this.iframe.contentWindow||!this.iframe.contentWindow.document.body){
return;
}
var _38=this.iframe.contentWindow.document.getElementById("state").innerHTML.replace(/&amp;/g,"&");
if(this.hash!=_38){
this.hash=_38;
HashControl.setHash(_38);
}
};
IframeHashStore.storeHash=function(_39){
if(_39==this.hash){
return;
}
if(!this.iframe.contentWindow||!this.iframe.contentWindow.document.body){
setTimeout(function(){
IframeHashStore.storeHash(_39);
},10);
return;
}
this.hash=_39;
var doc=this.iframe.contentWindow.document;
var _3b="<html><body><div id=\"state\">"+_39+"</div></body></html>";
doc.open("text/html",this.count++==0?"replace":undefined);
doc.write(_3b);
doc.close();
if(this.interval==null){
this.interval=setInterval(function(){
IframeHashStore._intervalCheck();
},100);
}
};
var LinkTargetLocator={};
LinkTargetLocator.jumpToElement=function(el){
var $el=$("[id="+el+"], [name="+el+"]").eq(0);
if($el.exists()){
if($el.parents(".tab_content").exists()){
TabsControl.setTabHash("#"+$el.parents(".tab_content").eq(0).attr("id").replace("_content_","="),true);
}
LinkTargetLocator._jumpToElement($el);
}
};
LinkTargetLocator._jumpToElement=function(el){
var _el=el;
setTimeout(function(){
if(_el.offset()!=null){
$("html,body").scrollTop(_el.offset().top);
}else{
LinkTargetLocator._jumpToElement(_el);
}
},100);
};
LinkTargetLocator._onLinkClick=function(_40){
LinkTargetLocator.jumpToElement(_40.replace("#",""));
};
LinkTargetLocator.onDocumentReady=function(){
var _41=HashControl.getNonPairedHashElements()[0];
_41&&LinkTargetLocator.jumpToElement();
};
HashControl.addHashChangeListener(function(_42){
TabsControl._onHashChange(_42);
});
$(document).ready(function(){
$("A.tab_button").click(function(e){
TabsControl.setTabHash(this.href.substring(this.href.indexOf("#")));
e.preventDefault();
e.stopPropagation();
});
$("A").not(".tab_button").each(function(_44,el){
var _46=el.href.indexOf("#");
var _47=el.href.indexOf("?");
var _48=_46>-1?el.href.substring(0,_46):el.href;
var _49=_47>-1?_48.substring(0,_47):_48;
var _4a=document.location.href.indexOf("?");
var _4b=document.location.href.replace(/#.*/,"");
var _4c=_4a>-1?_4b.substring(0,_4a):_4b;
if(_46>-1){
if(_48==_4b){
var _4d=el.href.substring(_46);
$(el).click(function(e){
if(_4d.length>4&&_4d.substring(0,4)=="#tab"){
var _4f=_4d.substring(1).split("=");
HashControl.setParam(_4f[0],_4f[1]);
}else{
LinkTargetLocator._onLinkClick(_4d);
}
e.preventDefault();
e.stopPropagation();
});
return;
}
}
if(_49==_4c&&_48!=_4b){
$(el).click(function(e){
e.preventDefault();
e.stopPropagation();
document.location=_48+document.location.hash;
});
return;
}
});
});


