var TRUVEO_BROWSER_DEBUG="Firefox";var TRUVEO_LOG_DEBUG=true;function log(a){if(TRUVEO_LOG_DEBUG){if(TRUVEO_BROWSER_DEBUG=="Firefox"){console.log(a)}else{alert(a)}}}var __log=log;var Class={create:function(){return function(){this.init.apply(this,arguments)}}};Object.extend=function(a,b){for(property in b){a[property]=b[property]}return a};var __MODULE=Class.create();var __MODULEobject={version:"1.0",productionVersion:"0.0",productionDate:"01/01/2009",parent:null,id:null,init:function(a){this.name=a},get:function(a){return this[a]},set:function(a,b){this[a]=b},info:function(){var a="["+this.name+":"+this.id+"]\n";a+="\t[version]          : "+this["version"]+"\n";a+="\t[author]           : "+this["author"]+"\n";a+="\t[productionVersion]: "+this["productionVersion"]+"\n";a+="\t[productionDate]   : "+this["productionDate"]+"\n";log(a)}};Object.extend(__MODULE.prototype,__MODULEobject);function addEvent(b,d,c){if(!c.$$guid){c.$$guid=addEvent.guid++}if(!b.events){b.events={}}var a=b.events[d];if(!a){a=b.events[d]={};if(b["on"+d]){a[0]=b["on"+d]}}a[c.$$guid]=c;b["on"+d]=handleEvent}addEvent.guid=1;function removeEvent(a,c,b){if(a.events&&a.events[c]){delete a.events[c][b.$$guid]}}function handleEvent(d){var c=true;d=d||fixEvent(window.event);var a=this.events[d.type];for(var b in a){this.$$handleEvent=a[b];if(this.$$handleEvent(d)===false){c=false}}return c}function fixEvent(a){a.preventDefault=fixEvent.preventDefault;a.stopPropagation=fixEvent.stopPropagation;return a}fixEvent.preventDefault=function(){this.returnValue=false};fixEvent.stopPropagation=function(){this.cancelBubble=true};function domReady(a){if(domReady.done){return a()}if(domReady.timer){domReady.ready.push(a)}else{domReady.ready=[a];domReady.timer=setInterval(isDOMReady,26)}}function isDOMReady(){if(domReady.done){return false}if(document&&document.getElementsByTagName&&document.getElementById&&document.body&&document.getElementById("__last")){clearInterval(domReady.timer);domReady.timer=null;for(var a=0;a<domReady.ready.length;a++){domReady.ready[a]()}domReady.ready=null;domReady.done=true}}function fbs_click(){var a=location.href;var b=document.title;window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(a)+"&t="+encodeURIComponent(b),"sharer","toolbar=0,status=0,width=626,height=436");return false}function twitter_click(){var a=location.href;var b=document.title;window.open("http://twitter.com/home?status="+encodeURIComponent(b)+" "+encodeURIComponent(a));return false}function Hook(a){this.env=a;this.functions=new Array();this.add=function(c,b){if(this.functions[c]){this.functions[c][this.functions[c].length]=b}else{this.functions[c]=new Array();this.functions[c][0]=b}};this.deletehook=function(d,c){for(var b in this.functions[d]){if(this.functions[d][b]==c){delete this.functions[d][b]}}};this.replace=function(e,b,d){for(var c in this.functions[e]){if(this.functions[e][c]==b){this.functions[e][c]=d}}};this.run=function(c){if(this.functions[c]){for(var b in this.functions[c]){this.functions[c][b].apply(this.env)}}else{return this.env.debug("hook class not defined: "+c)}}}function id(a){return document.getElementById(a)}function setOpacity(b,c,a){if(a=="Explorer"){b.style.filter="alpha(opacity="+c+")"}else{b.style.opacity=c/100}}function _setStyle(element,declaration){if(declaration.charAt(declaration.length-1)==";"){declaration=declaration.slice(0,-1)}var k,v;var splitted=declaration.split(";");for(var i=0,len=splitted.length;i<len;i++){k=rzCC(splitted[i].split(":")[0]);v=splitted[i].split(":")[1];eval("element.style."+k+"='"+v+"'")}}function rzCC(a){for(var b=/-([a-z])/;b.test(a);a=a.replace(b,RegExp.$1.toUpperCase())){}return a}function include(b){console.log(b);for(var a in b){$include(PATH+a)}}function require(a){document.write('<script type="text/javascript" src="'+a+'"><\/script>')}function include_dom(a){var b=document.getElementsByTagName("head").item(0);var c=document.createElement("script");c.setAttribute("language","javascript");c.setAttribute("type","text/javascript");c.setAttribute("src",a);b.appendChild(c);return false}function $include(b){if(document.body){var a=document.createElement("script");var c=document.getElementsByTagName("head").item(0);a.src=b;c.appendChild(a)}else{document.write("<script type='text/javascript' src='"+b+"' ><\/script>")}}var addListener=function(){if(window.addEventListener){return function(c,b,a){c.addEventListener(b,a,false)}}else{if(window.attachEvent){return function(c,b,a){var d=function(){a.call(c,window.event)};c.attachEvent("on"+b,d)}}else{return function(c,b,a){c["on"+b]=a}}}}();function findPosY(b){var a=0;if(b.offsetParent){while(1){a+=b.offsetTop;if(!b.offsetParent){break}b=b.offsetParent}}else{if(b.y){a+=b.y}}return a}function pageY(a){return a.offsetParent?a.offsetTop+pageY(a.offsetParent):a.offsetTop}function getStyle(c,a){if(c.style[a]){return c.style[a]}else{if(c.currentStyle){return c.currentStyle[a]}else{if(document.defaultView&&document.defaultView.getComputedStyle){a=a.replace(/([A-Z])/g,"-$1");a=a.toLowerCase();var b=document.defaultView.getComputedStyle(c,"");return b&&b.getPropertyValue(a)}else{return null}}}}function getHeight(a){return parseInt(getStyle(a,"height"))}function fullHeight(c){if(getStyle(c,"display")!="none"){return c.offsetHeight||getHeight(c)}var a=resetCSS(c,{display:"",visibility:"hidden",position:"absolute"});var b=c.clientHeight||getHeight(c);restoreCSS(c,a);return b}function fullWidth(c){if(getStyle(c,"display")!="none"){return c.offsetWidth||getWidth(c)}var b=resetCSS(c,{display:"",visibility:"hidden",position:"absolute"});var a=c.clientWidth||getWidth(c);restoreCSS(c,b);return a}function resetCSS(c,d){var a={};for(var b in d){a[b]=c.style[b];c.style[b]=d[b]}return a}function restoreCSS(b,c){for(var a in c){b.style[a]=c[a]}}function loadStyle(c,a){if(c){for(var b in a){new Function("elem","elem.style."+b+" = '"+a[b]+"'")(c)}}}function submitSearch(c){var b=document.getElementById("headersearch");var a=document.getElementById("search2");if(!c.empty){if(a.value!=c){a.value=c}b.submit();return true}}function setCookie(b,c,a){var d=new Date();d.setDate(d.getDate()+a);document.cookie=b+"="+escape(c)+";path=/;domain=.truveo.com;"+((a==null)?"":";expires="+d.toGMTString())+";"}function getCookie(a){var f=document.cookie.split(";");var b="";var d="";var e="";var c=false;for(i=0;i<f.length;i++){b=f[i].split("=");d=b[0].replace(/^\s+|\s+$/g,"");if(d==a){c=true;if(b.length>1){e=unescape(b[1].replace(/^\s+|\s+$/g,""))}return e;break}b=null;d=""}if(!c){return""}}addListener(document,"click",function(a){hideDiv("countrybox");hideDiv("settingsbox");hideDiv("sendbox");hideDiv("moredescbox");hideDiv("querycompletions");hideDiv("list_watchlist")});function cancelbubble(a){if(!a){var a=window.event}a.cancelBubble=true;if(a.stopPropagation){a.stopPropagation()}}function hideDiv(b){var a=document.getElementById(b);if(!a){return}if(a.style.display=="inline"){addClass(a,"wasinline")}else{if(a.style.display=="block"){addClass(a,"wasblock")}}a.style.display="none";toggleoverlayvisible(1)}function showDiv(b){var a=document.getElementById(b);if(!a){return}if(hasClass(a,"wasinline")){a.style.display="inline";removeClass(a,"wasinline")}else{if(hasClass(a,"wasblock")){a.style.display="block";removeClass(a,"block")}else{a.style.display=getDisplayStyleByTagName(a)}}}function addClass(b,a){if(!hasClass(b,a)){b.className+=b.className?(" "+a):a}}function hasClass(c,d){if(!c){return}var e=d.toUpperCase();if(c.className){var b=c.className.split(" ");for(var a=0;a<b.length;a++){if(b[a].toUpperCase()==e){return true}}}return false}var _Url={encode:function(a){return escape(this._utf8_encode(a))},decode:function(a){return this._utf8_decode(unescape(a))},_utf8_encode:function(b){b=b.replace(/\r\n/g,"\n");var a="";for(var e=0;e<b.length;e++){var d=b.charCodeAt(e);if(d<128){a+=String.fromCharCode(d)}else{if((d>127)&&(d<2048)){a+=String.fromCharCode((d>>6)|192);a+=String.fromCharCode((d&63)|128)}else{a+=String.fromCharCode((d>>12)|224);a+=String.fromCharCode(((d>>6)&63)|128);a+=String.fromCharCode((d&63)|128)}}}return a},_utf8_decode:function(a){var b="";var d=0;var e=c1=c2=0;while(d<a.length){e=a.charCodeAt(d);if(e<128){b+=String.fromCharCode(e);d++}else{if((e>191)&&(e<224)){c2=a.charCodeAt(d+1);b+=String.fromCharCode(((e&31)<<6)|(c2&63));d+=2}else{c2=a.charCodeAt(d+1);c3=a.charCodeAt(d+2);b+=String.fromCharCode(((e&15)<<12)|((c2&63)<<6)|(c3&63));d+=3}}}return b}};handleBroken=function(a){a.className="search_thumb unavailable";a.src="http://thumbnails.truveo.com/pixel.gif"};function JSONscriptRequest(a){this.fullUrl=a;this.noCacheIE="&noCacheIE="+(new Date()).getTime();this.headLoc=document.getElementsByTagName("head").item(0);this.scriptId="JscriptId"+JSONscriptRequest.scriptCounter++}JSONscriptRequest.scriptCounter=1;JSONscriptRequest.prototype.buildScriptTag=function(){this.scriptObj=document.createElement("script");this.scriptObj.setAttribute("type","text/javascript");this.scriptObj.setAttribute("charset","utf-8");this.scriptObj.setAttribute("src",this.fullUrl+this.noCacheIE);this.scriptObj.setAttribute("id",this.scriptId)};JSONscriptRequest.prototype.removeScriptTag=function(){this.headLoc.removeChild(this.scriptObj)};JSONscriptRequest.prototype.addScriptTag=function(){this.headLoc.appendChild(this.scriptObj)};var GB_ROOT_DIR="http://ru.truveo.com/client/versions/version0/js/greybox/";var GB_IMG_DIR="http://www.truveo.com/client/versions/version0/images/";var win;var GB_myShow=function(b,f,a,g,l,h){var d={caption:b,center_win:true,height:a||500,width:g||500,fullscreen:false,show_loading:false,callback_fn:l};win=new GB_Window(d);if(/truveo\.com(:\d+)?\/[^\/]+\/id\//.test(f)){var c=f.replace(/\/id\//,"/m/");return win.show(c)}if(/xml\.truveo\.com/.test(f)){return true}else{return win.show(f)}};AJS={BASE_URL:"",drag_obj:null,drag_elm:null,_drop_zones:[],_cur_pos:null,getScrollTop:function(){var a;if(document.documentElement&&document.documentElement.scrollTop){a=document.documentElement.scrollTop}else{if(document.body){a=document.body.scrollTop}}return a},addClass:function(){var c=AJS.forceArray(arguments);var b=c.pop();var a=function(d){if(!new RegExp("(^|\\s)"+b+"(\\s|$)").test(d.className)){d.className+=(d.className?" ":"")+b}};AJS.map(c,function(d){a(d)})},setStyle:function(){var c=AJS.forceArray(arguments);var b=c.pop();var a=c.pop();AJS.map(c,function(d){d.style[a]=AJS.getCssDim(b)})},extend:function(d){var c=new this("no_init");for(k in d){var b=c[k];var a=d[k];if(b&&b!=a&&typeof a=="function"){a=this._parentize(a,b)}c[k]=a}return new AJS.Class(c)},log:function(a){if(window.console){console.log(a)}else{var b=AJS.$("ajs_logger");if(!b){b=AJS.DIV({id:"ajs_logger",style:"color: green; position: absolute; left: 0"});b.style.top=AJS.getScrollTop()+"px";AJS.ACN(AJS.getBody(),b)}AJS.setHTML(b,""+a)}},setHeight:function(){var a=AJS.forceArray(arguments);a.splice(a.length-1,0,"height");AJS.setStyle.apply(null,a)},_getRealScope:function(a,c){c=AJS.$A(c);var b=a._cscope||window;return function(){var d=AJS.$FA(arguments).concat(c);return a.apply(b,d)}},documentInsert:function(a){if(typeof(a)=="string"){a=AJS.HTML2DOM(a)}document.write('<span id="dummy_holder"></span>');AJS.swapDOM(AJS.$("dummy_holder"),a)},getWindowSize:function(c){c=c||document;var b,a;if(self.innerHeight){b=self.innerWidth;a=self.innerHeight}else{if(c.documentElement&&c.documentElement.clientHeight){b=c.documentElement.clientWidth;a=c.documentElement.clientHeight}else{if(c.body){b=c.body.clientWidth;a=c.body.clientHeight}}}return{w:b,h:a}},flattenList:function(b){var c=[];var a=function(e,d){AJS.map(d,function(f){if(f==null){}else{if(AJS.isArray(f)){a(e,f)}else{e.push(f)}}})};a(c,b);return c},isFunction:function(a){return(typeof a=="function")},setEventKey:function(a){a.key=a.keyCode?a.keyCode:a.charCode;if(window.event){a.ctrl=window.event.ctrlKey;a.shift=window.event.shiftKey}else{a.ctrl=a.ctrlKey;a.shift=a.shiftKey}switch(a.key){case 63232:a.key=38;break;case 63233:a.key=40;break;case 63235:a.key=39;break;case 63234:a.key=37;break}},removeElement:function(){var a=AJS.forceArray(arguments);AJS.map(a,function(b){AJS.swapDOM(b,null)})},_unloadListeners:function(){if(AJS.listeners){AJS.map(AJS.listeners,function(c,b,a){AJS.REV(c,b,a)})}AJS.listeners=[]},join:function(b,a){try{return a.join(b)}catch(d){var c=a[0]||"";AJS.map(a,function(e){c+=b+e},1);return c+""}},getIndex:function(d,c,b){for(var a=0;a<c.length;a++){if(b&&b(c[a])||d==c[a]){return a}}return -1},isIn:function(c,a){var b=AJS.getIndex(c,a);if(b!=-1){return true}else{return false}},isArray:function(a){return a instanceof Array},setLeft:function(){var a=AJS.forceArray(arguments);a.splice(a.length-1,0,"left");AJS.setStyle.apply(null,a)},appendChildNodes:function(a){if(arguments.length>=2){AJS.map(arguments,function(b){if(AJS.isString(b)){b=AJS.TN(b)}if(AJS.isDefined(b)){a.appendChild(b)}},1)}return a},getElementsByTagAndClassName:function(g,f,d,b){var h=[];if(!AJS.isDefined(d)){d=document}if(!AJS.isDefined(g)){g="*"}var a=d.getElementsByTagName(g);var e=a.length;var c=new RegExp("(^|\\s)"+f+"(\\s|$)");for(i=0,j=0;i<e;i++){if(c.test(a[i].className)||f==null){h[j]=a[i];j++}}if(b){return h[0]}else{return h}},isOpera:function(){return(navigator.userAgent.toLowerCase().indexOf("opera")!=-1)},isString:function(a){return(typeof a=="string")},hideElement:function(b){var a=AJS.forceArray(arguments);AJS.map(a,function(c){c.style.display="none"})},setOpacity:function(b,a){b.style.opacity=a;b.style.filter="alpha(opacity="+a*100+")"},insertBefore:function(b,a){a.parentNode.insertBefore(b,a);return b},setWidth:function(){var a=AJS.forceArray(arguments);a.splice(a.length-1,0,"width");AJS.setStyle.apply(null,a)},createArray:function(a){if(AJS.isArray(a)&&!AJS.isString(a)){return a}else{if(!a){return[]}else{return[a]}}},isDict:function(b){var a=String(b);return a.indexOf(" Object")!=-1},isMozilla:function(){return(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1&&navigator.productSub>=20030210)},removeEventListener:function(e,d,a,c){var b="ajsl_"+d+a;if(!c){c=false}a=e[b]||a;if(e["on"+d]==a){e["on"+d]=e[b+"old"]}if(e.removeEventListener){e.removeEventListener(d,a,c);if(AJS.isOpera()){e.removeEventListener(d,a,!c)}}else{if(e.detachEvent){e.detachEvent("on"+d,a)}}},callLater:function(a,c){var b=function(){a()};window.setTimeout(b,c)},setTop:function(){var a=AJS.forceArray(arguments);a.splice(a.length-1,0,"top");AJS.setStyle.apply(null,a)},_createDomShortcuts:function(){var b=["ul","li","td","tr","th","tbody","table","input","span","b","a","div","img","button","h1","h2","h3","h4","h5","h6","br","textarea","form","p","select","option","optgroup","iframe","script","center","dl","dt","dd","small","pre","i"];var a=function(c){AJS[c.toUpperCase()]=function(){return AJS.createDOM.apply(null,[c,arguments])}};AJS.map(b,a);AJS.TN=function(c){return document.createTextNode(c)}},addCallback:function(a){this.callbacks.unshift(a)},bindMethods:function(c){for(var b in c){var a=c[b];if(typeof(a)=="function"){c[b]=AJS.$b(a,c)}}},partial:function(b){var a=AJS.$FA(arguments);a.shift();return function(){a=a.concat(AJS.$FA(arguments));return b.apply(window,a)}},isNumber:function(a){return(typeof a=="number")},getCssDim:function(a){if(AJS.isString(a)){return a}else{return a+"px"}},isIe:function(){return(navigator.userAgent.toLowerCase().indexOf("msie")!=-1&&navigator.userAgent.toLowerCase().indexOf("opera")==-1)},removeClass:function(){var c=AJS.forceArray(arguments);var a=c.pop();var b=function(d){d.className=d.className.replace(new RegExp("\\s?"+a,"g"),"")};AJS.map(c,function(d){b(d)})},setHTML:function(b,a){b.innerHTML=a;return b},map:function(d,f,c,a){var e=0,b=d.length;if(c){e=c}if(a){b=a}for(e;e<b;e++){var g=f(d[e],e);if(g!=undefined){return g}}},addEventListener:function(h,g,l,f,e){var d="ajsl_"+g+l;if(!e){e=false}AJS.listeners=AJS.$A(AJS.listeners);if(AJS.isIn(g,["keypress","keydown","keyup","click"])){var c=l;l=function(m){AJS.setEventKey(m);return c.apply(window,arguments)}}var b=AJS.isIn(g,["submit","load","scroll","resize"]);var a=AJS.$A(h);AJS.map(a,function(n){if(f){var m=l;l=function(q){AJS.REV(n,g,l);return m.apply(window,arguments)}}if(b){var p=n["on"+g];var o=function(){if(p){l(arguments);return p(arguments)}else{return l(arguments)}};n[d]=o;n[d+"old"]=p;h["on"+g]=o}else{n[d]=l;if(n.attachEvent){n.attachEvent("on"+g,l)}else{if(n.addEventListener){n.addEventListener(g,l,e)}}AJS.listeners.push([n,g,l])}})},preloadImages:function(){AJS.AEV(window,"load",AJS.$p(function(a){AJS.map(a,function(c){var b=new Image();b.src=c})},arguments))},forceArray:function(a){var b=[];AJS.map(a,function(c){b.push(c)});return b},update:function(b,a){for(var c in a){b[c]=a[c]}return b},getBody:function(){return AJS.$bytc("body")[0]},HTML2DOM:function(b,a){var c=AJS.DIV();c.innerHTML=b;if(a){return c.childNodes[0]}else{return c}},getElement:function(a){if(AJS.isString(a)||AJS.isNumber(a)){return document.getElementById(a)}else{return a}},showElement:function(){var a=AJS.forceArray(arguments);AJS.map(a,function(b){b.style.display=""})},bind:function(b,c,a){b._cscope=c;return AJS._getRealScope(b,a)},createDOM:function(f,d){var e=0,c;var h=document.createElement(f);var a=d[0];if(AJS.isDict(d[e])){for(k in a){c=a[k];if(k=="style"||k=="s"){h.style.cssText=c}else{if(k=="c"||k=="class"||k=="className"){h.className=c}else{h.setAttribute(k,c)}}}e++}if(a==null){e=1}for(var b=e;b<d.length;b++){var c=d[b];if(c){var g=typeof(c);if(g=="string"||g=="number"){c=AJS.TN(c)}h.appendChild(c)}}return h},swapDOM:function(c,b){c=AJS.getElement(c);var a=c.parentNode;if(b){b=AJS.getElement(b);a.replaceChild(b,c)}else{a.removeChild(c)}return b},isDefined:function(a){return(a!="undefined"&&a!=null)}};AJS.$=AJS.getElement;AJS.$$=AJS.getElements;AJS.$f=AJS.getFormElement;AJS.$p=AJS.partial;AJS.$b=AJS.bind;AJS.$A=AJS.createArray;AJS.DI=AJS.documentInsert;AJS.ACN=AJS.appendChildNodes;AJS.RCN=AJS.replaceChildNodes;AJS.AEV=AJS.addEventListener;AJS.REV=AJS.removeEventListener;AJS.$bytc=AJS.getElementsByTagAndClassName;AJS.$AP=AJS.absolutePosition;AJS.$FA=AJS.forceArray;AJS.addEventListener(window,"unload",AJS._unloadListeners);AJS._createDomShortcuts();AJS.Class=function(b){var a=function(){if(arguments[0]!="no_init"){return this.init.apply(this,arguments)}};a.prototype=b;AJS.update(a,AJS.Class.prototype);return a};AJS.Class.prototype={extend:function(c){var b=new this("no_init");for(k in c){var a=b[k];var d=c[k];if(a&&a!=d&&typeof d=="function"){d=this._parentize(d,a)}b[k]=d}return new AJS.Class(b)},implement:function(a){AJS.update(this.prototype,a)},_parentize:function(b,a){return function(){this.parent=a;return b.apply(this,arguments)}}};script_loaded=true;script_loaded=true;var GB_CURRENT=null;GB_hide=function(a){GB_CURRENT.hide(a)};GreyBox=new AJS.Class({init:function(c){this.use_fx=AJS.fx;this.type="page";this.overlay_click_close=true;this.salt=0;this.root_dir=GB_ROOT_DIR;this.image_dir=GB_IMG_DIR;this.callback_fns=[];this.reload_on_close=false;this.src_loader=this.root_dir+"loader_frame.html";var b=window.location.hostname.indexOf("www");var a=this.src_loader.indexOf("www");if(b!=-1&&a==-1){this.src_loader=this.src_loader.replace("://","://www.")}if(b==-1&&a!=-1){this.src_loader=this.src_loader.replace("://www.","://")}this.show_loading=true;AJS.update(this,c)},addCallback:function(a){if(a){this.callback_fns.push(a)}},show:function(b){GB_CURRENT=this;this.url=b;var a=[AJS.$bytc("object"),AJS.$bytc("select")];AJS.map(AJS.flattenList(a),function(c){c.style.visibility="hidden"});this.createElements();return false},hide:function(a){var b=this;AJS.callLater(function(){var e=b.callback_fns;if(e!=[]){AJS.map(e,function(f){f()})}b.onHide();if(b.use_fx){var d=b.overlay;AJS.fx.fadeOut(b.overlay,{onComplete:function(){AJS.removeElement(d);d=null},duration:300});AJS.removeElement(b.g_window)}else{AJS.removeElement(b.g_window,b.overlay)}b.removeFrame();AJS.REV(window,"scroll",_GB_setOverlayDimension);AJS.REV(window,"resize",_GB_update);var c=[AJS.$bytc("object"),AJS.$bytc("select")];AJS.map(AJS.flattenList(c),function(f){f.style.visibility="visible"});GB_CURRENT=null;if(b.reload_on_close){window.location.reload()}if(AJS.isFunction(a)){a()}},10)},update:function(){this.setOverlayDimension();this.setFrameSize();this.setWindowPosition()},createElements:function(){this.initOverlay();this.g_window=AJS.DIV({id:"GB_window"});AJS.hideElement(this.g_window);AJS.getBody().insertBefore(this.g_window,this.overlay.nextSibling);this.initFrame();this.initHook();this.update();var a=this;if(this.use_fx){AJS.fx.fadeIn(this.overlay,{duration:300,to:0.7,onComplete:function(){a.onShow();AJS.showElement(a.g_window);a.startLoading()}})}else{AJS.setOpacity(this.overlay,0.7);AJS.showElement(this.g_window);this.onShow();this.startLoading()}AJS.AEV(window,"scroll",_GB_setOverlayDimension);AJS.AEV(window,"resize",_GB_update)},removeFrame:function(){try{AJS.removeElement(this.iframe)}catch(a){}this.iframe=null},startLoading:function(){this.iframe.src=this.src_loader+"?s="+this.salt++;AJS.showElement(this.iframe)},setOverlayDimension:function(){var b=AJS.getWindowSize();if(AJS.isMozilla()||AJS.isOpera()){AJS.setWidth(this.overlay,"100%")}else{AJS.setWidth(this.overlay,b.w)}var a=Math.max(AJS.getScrollTop()+b.h,AJS.getScrollTop()+this.height);if(a<AJS.getScrollTop()){AJS.setHeight(this.overlay,a)}else{AJS.setHeight(this.overlay,AJS.getScrollTop()+b.h)}},initOverlay:function(){this.overlay=AJS.DIV({id:"GB_overlay"});if(this.overlay_click_close){AJS.AEV(this.overlay,"click",GB_hide)}AJS.setOpacity(this.overlay,0);AJS.getBody().insertBefore(this.overlay,AJS.getBody().firstChild)},initFrame:function(){if(!this.iframe){var a={name:"GB_frame","class":"GB_frame",frameBorder:0};if(AJS.isIe()){a.src='javascript:false;document.write("");'}this.iframe=AJS.IFRAME(a);this.middle_cnt=AJS.DIV({"class":"content"},this.iframe);this.top_cnt=AJS.DIV();this.bottom_cnt=AJS.DIV();AJS.ACN(this.g_window,this.top_cnt,this.middle_cnt,this.bottom_cnt)}},onHide:function(){},onShow:function(){},setFrameSize:function(){},setWindowPosition:function(){},initHook:function(){}});_GB_update=function(){if(GB_CURRENT){GB_CURRENT.update()}};_GB_setOverlayDimension=function(){if(GB_CURRENT){GB_CURRENT.setOverlayDimension()}};AJS.preloadImages(GB_IMG_DIR+"indicator.gif");script_loaded=true;var GB_SETS={};function decoGreyboxLinks(){var a=AJS.$bytc("a");AJS.map(a,function(d){if(d.getAttribute("href")&&d.getAttribute("rel")){var b=d.getAttribute("rel");if(b.indexOf("gb_")==0){var f=b.match(/\w+/)[0];var e=b.match(/\[(.*)\]/)[1];var c=0;var g={caption:d.title||"",url:d.href};if(f=="gb_pageset"||f=="gb_imageset"){if(!GB_SETS[e]){GB_SETS[e]=[]}GB_SETS[e].push(g);c=GB_SETS[e].length}if(f=="gb_pageset"){d.onclick=function(){GB_showFullScreenSet(GB_SETS[e],c);return false}}if(f=="gb_imageset"){d.onclick=function(){GB_showImageSet(GB_SETS[e],c);return false}}if(f=="gb_image"){d.onclick=function(){GB_showImage(g.caption,g.url);return false}}if(f=="gb_page"){d.onclick=function(){var h=e.split(/, ?/);GB_show(g.caption,g.url,parseInt(h[1]),parseInt(h[0]));return false}}if(f=="gb_page_fs"){d.onclick=function(){GB_showFullScreen(g.caption,g.url);return false}}if(f=="gb_page_center"){d.onclick=function(){var h=e.split(/, ?/);GB_showCenter(g.caption,g.url,parseInt(h[1]),parseInt(h[0]));return false}}}}})}AJS.AEV(window,"load",decoGreyboxLinks);GB_showImage=function(c,d,a){var b={width:300,height:300,type:"image",fullscreen:false,center_win:true,caption:c,callback_fn:a};var e=new GB_Gallery(b);return e.show(d)};GB_showPage=function(e,a,d){var b={type:"page",caption:e,callback_fn:d,fullscreen:true,center_win:false};var c=new GB_Gallery(b);return c.show(a)};GB_Gallery=GreyBox.extend({init:function(a){this.parent({});this.img_close=GB_IMG_DIR+"g_close.gif";AJS.update(this,a);this.addCallback(this.callback_fn)},initHook:function(){AJS.addClass(this.g_window,"GB_Gallery");var d=AJS.DIV({"class":"inner"});this.header=AJS.DIV({"class":"GB_header"},d);AJS.setOpacity(this.header,0);AJS.getBody().insertBefore(this.header,this.overlay.nextSibling);var b=AJS.TD({id:"GB_caption","class":"caption",width:"40%"},this.caption);var g=AJS.TD({id:"GB_middle","class":"middle",width:"20%"});var f=AJS.IMG({src:this.img_close});AJS.AEV(f,"click",GB_hide);var e=AJS.TD({"class":"close",width:"40%"},f);var c=AJS.TBODY(AJS.TR(b,g,e));var a=AJS.TABLE({cellspacing:"0",cellpadding:0,border:0},c);AJS.ACN(d,a);if(this.fullscreen){AJS.AEV(window,"scroll",AJS.$b(this.setWindowPosition,this))}else{AJS.AEV(window,"scroll",AJS.$b(this._setHeaderPos,this))}},setFrameSize:function(){var a=this.overlay.offsetWidth;var b=AJS.getWindowSize();if(this.fullscreen){this.width=a-40;this.height=b.h-80}AJS.setWidth(this.iframe,this.width);AJS.setHeight(this.iframe,this.height);AJS.setWidth(this.header,a)},_setHeaderPos:function(){AJS.setTop(this.header,AJS.getScrollTop()+10)},setWindowPosition:function(){var c=this.overlay.offsetWidth;var b=AJS.getWindowSize();AJS.setLeft(this.g_window,((c-50-this.width)/2));var a=AJS.getScrollTop()+55;if(!this.center_win){AJS.setTop(this.g_window,a)}else{var d=((b.h-this.height)/2)+20+AJS.getScrollTop();if(d<0){d=0}if(a>d){d=a}AJS.setTop(this.g_window,d)}this._setHeaderPos()},onHide:function(){AJS.removeElement(this.header);AJS.removeClass(this.g_window,"GB_Gallery")},onShow:function(){if(this.use_fx){AJS.fx.fadeIn(this.header,{to:1})}else{AJS.setOpacity(this.header,1)}}});AJS.preloadImages(GB_IMG_DIR+"g_close.gif");GB_showFullScreenSet=function(e,d,c){var b={type:"page",fullscreen:true,center_win:false};var a=new GB_Sets(b,e);a.addCallback(c);a.showSet(d-1);return false};GB_showImageSet=function(e,d,c){var b={type:"image",fullscreen:false,center_win:true,width:300,height:300};var a=new GB_Sets(b,e);a.addCallback(c);a.showSet(d-1);return false};GB_Sets=GB_Gallery.extend({init:function(a,b){this.parent(a);if(!this.img_next){this.img_next=this.image_dir+"next.gif"}if(!this.img_prev){this.img_prev=this.image_dir+"prev.gif"}this.current_set=b},showSet:function(b){this.current_index=b;var a=this.current_set[this.current_index];this.show(a.url);this._setCaption(a.caption);this.btn_prev=AJS.IMG({"class":"left",src:this.img_prev});this.btn_next=AJS.IMG({"class":"right",src:this.img_next});AJS.AEV(this.btn_prev,"click",AJS.$b(this.switchPrev,this));AJS.AEV(this.btn_next,"click",AJS.$b(this.switchNext,this));GB_STATUS=AJS.SPAN({"class":"GB_navStatus"});AJS.ACN(AJS.$("GB_middle"),this.btn_prev,GB_STATUS,this.btn_next);this.updateStatus()},updateStatus:function(){AJS.setHTML(GB_STATUS,(this.current_index+1)+" / "+this.current_set.length);if(this.current_index==0){AJS.addClass(this.btn_prev,"disabled")}else{AJS.removeClass(this.btn_prev,"disabled")}if(this.current_index==this.current_set.length-1){AJS.addClass(this.btn_next,"disabled")}else{AJS.removeClass(this.btn_next,"disabled")}},_setCaption:function(a){AJS.setHTML(AJS.$("GB_caption"),a)},updateFrame:function(){var a=this.current_set[this.current_index];this._setCaption(a.caption);this.url=a.url;this.startLoading()},switchPrev:function(){if(this.current_index!=0){this.current_index--;this.updateFrame();this.updateStatus()}},switchNext:function(){if(this.current_index!=this.current_set.length-1){this.current_index++;this.updateFrame();this.updateStatus()}}});AJS.AEV(window,"load",function(){AJS.preloadImages(GB_IMG_DIR+"next.gif",GB_IMG_DIR+"prev.gif")});GB_show=function(b,c,g,f,d){var a={caption:b,height:g||500,width:f||500,fullscreen:false,callback_fn:d};var e=new GB_Window(a);return e.show(c)};GB_showCenter=function(g,a,e,c,d){var b={caption:g,center_win:true,height:e||500,width:c||500,fullscreen:false,callback_fn:d};var f=new GB_Window(b);return f.show(a)};GB_showFullScreen=function(d,c,b){var a={caption:d,fullscreen:true,callback_fn:b};var e=new GB_Window(a);return e.show(c)};GB_Window=GreyBox.extend({init:function(a){this.parent({});this.img_header=this.image_dir+"header_bg_grey.gif";this.img_close=this.image_dir+"w_close.gif";this.show_close_img=true;AJS.update(this,a);this.addCallback(this.callback_fn)},initHook:function(){AJS.addClass(this.g_window,"GB_Window");this.header=AJS.TABLE({"class":"header"});this.header.style.backgroundImage="url("+this.img_header+")";var e=AJS.TD({id:"greybox_title","class":"caption"},this.caption);var c=AJS.TD({"class":"close"});if(this.show_close_img){var b=AJS.DIV({"class":"closebutton"});var a=AJS.DIV({"class":"closetxt"},AJS.SPAN("Закрыть"));var d=AJS.DIV(b,a);AJS.AEV([b,a],"mouseover",function(){AJS.addClass(a,"on")});AJS.AEV([b,a],"mouseout",function(){AJS.removeClass(a,"on")});AJS.AEV([b,a],"mousedown",function(){AJS.addClass(a,"click")});AJS.AEV([b,a],"mouseup",function(){AJS.removeClass(a,"click")});AJS.AEV([b,a],"click",GB_hide);AJS.ACN(c,d)}tbody_header=AJS.TBODY();AJS.ACN(tbody_header,AJS.TR(e,c));AJS.ACN(this.header,tbody_header);AJS.ACN(this.top_cnt,this.header);if(this.fullscreen){AJS.AEV(window,"scroll",AJS.$b(this.setWindowPosition,this))}},setFrameSize:function(){if(this.fullscreen){var a=AJS.getWindowSize();overlay_h=a.h;this.width=Math.round(this.overlay.offsetWidth-(this.overlay.offsetWidth/100)*10);this.height=Math.round(overlay_h-(overlay_h/100)*10)}AJS.setWidth(this.header,this.width+6);AJS.setWidth(this.iframe,this.width);AJS.setHeight(this.iframe,this.height)},setWindowPosition:function(){var b=AJS.getWindowSize();AJS.setLeft(this.g_window,((b.w-this.width)/2)-13);if(!this.center_win){AJS.setTop(this.g_window,AJS.getScrollTop())}else{var a=((b.h-this.height)/2)-20+AJS.getScrollTop();if(a<0){a=0}AJS.setTop(this.g_window,a)}}});AJS.preloadImages(GB_IMG_DIR+"w_close.gif",GB_IMG_DIR+"header_bg.gif");script_loaded=true;var _t={sp:function(){this.j=j=new Date();var a=j.getTime()-this.i.getTime();j.setTime(a);document.getElementById("timer").innerHTML=j.getMinutes()+":"+j.getSeconds()+":"+j.getMilliseconds()},st:function(){this.i=new Date()}};_t.st();