// basic.js
function log(){if(window.console)
window.console.log.apply(window.console,arguments);else{log.output.push(array(arguments).join(', '));clearTimeout(log.time);log.time=setTimeout(function(){var t=log.output.join('\n');log.output=[];alert(t);},100);}
return arguments[0];}
log.output=[];function timestamp(name){timestamp.logs.push([name,(new Date).getTime()]);clearTimeout(timestamp.time);timestamp.time=setTimeout(timestamp.output,1000);}
timestamp.logs=[];timestamp.output=function(){var a=timestamp.logs;if(a[0]){log(a[0][0]);for(var i=1;i<a.length;i++)
log(a[i][0]+" : "+(a[i][1]-a[i-1][1]));timestamp.logs=[];}};function extend(target){for(var a=arguments,i,k=0;++k<a.length;)
for(i in a[k])target[i]=a[k][i];return target;}
function copy(o){function F(){}F.prototype=o;return new F();}
function array(a){var r=[],i=0,l=a.length;try{r=array.a.slice.call(a,0);if(r[0]===undefined)throw"";}catch(e){for(;i<l;i++)r[i]=a[i];}
return r;}
array.a=[];function assignID(object){if(!object.__guid)object.__guid=assignID.$id++;return object.__guid;}
assignID.$id=1;function bind(method,context){var bound=function(){return method.apply(context,arguments);};bound.__cloneID=assignID(method);return bound;}
function dom(elem,name){return!elem?document:name?array(dom(elem).getElementsByTagName(name)):elem.constructor==String?dom().getElementById(elem):elem;}
extend(dom,{parent:function(elem,klass,name){klass=klass&&new RegExp("(^|\\s)"+klass+"(\\s|$)");name=name&&name.toUpperCase();while((elem=elem.parentNode)&&(klass&&!klass.test(elem.className)||name&&name!=elem.nodeName));return elem;},parentOrSelf:function(elem,klass,name){klass=klass&&new RegExp("(^|\\s)"+klass+"(\\s|$)");name=name&&name.toUpperCase();while(elem&&(klass&&!klass.test(elem.className)||name&&name!=elem.nodeName))
elem=elem.parentNode;return elem||null;},create:function(html){var d=this().createElement('div'),res;d.innerHTML=html;res=d.firstChild;d=null;return this.remove(res);},remove:function(elem){var p=this.parent(elem);return p&&p.removeChild(elem);},after:function(elem,after){var p=this.parent(after);return p&&p.insertBefore(elem,after.nextSibling);},before:function(elem,before){var p=this.parent(before);return p&&p.insertBefore(elem,before);},hasClass:function(elem,klass){return new RegExp("(^|\\s)"+klass+"(\\s|$)").test(elem.className);},addClass:function(elem,klass){if(!this.hasClass(elem,klass))
elem.className+=(elem.className?" ":"")+klass;return elem;},removeClass:function(elem,klass){elem.className=elem.className.replace(new RegExp("(^|\\s)"+klass+"(\\s|$)"),"$2");return elem;},toggleClass:function(elem,klass){return this[(this.hasClass(elem,klass)?'remove':'add')+'Class'](elem,klass);},style:function(elem,name,value){for(var i=1,a=arguments;i<a.length;i+=2)
(dom.style[a[i]]||dom.style._default).call(elem.style,a[i+1],a[i]);}});extend(dom.style,{px:function(elem){for(var i=1,a=arguments;i<a.length;i+=2)
elem.style[a[i]]=Math.round(a[i+1])+"px";},_default:function(value,name){this[name]=value;},opacity:function(value){this.opacity=value;this.filter=value==1?"":"alpha(opacity="+(value*100)+")";}});var events={add:function(elem,type,handl){if(!elem.__events)elem.__events={};var handlers=elem.__events[type];if(!handlers){handlers=elem.__events[type]={};if(elem["on"+type]){var on=elem["on"+type];elem["on"+type]=null;this.add(elem,type,on);}}
handlers[assignID(handl)]=handl;elem["on"+type]=this.handle;},remove:function(elem,type,handl){if(!type)for(type in elem.__events)
this.remove(elem,type);if(elem.__events&&elem.__events[type]){if(!handl)for(handl in elem.__events[type])
delete elem.__events[type][handl];else
delete elem.__events[type][handl.__guid];}},handle:function(e){if(!(e=e||window.event))return;if(!e.target&&e.srcElement)
e.target=e.srcElement;if(!e.relatedTarget&&e.toElement)
e.relatedTarget=e.toElement==e.target?e.fromElement:e.toElement;if(!e.preventDefault)
e.preventDefault=function(){this.returnValue=false;};if(!e.stopPropagation)
e.stopPropagation=function(){this.cancelBubble=true;};if(this.__events){var handlers=this.__events[e.type];var result,res;for(var i in handlers){if((res=handlers[i].call(this,e))===false){e.preventDefault();e.stopPropagation();result=false;}}}
if(e.srcElement)
e=e.target=e.relatedTarget=e.preventDefault=e.stopPropagation=null;return result===false?false:res;},dispatch:function(e){var elem=e.target,type=e.type;while(elem){if(elem['on'+type])
elem['on'+type](e);elem=!e.cancelBubble&&dom.parent(elem);}
return!(e.returnValue===false);},hover:function(elem){this.add(elem,'mouseover',function(e){if(!this.__hovered){this.__hovered=true;events.dispatch({type:"over",target:this});}});this.add(elem,'mouseout',function(e){var p=e.relatedTarget;while(p&&p!=this)p=dom.parent(p);if(p!=this){this.__hovered=false;events.dispatch({type:"out",target:this});}});}};var cookie={set:function(name,value,options){var a=[encodeURIComponent(name)+'='+encodeURIComponent(value)];for(name in options){value=options[name];a.push(name+'='
+(name=='expires'?new Date((new Date).getTime()+value*86400000).toUTCString():name=='secure'?name:value));}
document.cookie=a.join('; ');},get:function(name){var res=String(document.cookie).match(new RegExp('\\b'+encodeURIComponent(name).rescape()+'=([^;]*)'));return res&&decodeURIComponent(res[1])||null;},rem:function(name,options){this.set(name,'',extend({expires:-1},options));}};function setTimeline(fn,time,inter){var start=(new Date).getTime();time=time||1000;return inter=window.setInterval(function(){var pos=((new Date).getTime()-start)/time;if(pos>=1){pos=1;clearTimeline(inter);}
fn(pos);},inter||13);}
function clearTimeline(id){return window.clearInterval(id);}
function ajax(url,data){var req=new XMLHttpRequest();req.open(data?"POST":"GET",url,true);req.responseJSON=null;req.onreadystatechange=function(){if(req.readyState==4){var text=req.responseText;if(/^\{.*\}$|^\[.*\]$/.test(text)){try{req.responseJSON=eval("("+text+")");}catch(e){}}
events.dispatch({target:req,type:req.status==200?"success":"error"});req.onreadystatechange=null;}};req.send(data||null);return req;}
new function(){extend(String.prototype,{trim:function(){return this.replace(/^\s+|\s+$/g,'');},stripTags:function(){return this.replace(/\s+|\&nbsp;/g,' ').replace(/ *<br[^\/>]*\/?> */ig,'\n').replace(/<!--[\s\S]*?-->|<[^>]+>/g,'').trim();},format:function(){var args=arguments;return this.replace(FORMAT,function(match,index){return index<=args.length?args[index-1]:match;});},rescape:function(){return this.replace(re,"\\$1");}})
var re=/([\/()[\]{}|*+-.,^$?\\])/g;var FORMAT=/%([1-9])/g;};window.WIDE_VIEW=(!window.SINGLE_VIEW&&screen.width>1200);if(window.WIDE_VIEW){dom.addClass(dom().documentElement,"screen-1200");}
dom.script=function(src){if(!dom.script.scripts)dom.script.scripts=[];dom.script.scripts.push({node:dom(dom(),"script").pop(),src:src});};events.add(window,'load',function(){if(dom.script.scripts){var script,write=function(){if(script=dom.script.scripts.shift()){var node=dom().createElement('script');node.type='text/javascript';if(!window.opera&&node.readyState)node.onreadystatechange=function(){if(this.readyState=="loaded")write();};else node.onload=function(){write();};node.src=script.src;document.body.appendChild(node);if(node.readyState=='complete'){write();}
node=null;}};document.write=function(s){if(script&&script.node){var output=dom.create('<div>'+s),parent=script.node.parentNode,after=script.node.nextSibling;while(output.lastChild)parent.insertBefore(output.lastChild,after);output=null;}};write();}});function insertBanner(obj,id){document.write(obj[window.WIDE_VIEW?0:1]);if(id){events.add(window,"load",function(){if(dom(id).offsetHeight<50)dom(id).style.display="none";});}}
function menuHover(){if(document.getElementById("categories_menu"))
{var parent_element=document.getElementById("categories_menu");MenuCells=new Array();for(var i=0;i<parent_element.rows.length;i++)
for(var j=0;j<parent_element.rows[i].cells.length;j++)
MenuCells[MenuCells.length]=parent_element.rows[i].cells[j];for(var i=0;i<MenuCells.length;i++)
{MenuCells[i].onmouseover=function(){var currentClassName=this.className;this.className=currentClassName+" hovered";if(document.getElementById("bottom"+this.id))
{document.getElementById("bottom"+this.id).style.display="block";var button_right_corner=this.offsetLeft+this.scrollWidth;var button_left_corner=this.offsetLeft;var menu_width=document.getElementById("bottom"+this.id).scrollWidth;var maxi_width=document.getElementById("categories_menu").scrollWidth;if(menu_width<this.scrollWidth){document.getElementById("bottom"+this.id).style.width=this.scrollWidth+"px";menu_width=document.getElementById("bottom"+this.id).scrollWidth;}
if(menu_width<button_right_corner){if(maxi_width<button_left_corner+menu_width)
document.getElementById("bottom"+this.id).style.left=button_right_corner-menu_width+"px";else
document.getElementById("bottom"+this.id).style.left=button_left_corner+"px";}}}
MenuCells[i].onmouseout=function(){var currentClassName=this.className;this.className=currentClassName.replace(/hovered/g,"");if(document.getElementById("bottom"+this.id))
{document.getElementById("bottom"+this.id).style.display="none";}}
if(document.getElementById("bottom"+MenuCells[i].id)){document.getElementById("bottom"+MenuCells[i].id).onmouseout=function(){var menu_button=document.getElementById(this.id.replace(/bottom/g,""));var currentClassName=menu_button.className;menu_button.className=currentClassName.replace(/hovered/g,"");this.style.display="none";}
document.getElementById("bottom"+MenuCells[i].id).onmouseover=function(){var menu_button=document.getElementById(this.id.replace(/bottom/g,""));var currentClassName=menu_button.className;menu_button.className=currentClassName+" hovered";this.style.display="block";}}}}}
function formDefaultValues(field,form,default_value,inactive_color,active_color){if(!field){return;}
field.style.color=inactive_color;if(!default_value){default_value=field.value;}
if(!field.value){field.value=default_value;}
field.onfocus=function(){if(this.value==default_value){this.value='';this.style.color=active_color;}}
field.onblur=function(){if(this.value==''){this.style.color=inactive_color;this.value=default_value;}}
form.onsubmit=function(){if(field.value==default_value){field.value='';}
return true;}}
if(typeof deconcept=="undefined"){var deconcept={};}if(typeof deconcept.util=="undefined"){deconcept.util={};}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil={};}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params={};this.variables={};this.attributes=[];if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10]||"";},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15]||"";},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=[];var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+(this.getAttribute("style")||"")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+(this.getAttribute("style")||"")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return"";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;
