var IDiNTERVAL1;
var scrollEnable=0;
function fixxHeight(){
if(document.getElementById("mainHeight")&&document.getElementById("mainShare")){
var _1=document.getElementById("mainShare");
var _2=parseInt(document.getElementById("mainHeight").offsetHeight);
var _3=parseInt(document.body.clientHeight);
if(_2<(_3-116-104)){
_1.style.height=(_3-116-104)+"px";
}else{
_1.style.height="auto";
}
}
};
var init=function(){
fixxHeight();
function _4(){
var _5,_6;
if(self.pageYOffset||self.pageXOffset){
_6=self.pageYOffset;
_5=self.pageXOffset;
}else{
if(document.documentElement&&document.documentElement.scrollTop){
_6=document.documentElement.scrollTop;
_5=document.documentElement.scrollLeft;
}else{
if(document.body){
_6=document.body.scrollTop;
_5=document.body.scrollLeft;
}
}
}
arrayPageScroll=new Array(_5,_6);
return arrayPageScroll;
};
function _7(_8,_9,_a,_b,_c,_d,_e,_f){
var _10=parseInt(_8.style.marginTop);
if(!_10){
_10=0;
}
if(_c=="down"&&(_10+10)>-_b){
var _11=_e-(-_10+100);
if(_11<=_d){
_8.style.marginTop=-_b+"px";
}else{
_8.style.marginTop=(_10-_d)+"px";
}
}else{
if(_c=="up"&&_10<_a){
if(_10>-100){
_8.style.marginTop=_a;
}else{
_8.style.marginTop=_10+_d+"px";
}
}
}
var _12=parseInt((parseInt(_8.style.marginTop)*100)/_e);
var _13=parseInt((_12*_f)/100);
_9.style.marginTop=-_13+"px";
};
if(document.getElementById("news_scroll")&&document.getElementById("scroll_line")&&document.getElementById("hand_point")&&document.getElementById("scroll_area")&&document.getElementById("scroll_body")){
var _14=50;
var _15=$("scroll_area").offsetHeight;
var _16=$("news_scroll");
var _17=document.getElementById("scroll_body");
var _18=$("scroll_line");
var _19=$("hand_point");
var _1a=parseInt(_16.offsetHeight);
if(_1a>_15){
var _1b=parseInt(_15*100/_1a);
var _1c=(_1b*_15)/100;
_19.style.height=_1c+"px";
var _1d=_17.offsetHeight;
var _1e=0;
var _1f=(_16.offsetHeight-_15);
$$("#scroll_area").addEvent("mousewheel",function(_20){
_20=new Event(_20);
_20.preventDefault();
if((_20.wheel>0)){
_7(_16,_19,_1e,_1f,"up",_14,_1a,_1d);
}else{
if((_20.wheel<0)){
_7(_16,_19,_1e,_1f,"down",_14,_1a,_1d);
}
}
});
$$("#bb_bot").addEvent("mousedown",function(){
function _21(){
_7(_16,_19,_1e,_1f,"down",_14,_1a,_1d);
};
IDiNTERVAL1=setInterval(_21,50);
}).addEvent("mouseup",function(){
clearInterval(IDiNTERVAL1);
});
$$("#bb_top").addEvent("mousedown",function(){
function _22(){
_7(_16,_19,_1e,_1f,"up",_14,_1a,_1d);
};
IDiNTERVAL1=setInterval(_22,50);
}).addEvent("mouseup",function(){
clearInterval(IDiNTERVAL1);
});
$$("#scroll_line").addEvent("mouseover",function(){
clearInterval(IDiNTERVAL1);
});
var _23;
var _24;
$$("#hand_point").addEvent("mousedown",function(_25){
_4();
scrollEnable=1;
var _26=_25.client.y+arrayPageScroll[1];
_24=_18.offsetTop+20;
var _27=parseInt(_19.style.marginTop);
if(!_27){
_27=0;
}
var _28=_27+_24;
_23=_26-_28;
});
$$("#scroll_body").addEvent("mousemove",function(_29){
if(scrollEnable==1){
if(!_29){
var _29=window.event;
}
var _2a=parseInt(_18.offsetTop)+20;
_4();
var _2b=_29.client.y+arrayPageScroll[1];
var _2c=_2a+parseInt(_17.offsetHeight);
var _2d=_2b+parseInt(_19.offsetHeight)-_23;
if(((_2b-_23)>_2a)&&(_2d<_2c)){
var _2e=(_2b-_24-_23);
_19.style.marginTop=_2e+"px";
var _2f=parseInt(((_2b-_24-_23)*100)/parseInt(_17.offsetHeight));
var _30=parseInt(((parseInt(_16.offsetHeight)+10)*_2f)/100);
_16.style.marginTop=-_30+"px";
}
}
});
$$("body").addEvent("mouseup",function(){
scrollEnable=0;
});
}
}
if(document.getElementById("left_menu_shadow")){
var _31=document.getElementById("left_menu_shadow");
var _32=$$(".level_3_menu");
var _33=[parseInt(_32[0].offsetWidth),parseInt(_32[0].offsetHeight)];
_31.style.width=_33[0]+"px";
_31.style.height=_33[1]+"px";
}
var _34=window.navigator.userAgent;
var _35=_34.indexOf("Gecko/")+6;
var _36=_34.indexOf(" ",_35);
if((_34.indexOf("Gecko")>=0)&&(_34.substring(_35,_36)<=20081217)){
$$("div.right_shadow_decor").set("styles",{"display":"inline","float":"none","marginLeft":"-1px"});
$$(".right_shadow_decor div").set("styles",{"margin":"4px auto auto 0px;"});
}
if(document.getElementById("s_text")&&_34.indexOf("Presto")>=0){
document.getElementById("s_text").style.padding="2px 20px 2px 10px";
}
if(document.getElementById("navigation")){
var _37=$$("#navigation > li");
_37.addEvents({"mouseover":function(){
var _38=this;
if(_38.className=="activity"){
return;
}
_38.set("class","acct");
var _39=_38.getElement("ul");
if(!_39){
return;
}
var _3a=[parseInt(_39.offsetWidth),parseInt(_39.offsetHeight)];
var _3b=_38.getElement(".full_shadow_decor");
_3b.set("styles",{"width":_3a[0]+"px","height":_3a[1]+"px"});
},"mouseout":function(){
var _3c=this;
if(_3c.className=="activity"){
return;
}
_3c.set("class","");
}});
}
var _3d=$$(".new_priduct img");
_3d.addEvents({"mouseover":function(){
var _3e=this;
var _3f=this.parentNode.parentNode.nextSibling.parentNode;
_3f.id="puperId";
},"mouseout":function(){
var _40=this;
var _41=this.parentNode.parentNode.nextSibling.parentNode;
_41.id="";
}});
var _42=$$(".main_textbox ol, .res_search ol");
$each(_42,function(_43){
if(_43.start==-1){
listD=0;
}else{
listD=_43.start-1;
}
_43.set("styles",{"display":"none"});
var _44=new Element("div");
_44.addClass("myFirstElement");
_44.inject(_43,"after");
var _45=_43.getChildren();
$each(_45,function(_46,_47){
var _48=new Element("div");
_48.addClass("fake_li");
var _49=new Element("span");
_49.addClass("spCount");
_49.appendText(_47+1+listD);
var _4a=new Element("div");
_4a.innerHTML=_46.innerHTML;
_48.inject(_44);
_49.inject(_48);
_4a.inject(_49,"after");
});
});
if(document.getElementById("contact_fx")){
var _4b=function(){
var _4c=$("contact_fx");
var _4d=$("viewtitle");
var _4e=_4c.getChildren();
for(i=0;i<_4e.length;i++){
if(_4e[i].id=="viewimg"&&(i+1)<_4e.length){
_4e[i].id="";
var _4f=new Fx.Morph(_4e[i],{duration:1000}).start({"opacity":[1,0]});
var _50=new Fx.Morph(_4e[i+1],{duration:1000}).start({"opacity":[0,1]});
_4d.innerHTML=_4e[i+1].alt;
_4e[i+1].id="viewimg";
break;
}else{
if(i==_4e.length-1){
_4e[i].id="";
var _4f=new Fx.Morph(_4e[i],{duration:1000}).start({"opacity":[1,0]});
var _50=new Fx.Morph(_4e[0],{duration:1000}).start({"opacity":[0,1]});
_4d.innerHTML=_4e[0].alt;
_4e[0].id="viewimg";
}
}
}
};
_4b.periodical(5000);
}
if(document.getElementById("scGalBox")&&document.getElementById("TabGal")){
var _51=$("scGalBox");
var _52=$("TabGal");
var _53=parseInt(_51.offsetWidth);
var _54=parseInt(_52.offsetWidth);
if(_54>=_53){
$("fwdctrl").set("styles",{"visibility":"visible"});
$("backctrl").set("styles",{"visibility":"hidden"});
}
var _55=new Fx.Morph(_52,{duration:1000,transition:Fx.Transitions.Quart.easeOut});
$("fwdctrl").addEvent("click",function(){
var _56=parseInt(_52.style.marginLeft);
if(!_56){
_56=0;
}
var _57=_54-(-_56+_53);
if(_57>_53){
targetPos=-(-_56+_53+10);
if($("backctrl").style.visibility=="hidden"){
$("backctrl").fade("in");
}
}else{
targetPos=-(-_56+_57-10);
this.fade("out");
}
_55.start({"marginLeft":[_56,targetPos]});
});
$("backctrl").addEvent("click",function(){
var _58=parseInt(_52.style.marginLeft);
if(!_58&&_58==0){
return;
}
if(-_58>_53){
targetPos=_58+_53+10;
if($("fwdctrl").style.visibility=="hidden"){
$("fwdctrl").fade("in");
}
}else{
targetPos=0;
this.fade("out");
}
_55.start({"marginLeft":[_58,targetPos]});
});
}
if(document.getElementById("add_quest")&&document.getElementById("add_question")){
var _59=$("add_question");
var _5a=parseInt(_59.offsetHeight);
var _5b=$("add_quest");
_59.style.height="1px";
_5b.style.backgroundPosition="10px -30px";
_5b.id="hideEorm";
_59.set("tween",{duration:500});
_5b.addEvent("click",function(_5c){
this.blur();
_5c=new Event(_5c);
_5c.preventDefault();
if(_5b.id=="hideEorm"){
_59.tween("height",[1,_5a]);
_5b.style.backgroundPosition="10px 5px";
_5b.id="";
}else{
_59.tween("height",[_5a,1]);
_5b.style.backgroundPosition="10px -30px";
_5b.id="hideEorm";
}
});
}
};
function iehover(){
if(window.navigator.userAgent.indexOf("MSIE 6")>=0){
$$(".part_tab tr td").addEvents({"mouseover":function(){
this.getParent().addClass("ie_hover");
},"mouseout":function(){
this.getParent().removeClass("ie_hover");
}});
}
};
window.addEvent("domready",function(){
if(Browser.Engine.gecko){
setTimeout(init,500);
}else{
init();
iehover();
}
});
window.addEvent("resize",function(){
fixxHeight();
});

