var mp3_playingId="";function mp3player_startPlay(a){if(""!=mp3_playingId&&mp3_playingId!=a){var b=getFlashMovieObject(mp3_playingId);b.mp3player_stopPlay();}mp3_playingId=a;}function getFlashMovieObject(a){if(window.document[a]){return window.document[a];}if(navigator.appName.indexOf("Microsoft Internet")==-1){if(document.embeds&&document.embeds[a]){return document.embeds[a];
}}else{return document.getElementById(a);}}var InputSelector=Class.create();InputSelector.prototype={initialize:function(e,h,f,i,g,b,j,a,d,c){this.top=1;this.bottom=0.4;this.max=11;this.isCheckAllButtonVisible=true;this.version="InputSelector";this.fakeOuter=e;this.fakeInner=h;this.realInput=f;this.listOfValues=i;
this.selectedListOfValues=$H(g);this.popupInputs=$A();this.popup=b||this.createPopupContainer(0,200);this.popupIframe=this.createPopupIframeContainer(0,200);this.popupAutoListener();this.doAjax=true;this.view=j||{width:150,count:1};this.searchUrl=a;this.form=d;this.formOuter=c;this.setUpListeners();this.startHTML=this.fakeInner.innerHTML;
this.drawSelectorInput();},setUpListeners:function(){this.fakeOuter.observe("click",function(){if(this.popup.getStyle("display")=="none"){if(this.doAjax){this.createWaitingEffect(this.top,this.bottom);this.createAjaxQuery();}else{this.drawPopUpElement(this.fakeOuter,this.view);this.drawSelectorInput();
}}else{this.popup.hide();}}.bindAsEventListener(this));},drawSelectorInput:function(){var b="";var c=this.selectedListOfValues.keys();this.realInput.value="";for(var a=0;a<c.length;a++){b+=this.selectedListOfValues.get(c[a])+", ";this.realInput.value+=c[a]+",";}this.fakeInner.setAttribute("title",b);
if(b.length>this.max){b=b.substr(0,this.max)+" ...";}else{if(b==""){b=this.startHTML;}}this.fakeInner.innerHTML=b;},createAjaxQuery:function(){new Ajax.Request(this.searchUrl["url"]+this.searchUrl["param_prefix"]+this.searchUrl["param_value"],{onComplete:function(a){this.doAjax=false;this.listOfValues=$H(a.responseText.evalJSON());
this.drawPopUpElement(this.fakeOuter,this.view);this.createAfterFinishEffect(this.bottom,this.top);this.drawSelectorInput();}.bindAsEventListener(this)});},createWaitingEffect:function(b,a){this.toggleLoading(true);new Effect.Opacity(this.formOuter,{from:b,to:a,duration:0.2});},createAfterFinishEffect:function(b,a){new Effect.Opacity(this.formOuter,{from:b,to:a,duration:0.2});
this.toggleLoading(false);},toggleLoading:function(a){if(this.loader==null){this.loader=new Element("img",{src:"/images/ajax-loader.gif",className:"searchLoader"});this.formOuter.appendChild(this.loader);}if(a){this.loader.show();}else{this.loader.hide();}},rowListener:function(a){}.bindAsEventListener(this),setUpOnUpdateListener:function(a){this.onUpdateListener=a;
},createPopupContainer:function(a,d){var b=$("inputSelectorDivId");if(b){return b;}var c=new Element("div",{id:"inputSelectorDivId",style:"display:none;"+"z-index:1001;"+"position:absolute;"+"left:"+a+"px;"+"top:"+d+"px;"});document.body.appendChild(c);c.addClassName("search_elem_over");return c;},createPopupIframeContainer:function(a,d){var c=$("inputSelectorIframeId");
if(c){return c;}var b=new Element("iframe",{id:"inputSelectorIframeId",style:"position:absolute; "+"z-index:1000;"+"display:none;"+"padding:0;margin:0;"+"background:white;"+"left:"+a+"px;"+"top:"+d+"px;"+"border:0",src:"/flash/blank.html"});document.body.appendChild(b);return b;},setSelectedList:function(){this.popupInputs=$A(this.popup.select("input"));
this.popupInputs.each(function(a){if(a.checked){this.selectedListOfValues.set(a.value,this.listOfValues.get(a.value));this.drawItemListText(a.value,"disabled");}else{this.selectedListOfValues.unset(a.value);if(a.disabled){this.drawItemListText(a.value,"disabled",true);}else{this.drawItemListText(a.value,"disabled");
}}}.bindAsEventListener(this));this.drawSelectorInput();},clearSelections:function(){this.selectedListOfValues=$H();this.drawSelectorInput();},drawItemListText:function(c,b,a){if(a){$("span_"+c).addClassName(b);}else{$("span_"+c).removeClassName(b);}},drawPopUpElement:function(c,b){b["count"]=b["count"]||1;
b["width"]=b["width"]||220;this.popup.setStyle({width:(b["count"]*b["width"]+2)+"px"});var e="";e+=this.drawMenu();e+="<div class='inner_over'> ";e+=this.drawInputList(b);e+="<div class='clearing'> </div>";e+="</div>";this.popup.hide();this.popupIframe.hide();this.popup.update(e);this.setMenuListener();
this.popupInputs=$A(this.popup.select("input"));this.popupInputs.each(function(f){f.observe("click",function(){this.rowListener(f);this.setSelectedList();}.bindAsEventListener(this));}.bindAsEventListener(this));var a=this.getOffset($(c));var d=$(c).getHeight();this.popup.setStyle({top:(a["top"]+d+2)+"px",left:(a["left"]+1)+"px"});
this.popupIframe.setStyle({top:(a["top"]+d+2)+"px",left:(a["left"]+1)+"px",width:(b["count"]*b["width"]+2)+"px",height:(this.popup.getHeight()+2)+"px"});Effect.BlindDown(this.popup);Effect.BlindDown(this.popupIframe);},getOffset:function(b){var a=0,c=0;do{if(b.id!="header"&&b.id!="global"){a+=b.offsetTop||0;
}c+=b.offsetLeft||0;b=b.offsetParent;}while(b);return Element._returnOffset(c,a);},drawMenu:function(){this.menu_template="selector_template_menu";this.menu=$(this.menu_template);var a=this.menu.innerHTML;return a;},setMenuListener:function(){var a=this.isCheckAllButtonVisible;var e=this.popup.select(".bordered_bottom")[0];
var d=$(e.select(".close")[0]);d.observe("click",function(){this.popup.hide();this.popupIframe.hide();}.bindAsEventListener(this));var c=$(e.select(".none")[0]);c.observe("click",function(){this.uncheckAllAdditionalListener();this.uncheckAllListener();this.setSelectedList();}.bindAsEventListener(this));
var b=$(e.select(".all")[0]);b.setStyle({display:(a)?"":"none"});b.observe("click",function(){this.checkAllListener();this.setSelectedList();}.bindAsEventListener(this));},uncheckAllListener:function(){this.selectedListOfValues=$H();this.drawSelectorInput();this.popupInputs.each(function(a){a.checked=false;
a.disabled=false;});},uncheckAllAdditionalListener:function(){},checkAllListener:function(){this.selectedListOfValues=this.listOfValues;this.drawSelectorInput();this.popupInputs.each(function(a){a.checked=true;a.disabled=false;});},drawInputList:function(a){var c="";var b="";var d="";$A(this.listOfValues).each(function(e){b="";
d="";c+="<span class='item'>";if(this.selectedListOfValues.get(e.key)){b=" checked='checked' ";}else{if(this.setDisabled(e.key)){b+=" disabled='true' ";d=" class='disabled'";}}c+="<input type='checkbox' value='"+e.key+"'"+b+" name='"+e.value+"_"+e.key+"'/> ";c+="<span"+d+' id="span_'+e.key+'">';c+=e.value;
c+="</span>";c+="</span>";}.bindAsEventListener(this));return c;},setDisabled:function(a){return false;},isAllUnChecked:function(){return true;},popupAutoListener:function(){this.popupListening();this.windowListening();},windowListening:function(){Event.observe(document.body,"click",function(a){a.cancelBubble=false;
this.popup.hide();this.popupIframe.hide();}.bindAsEventListener(this));},popupListening:function(){Event.observe(this.popup,"click",function(a){a.cancelBubble=true;}.bindAsEventListener(this));},showVersion:function(){window.alert(this.version);}};var ProductAndCategorySearchSelector=Class.create();ProductAndCategorySearchSelector.prototype={initialize:function(d,e,b,a,c){this.linked=$H(e);
this.searchUrl=d;this.currentProduct=$H(c["product"]).keys()[0]||1;this.products=$H();this.categories=$H();this.selectedProducts=$H(c["product"])||$H();this.selectedCategories=$H(c["category"])||$H();this.linked.each(function(f){this.categories.set(f.value,$H());}.bind(this));this.params={category:"?value=categories&id=",product:"?value=products"};
this.productSelector=new InputSelector($(b.outer_id),$(b.inner_id),$(b.outer_id).select("input")[0],this.products,this.selectedProducts,null,{count:1,width:220},{url:this.searchUrl,param_prefix:this.params.product,param_value:""},$(b.inner_form),$(b.outer_form));this.productSelector.rowListener=this.rowListener;
this.productSelector.setDisabled=this.setDisabled;this.productSelector.isAllUnChecked=this.isAllUnChecked;this.productSelector.uncheckAllAdditionalListener=this.uncheckAllAdditionalListener;this.productSelector.isCheckAllButtonVisible=false;this.categorySelector=new InputSelector($(a.outer_id),$(a.inner_id),$(a.outer_id).select("input")[0],this.categories.get(this.linked.get(this.currentProduct)),this.selectedCategories,null,{count:4,width:160},{url:this.searchUrl,param_prefix:this.params.category,param_value:this.currentProduct},$(a.inner_form),$(a.outer_form));
this.productSelector.categories=this.categories;this.productSelector.linked=this.linked;this.productSelector.categorySelector=this.categorySelector;this.productSelector.baseProduct="1";this.productSelector.baseCategoryOfProduct=this.linked.get(this.productSelector.baseProduct);this.productSelector.selectedProduct=this.currentProduct;
this.productSelector.selectedCategoryOfProduct=this.linked.get(this.currentProduct);},uncheckAllAdditionalListener:function(){this.selectedProduct=this.baseProduct;this.selectedCategoryOfProduct=this.baseCategoryOfProduct;var c=this.categorySelector.listOfValues.keys().length==this.categories.get(this.selectedCategoryOfProduct).keys().length;
if(c){for(var b=0;b<this.categorySelector.listOfValues.keys();b++){var a=this.categorySelector.listOfValues.keys()[b];c=this.categorySelector.listOfValues.get(a)==this.categories.get(this.selectedCategoryOfProduct).get(a);if(!c){break;}}}this.categorySelector.searchUrl["param_value"]=this.selectedProduct;
this.categorySelector.listOfValues=this.categories.get(this.selectedCategoryOfProduct);if(!c){this.categorySelector.uncheckAllListener();}},setDisabled:function(a){if(this.selectedListOfValues.keys().length>0){return !(this.linked.get(a)==this.linked.get(this.selectedProduct));}else{return false;}},isAllUnChecked:function(){var b=true;
for(var a=0;a<this.popupInputs.length;a++){if(this.popupInputs[a].checked){b=false;break;}}return b;},rowListener:function(b){var c=this.selectedCategoryOfProduct;this.categories.set(c,this.categorySelector.listOfValues);this.selectedProduct=b.value;this.selectedCategoryOfProduct=this.linked.get(this.selectedProduct);
if(this.isAllUnChecked()){for(var a=0;a<this.popupInputs.length;a++){this.popupInputs[a].disabled=false;}this.selectedProduct=this.baseProduct;this.selectedCategoryOfProduct=this.baseCategoryOfProduct;}else{for(var a=0;a<this.popupInputs.length;a++){this.popupInputs[a].disabled=this.linked.get(this.popupInputs[a].value)!=this.linked.get(this.selectedProduct);
}}this.categorySelector.searchUrl["param_value"]=this.selectedProduct;this.categorySelector.doAjax=this.categories.get(this.selectedCategoryOfProduct).keys().length==0;this.categorySelector.listOfValues=this.categories.get(this.selectedCategoryOfProduct);if(c!=this.selectedProduct){this.categorySelector.uncheckAllListener();
}},createPopupContainer:function(a,c){var b=new Element("div",{style:"display:none;"+"position:absolute;"+"left:"+a+"px;"+"top:"+c+"px;"});document.body.appendChild(b);b.addClassName("search_elem_over");return b;}};var HeaderProductAndCategorySearchSelector=Class.create(ProductAndCategorySearchSelector);
var AdvansedProductAndCategorySearchSelector=Class.create(ProductAndCategorySearchSelector);var AuthorSearchSelector=Class.create();AuthorSearchSelector.prototype={initialize:function(a,c,b){this.authors=$H();this.searchUrl=a;this.selectedAuthors=$H(c)||$H();this.authorSelector=new InputSelector($(b.outer_id),$(b.inner_id),$(b.outer_id).select("input")[0],this.authors,this.selectedAuthors,null,{count:4,width:160},{url:this.searchUrl,param_prefix:"?value=authors",param_value:""},$(b.inner_form),$(b.outer_form));
}};var LanguageToggle=Class.create();LanguageToggle.prototype={initialize:function(c,a,b){this.buttonBuy=$(c);this.list=$(a);this.corners=$(b);$(this.list).setStyle({display:"none"});this.attachObservers();},attachObservers:function(){this.attachObserverToButton();this.attachObserverToBody();},attachObserverToBody:function(){Event.observe(document.body,"click",function(a){a.cancelBubble=false;
this.closeList();}.bindAsEventListener(this));},attachObserverToButton:function(){if($(this.list).childElements().length>0){$(this.buttonBuy).observe("click",function(a){if(this.list.getStyle("display")=="none"){this.openList();}else{this.closeList();}}.bindAsEventListener(this));}},openList:function(){this.corners.hide();
Effect.SlideDown(this.list,{duration:0.2});},closeList:function(){this.list.hide();this.corners.show();}};var ItemTooltipList=Class.create({initialize:function(b,a,c){this.items=$$("."+b);this.descriptionItems=$$("."+a);this.host=c||"";var d=0;$A(this.items).each(function(e){this.setBigPreview(e,d);d++;
}.bind(this));$A(this.descriptionItems).each(function(e){this.setAjaxPreview(e);}.bind(this));},setAjaxPreview:function(a){var b="<img src='/images/groupview-loader.gif'/> Loading ...";new ToolTip(a,b,{className:"darktip"},this.host+"/service/jsonPopup.do?type=groupview&viewId="+a.getAttribute("viewid"));
},setBigPreview:function(l,b){try{var g=l.getAttribute("name").evalJSON();var j="";var n;var k="";var f;j+="<p class='bold align_center' style='width:"+g[0]+"px'>"+g[2]+" #"+g[3]+"</p>";if(g[4].match(/.+\.flv/)&&!showPlayer){var a="/flash/popup-player.swf?titleVideo="+g[4];var d="<param name='movie' value='"+a+"'/>";
var c="<param name='bgcolor' value='#010101' />";var i="<embed width = '"+g[0]+"' height='"+g[1]+"' quality='high' bgcolor='#010101' swliveconnect='true' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' src='"+a+"'/>";k="<object width='"+g[0]+"' height='"+g[1]+"' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0'>"+d+c+i+"</object>";
j+="<div class='align_center' id='flashVideo_"+g[3]+"' style='width:"+g[0]+"px;height:"+g[1]+"px;'>"+k+"</div>";}else{if(g[4].match(/.+\.flv/)&&showPlayer){k="<a href='"+g[4]+"' style=\"width:"+g[0]+"px; height="+g[1]+"px;\" id='popup_flash_"+b+"'></a>";j+="<div class='align_center'  style='width:"+g[0]+"px;height:"+g[1]+"px;'>"+k+"</div>";
}else{j+="<div class='loading_preview' id='line_"+b+"-"+g[3]+"'>Loading...<br/><div class='loading_out'><div class='loading_in' style='width:50px;'> </div></div></div>";j+="<div class='align_center'  style='width:"+g[0]+"px;height:"+g[1]+"px;'><img onload=\"clearInt()\" src='"+g[4]+"' alt='"+g[5]+"' title='"+g[6]+"'/></div>";
}}var m=new ToolTip(l,j,{className:"image_preview",delay:2000});m.onStartAction=function(){if(g[4].match(/.+\.jpg/)){loader("loading_in","loading_out","line_"+b+"-"+g[3]);}else{if(g[4].match(/.+\.flv/)&&showPlayer){f=new FlowPlayer(g[4],"popup_flash_"+b,true,true,false,false,false);}}};m.onOutAction=function(){if(f){f.stop("popup_flash_"+b);
$("popup_flash_"+b).innerHTML="";}if($("flashVideo_"+g[3])){$("flashVideo_"+g[3]).innerHTML="";}clearInt();$(m.outer).hide();$(m.outerIframe).hide();};$(l.id).onclick=function(){if($("flashVideo_"+g[3])){$("flashVideo_"+g[3]).innerHTML="";}$(m.outer).hide();$(m.outerIframe).hide();};}catch(h){alert(h);
}}});var inner_loading;var outer_loading;var full_loading;var timer;function loader(c,b,a){try{full_loading=$(a);inner_loading=$$("#"+a+" ."+c)[0];outer_loading=$$("#"+a+" ."+b)[0];full_loading.style.display="";timer=setInterval("move()",30);}catch(d){}}function move(){try{if(inner_loading.offsetLeft>=outer_loading.clientWidth){inner_loading.style.left="-"+inner_loading.getStyle("width");
}else{inner_loading.style.left=(inner_loading.offsetLeft+6)+"px";}}catch(a){}}function clearInt(){try{if(full_loading){full_loading.style.display="none";}if(inner_loading){inner_loading.style.left="-"+inner_loading.style.width;}clearInterval(timer);}catch(a){}}var DownloadList=Class.create({initialize:function(d,b,c,a){this.messages=$H(d);
this.autoRefresh=a;this.doTooltips();this.url=b;this.template=new Template(c.innerHTML,/(^|.|\r|\n)(\#\s*(\w+)\s*#)/);this.timer={};this.doAjax();},doTooltips:function(){this.messages.each(function(b){var a="."+b.key;this.items=$$(a);var c=$(b.value).innerHTML;$A(this.items).each(function(d){new ToolTip(d,c,{className:"darktip"});
}.bind(this));}.bind(this));},doAjax:function(){var a=1000*this.autoRefresh;this.timer=setInterval(function(){this.doAjaxItems();}.bind(this),a);},doAjaxItems:function(){var c=new Array();var a=0;var b=$$("."+"download_column");$A(b).each(function(d){c[a++]=d.id;}.bind(this));if(c.length>0){new Ajax.Request(this.url,{method:"post",parameters:{"ids":c.toJSON()},onComplete:function(d){this.onCompleteItems(d.responseText.evalJSON());
}.bindAsEventListener(this)});}},onCompleteItems:function(a){$A(a).each(function(c){var b="";c["closePassword"]="";if(c["error"]!=null){Window.location="/";}else{b=this.template.evaluate(c);$(c["id"]).update(b);$(c["id"]).className="align_center";}}.bind(this));}});var TransactionStatusRefresher=Class.create({initialize:function(c,d,b,a){this.operationId=c;
this.timeout=d;this.status=a;this.url=b;this.timer={};this.startTimer();},startTimer:function(){var a=1000*this.timeout;this.timer=setInterval(function(){this.onTimer();}.bind(this),a);},setInitialText:function(a){if((a=="Purchases Approved"||a=="Subscription")&&$("orderInfoText")){this.setVisibleElement(false,"orderInfoText");
}},onTimer:function(){new Ajax.Request(this.url,{method:"post",parameters:{"operationId":this.operationId,"status":this.status},onComplete:function(a){this.onRequest(a.responseText.evalJSON());}.bindAsEventListener(this)});},onRequest:function(a){if(a["error"]!=null){window.location="/";}else{if(a["status"]!=this.status){this.status=a["status"];
this.setInitialText(this.status);if(a["view"]!=null){$(this.operationId).update(a["view"]);}if(a["topText"]!=null){$("topText").update(a["topText"]);}if(a["bottomText"]!=null){$("bottomText").update(a["bottomText"]);}fix_height_for_ie6("finances_transact_block");}if((a["isContinue"]!=null)&&(a["isContinue"]=="false")){clearInterval(this.timer);
}}},setVisibleElement:function(b,a){if(b){document.getElementById(a).style.display="block";}else{document.getElementById(a).style.display="none";}}});var ComplectationList=Class.create({initialize:function(d,h,g,e,f,a,b,c){this.prefixUrl=d;this.prefix=h;this.list=$$("."+g);this.total=(e=="")?e:$(e);this.balance=(f=="")?f:$(f);
this.balanceAfter=(a=="")?a:$(a);this.purchaseLink=(b=="")?b:$(b);this.outer=$(c);$A(this.list).each(function(i){i.onclick=function(){this.waitingEffect();this.remove(i.title);return false;}.bindAsEventListener(this);}.bind(this));},waitingEffect:function(){new Effect.Opacity(this.outer,{from:1,to:0.2,duration:0.2});
if(this.loader==null){this.loader=new Element("img",{src:"/images/ajax-loader.gif",style:"position:absolute; top:50%;left:50%; display:block;margin-left:-25px;margin-top:-12px;"});this.outer.appendChild(this.loader);}this.loader.show();},remove:function(a){new Ajax.Request(this.prefixUrl+a+".html",{onComplete:function(b){this.onRemoveComplete(b.responseText,a);
this.endEffect();}.bindAsEventListener(this),onFailure:function(){this.endEffect();}.bindAsEventListener(this)});},onRemoveComplete:function(a,c){if(a.empty()){window.location.reload();}else{try{var b=a.evalJSON(true);if(this.total){this.total.update(b.total);}if(this.balance){this.balance.update(b.balance);
}if(this.balanceAfter){this.balanceAfter.update(b.balanceAfter);}if(this.purchaseLink){this.purchaseLink.href=b.purchaseLink;}}catch(d){}$(this.prefix+c).remove();}},endEffect:function(){this.loader.hide();new Effect.Opacity(this.outer,{from:0.2,to:1,duration:0.2});}});var PriceTable=Class.create({initialize:function(c,e,f,d,b,a){this.outer=c;
if(!$(this.outer)){return;}this.block=$(e);this.popupList=$$("."+d);this.url=b;this.trs=$A($(this.outer).select("tr"));this.trs=this.trs.without(this.trs[0]);this.radios=Form.getInputs($(this.outer),"radio",f);this.popupListener();this.rowListener();},popupListener:function(){$A(this.popupList).each(function(a){var b="<img src='/images/groupview-loader.gif'/> Loading ...";
new ToolTip(a,b,{className:"darktip"},this.url+"?viewId="+a.getAttribute("viewid"));}.bindAsEventListener(this));},rowListener:function(){for(var a=0;a<this.trs.length;a++){var b=this.trs[a];b.observe("click",function(e){e.select("input")[0].checked=true;var c=$A(this.trs).indexOf(e);var d=0;this.trs.each(function(g){var f="selected-price";
if(d==c){$(g).addClassName(f);}else{$(g).removeClassName(f);}d++;});fix_height_for_ie6(this.block);}.bind(this,b));}},getRadioValue:function(b){try{return b.find(function(c){return c.checked;}).value;}catch(a){}return null;}});function emailChecking(b){var c=/^[\w\-\'\~\_\.\*\/=\^\{\}\?\+\!\#\$\%\&\`\|]+[\@][\w\_\.\-]+[\.][\w]{2,6}$/i;
if((b=="")||(b.length>100)||(c.exec(b)==null)||(b.substr(b.lastIndexOf("@")+1,1)==".")){return false;}var a=b.substring(0,b.indexOf("@"));if((b.indexOf("..")>0)||(a[0]==".")||(a[a.length-1]==".")){return false;}return true;}function onClickPreSubscribe(){try{var a=$("subscribeFormEmail");var b={};b["invalid"]=$("subscribeFormEmailInvalid");
b["empty"]=$("subscribeFormEmailEmpty");if(a.value.empty()){b["empty"].style.display="";b["invalid"].style.display="none";}else{if(emailChecking(a.value)){b["empty"].style.display="none";b["invalid"].style.display="none";$("subscribeForm").submit();}else{b["invalid"].style.display="";b["empty"].style.display="none";
}}fix_height_for_ie6("subscribeFormBlock");return false;}catch(c){}}function onClickSubscribe(){try{var d=$("confirmCheckBox");var c=$("onClickSubscribeSubmit");var b=false;var a='<img src="/images/check.gif" style="margin-top:-1px;"/>';try{d.observe("click",function(e){if(b){b=false;d.innerHTML="";}else{b=true;
d.innerHTML=a;d.removeClassName("error_checkbox");}});}catch(f){alert(f);}try{c.onclick=function(){if(b){$("subscribeForm").submit();return false;}else{d.addClassName("error_checkbox");}};}catch(f){alert(f);}}catch(f){}}function getElementHeight(b){var c=0;var d=b.childNodes;for(var a=0;a<d.length;a++){if(d[a].id!="left"&&d[a].id!="footer"&&d[a].id!="about_us_text"){c=c+d[a].offsetHeight;
}}if(navigator.userAgent.indexOf("MSIE")!=-1){if(document.getElementById("flashPlayer-membership")){c=c-22;}else{c=c-17;}}return c;}var AjaxLoader=Class.create();AjaxLoader.prototype={initialize:function(){this.loader_width=400;this.out=new Element("div",{style:"position:absolute; "+"z-index:2000;"+"display:none;"+"margin:0 auto;"+"color:#000;"+"background:#fff;"+"border:0;"});
document.body.appendChild(this.out);this.container=new Element("iframe",{style:"position:absolute; "+"z-index:2000;"+"display:none;"+"background:#fff;"+"padding:0; margin:0;"+"border:0px;"+"text-align:center;",src:"/flash/blank.html"});this.container.frameBorder="0";this.container.id="loaderBlock";var a="<div style='text-align:center;' class='preview-loader'><img src='/images/ajax-loader.gif' alt=''/><div class='loader-text'>Loading, please wait...</div></div>";
$(this.out).update(a);document.body.appendChild(this.container);},show:function(){var f=window.pageXOffset||document.body.scrollLeft||document.documentElement.scrollLeft||0;var e=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop||0;var a=window.innerHeight||document.documentElement.clientHeight;
var c=a/2+e;this.container.style.top=c+"px";this.out.style.top=c+"px";var b=window.innerWidth||document.documentElement.clientWidth;var d=(b/2+f)-this.loader_width/2;this.container.style.left=d+"px";this.out.style.left=d+"px";this.out.setOpacity(0.65);this.container.setOpacity(0.65);this.out.style.display="block";
this.container.style.display="block";},hide:function(a){if(arguments.length==0){a=2;}Effect.Fade(this.out,{duration:a});Effect.Fade(this.container,{duration:a});}};var Cart=Class.create();Cart.prototype={initialize:function(){this.not_enough_credits_id="not_enough_credits";this.loader=new AjaxLoader();
this.itemsCount=0;},addToCart:function(b){var a=this;this.loader.show();new Ajax.Request("/cart-add-"+b+".html",{method:"post",onComplete:function(e){var c=e.responseText.evalJSON();a.itemsCount=c.cartItemsCount;$("total_in_cart").innerHTML=c.cartItemsCount;$(b).className="in_cart button_right";var d=$(b).childElements();
$(b).removeAttribute("onclick");$(b).onclick=null;d[1].innerHTML=locales["added_to_cart"];if(a.itemsCount==0){a.clearCartList(false);}this.loader.hide();}.bindAsEventListener(this)});},removeFromCart:function(b){var a=this;this.loader.show();new Ajax.Request("/cart-remove-"+b+".html",{method:"post",onComplete:function(g){var d=g.responseText.evalJSON();
a.itemsCount=d.cartItemsCount;$("total_in_cart").innerHTML=d.cartItemsCount;$(b+"-r").remove();var c=$("cartItemsBlock").childElements()[0];var e=c.getElementsByTagName("tr");var f=$("total_cart");if(a.itemsCount==0){a.clearCartList(true);}else{f.innerHTML=locales["cart_total_credits"].replace("{0}",d.total_in_cart);
}a.appendAddToCartButton(d.item);this.loader.hide();}.bindAsEventListener(this)});},refreshCart:function(){var a=this;this.loader.show();new Ajax.Request("/cart-refresh.html",{method:"post",onComplete:function(e){var c=e.responseText.evalJSON();$("total_in_cart").innerHTML=c.length;var d=false;if(c.length==0){d=true;
var b=$("cartItemsBlock").childElements()[0];b.remove();}a.clearCartList(d);if(c.length>0){a.createCartTable(c);}this.loader.hide();}.bindAsEventListener(this)});},createCartTable:function(f){var c=new Element("table");var g=new Element("tbody");var b=0;for(var d=0;d<f.length;d++){g.appendChild(this.createCartRow(f[d]));
b+=f[d].packPrice;}var j=new Element("tr");var a=new Element("td");a.className="cart_total_title";a.innerHTML="Total:";var h=new Element("td");h.className="cart_total";h.colSpan=2;var e=new Element("span");e.id="total_cart";h.appendChild(e);e.innerHTML=locales["cart_total_credits"].replace("{0}",b);j.appendChild(a);
j.appendChild(h);g.appendChild(j);c.appendChild(g);$("cartItemsBlock").appendChild(c);},createCartMessage:function(){var a=new Element("div",{id:"cart_message"});a.appendChild(document.createTextNode(locales["cart_message"]));return a;},createCartRow:function(j){var f=new Element("tr");f.className="complectation";
f.id=j.itemNumber+"-r";var b=new Element("td");b.className="pack_info";var a=new Element("p");a.className="pack_name";a.innerHTML=j.packName;var d=new Element("p");d.className="pack_content";d.innerHTML=locales["pack_includes"].replace("{0}",j.packItemsCount);b.appendChild(a);b.appendChild(d);var g=new Element("td");
g.className="pack_price";g.innerHTML="$"+j.packPrice;var i=new Element("td");i.className="pack_button";var h=new Element("a",{href:"/cart-remove-"+j.itemNumber+".html"});h.onclick=function(){cart.removeFromCart(j.itemNumber);return false;};h.id="remove_"+j.itemNumber;h.className="button_right";var c=new Element("span");
c.className="button_left";var e=new Element("span");e.className="button_content";e.innerHTML="Remove";h.appendChild(c);h.appendChild(e);i.appendChild(h);f.appendChild(b);f.appendChild(g);f.appendChild(i);return f;},clearCartList:function(b){var a=$("cartItemsBlock").childElements()[0];if(a!=null){a.remove();
}var c=$("total_cart");if(c!=null){c.remove();}if(b){if($("refreshCart_button")){$("refreshCart_button").remove();}if($("download_button")){$("download_button").remove();}if($("purchase_simple_button")){$("purchase_simple_button").remove();}if($("needMoney_button")){$("needMoney_button").remove();}$("empty_cart_note").innerHTML=locales["note_empty_cart"];
$("empty_cart_note").className="note";$("empty_cart_note").style.border="none";}},appendAddToCartButton:function(d){var e=$(d.itemNumber);if(e==null){return;}e.className="button_td";e.innerHTML="";var a=new Element("span");a.onclick=function(){cart.addToCart(d.itemNumber);return false;};a.className="button";
var b=new Element("span");b.className="button_left";var c=new Element("span");c.className="button_right";a.appendChild(b);b.appendChild(c);c.appendChild(document.createTextNode(locales["add_to_cart"]));$(d.itemNumber).appendChild(a);},empty:function(){if(this.itemsCount==0){return;}var a=this;this.loader.show();
new Ajax.Request("/cart_empty.jhtml",{method:"post",onComplete:function(d){a.itemsCount=0;a.loader.container.style.display="none";a.clearCartList();var b=d.responseText.evalJSON();b.each(function(f){var e=$(f.itemNumber);if(e!=null){a.appendAddToCartButton(f);}});var c=$(a.not_enough_credits_id);if(c!=null){c.remove();
}}.bindAsEventListener(this)});}};var DownloadPackItem=Class.create();DownloadPackItem.prototype={initialize:function(){},startDownload:function(a,b){new Ajax.Request("/user_profile/download/"+a+"/"+b+".html",{onComplete:function(h){var c=h.responseText.evalJSON();$("pack_item_"+b).innerHTML="";var g=new Element("div");
g.className="download_column";g.id=c.operationId;var f=new Element("img",{src:"/images/download-loader.gif"});g.appendChild(f);var e=new Element("br");g.appendChild(e);var d=new Element("span");d.className="downloads_link inactive waiting";d.innerHTML="Wait while download link is generating...";g.appendChild(d);
$("pack_item_"+b).appendChild(g);}.bindAsEventListener(this),onFailure:function(){self.returnDownloadButton(a,b);}.bindAsEventListener(this)});},returnDownloadButton:function(a,b){$("pack_item_"+b).innerHTML="";var d=new Element("span");d.className="download_item_button button_right";d.id="download_button_"+b;
d.onclick=function(){downloadPackItem.startDownload(a,b);return false;};var c=new Element("span");c.className="button_left";d.appendChild(c);var e=new Element("span");e.className="button_content";e.innerHTML="Download";d.appendChild(e);$("pack_item_"+b).appendChild(d);},inactiveState:function(a){$("pack_item_"+a).innerHTML="";
var e=new Element("div");e.className="align_center";var c=new Element("img",{src:"/images/expired.jpg"});e.appendChild(c);var b=new Element("br");e.appendChild(b);var d=new Element("span");d.className="downloads_link inactive expired";d.innerHTML="Inactive";e.appendChild(d);$("pack_item_"+a).appendChild(e);
},setTrackerEvent:function(b,c,a){_gaq.push(["_trackEvent",b,c,a]);}};var ItemsOfPack=Class.create();ItemsOfPack.prototype={initialize:function(){},showAllItems:function(c,a){$("block_"+c).innerHTML=locales["hide_all"];$("block_"+c).className="hide_all";$("block_"+c).onclick=function(){itemsOFPack.hideAllItems(c,a);
return false;};for(var b=1;b<=a;b++){Effect.Appear($("pack_"+c+"_"+b),{duration:0.2});}},hideAllItems:function(c,a){$("block_"+c).innerHTML=locales["show_all"];$("block_"+c).className="show_all";$("block_"+c).onclick=function(){itemsOFPack.showAllItems(c,a);return false;};for(var b=1;b<=a;b++){Effect.Fade($("pack_"+c+"_"+b),{duration:0.2});
}}};function getElement(b){var a=$$("div#"+b+" a");if(a.length>0){return a[0];}}
