


var req=null;function InitXMLHttpRequest(){if(window.XMLHttpRequest){req=new XMLHttpRequest();}else if(window.ActiveXObject){req=new ActiveXObject("Microsoft.XMLHTTP");}}
function SelectCountry(section,destination){InitXMLHttpRequest();if(req){req.onreadystatechange=function(){if(req.readyState==4){destination.innerHTML=req.responseText;}else{destination.innerHTML="Loading data...";}}
req.open("GET","location.php?sec="+section+"&sel=country",true);req.send(null);}else{destination.innerHTML='Browser unable to create XMLHttp Object';}}
function SelectRegion(section,id_country,destination,destination2,text,text2){InitXMLHttpRequest();if(id_country!=''){if(req){req.onreadystatechange=function(){if(req.readyState==4){destination.innerHTML=req.responseText;}else{destination.innerHTML="<select class=\"location\"><option>"+text+"</option></select>";}}
req.open("GET","location.php?sec="+section+"&sel=region&id_country="+id_country,true);req.send(null);}else{destination.innerHTML='Browser unable to create XMLHttp Object';}}else{req.open('GET','location.php?sec='+section+'&sel=region',false);req.send(null);destination.innerHTML=req.responseText;}
destination2.innerHTML="<select id=\"city\" class=\"location\"><option>"+text2+"</option></select>";}
function SelectRegion2(section,id_country,destination,destination2,text,text2,destination3){InitXMLHttpRequest();if(id_country!=''){if(req){req.onreadystatechange=function(){if(req.readyState==4){destination.innerHTML=req.responseText;}else{destination.innerHTML="<select class=\"location\"><option>"+text+"</option></select>";}}
req.open("GET","location.php?sec="+section+"&sel=region2&id_country="+id_country,true);req.send(null);}else{destination.innerHTML='Browser unable to create XMLHttp Object';}}else{req.open('GET','location.php?sec='+section+'&sel=region',false);req.send(null);destination.innerHTML=req.responseText;}
destination2.innerHTML="<select id='city' class=\"location\"><option>"+text2+"</option></select>";if((section=='rnte')||(section=='rmte')){destination3.innerHTML="";}}
function SelectCity(section,id_region,destination,text){InitXMLHttpRequest();if(id_region!=''){if(req){req.onreadystatechange=function(){if(req.readyState==4){destination.innerHTML=req.responseText;}else{destination.innerHTML="<select class=\"location\"><option>"+text+"</option></select>";}}
req.open('GET','location.php?sec='+section+'&sel=city&id_region='+id_region,true);req.send(null);}
else{destination.innerHTML='Browser unable to create XMLHttp Object';}}
else{req.open('GET','location.php?sec='+section+'&sel=city',false);req.send(null);destination.innerHTML=req.responseText;}}
function SelectCity2(section,id_region,destination,text,destination2){InitXMLHttpRequest();if(id_region!=''){if(req){req.onreadystatechange=function(){if(req.readyState==4){destination.innerHTML=req.responseText;}else{destination.innerHTML="<select class=\"location\"><option>"+text+"</option></select>";}}
req.open('GET','location.php?sec='+section+'&sel=city2&id_region='+id_region,true);req.send(null);}
else{destination.innerHTML='Browser unable to create XMLHttp Object';}}
else{req.open('GET','location.php?sec='+section+'&sel=city2',false);req.send(null);destination.innerHTML=req.responseText;}
if((section=='rnte')||(section=='rmte')){destination2.innerHTML="";}}
function ShowSubways(section,city_id,destination,text,text2){if((section=='rnte')||(section=='rmte')){if((city_id=='3159_4312_4400')||(city_id=='3159_4925_4962')){InitXMLHttpRequest();if(req){req.onreadystatechange=function(){if(req.readyState==4){destination.innerHTML=req.responseText;}else{destination.innerHTML="<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" height=\"25\"><tr><td height=\"27\" width=\"100\">"+text2+":&nbsp;</td><td><select class=\"location\"><option>"+text+"</option></select></td></tr></table>";}}
req.open('GET','location.php?sec='+section+'&sel=subway&id_city='+city_id,true);req.send(null);}
else{destination.innerHTML='Browser unable to create XMLHttp Object';}}else{destination.innerHTML='';}}else{destination.innerHTML='';}}
function RunJS(dest,response){if(response.search(/<script/)==-1){dest.innerHTML=response;return false;}
var agent=(window.navigator.appName=='Netscape')?'Firefox':'IE';if(agent=='IE'){dest.innerHTML=response;var arr_scripts=dest.getElementsByTagName("script");for(i in arr_scripts){var src=arr_scripts[i].src;if(null!=src){var has_question=(src.indexOf('?',1)>0?true:false);if(0==src.length)
arr_scripts[i].setAttribute('src','');else
arr_scripts[i].setAttribute('src',arr_scripts[i].src+(has_question==true?'&':'?')+'1=1');}}}else{var d=dest.parentNode;var d_new=document.createElement('div');var attributes=dest.attributes;var len=attributes.length;d_new.innerHTML=response;for(var i=0;i<len;i++){d_new.setAttribute(attributes[i].name,attributes[i].value);}
d.replaceChild(d_new,dest);}}


var req=null;function InitXMLHttpRequest(){if(window.XMLHttpRequest){req=new XMLHttpRequest();}else if(window.ActiveXObject){req=new ActiveXObject("Microsoft.XMLHTTP");}}
function AddToComparisonList(id_ad,destination_id){InitXMLHttpRequest();var destination=document.getElementById(destination_id);if(req){req.onreadystatechange=function(){if(req.readyState==4){destination.innerHTML=req.responseText;document.getElementById("comparison_str").style.display="inline";RefreshComparisonStr("comparison_str");}else{destination.innerHTML="Loading data...";}}
req.open("GET",site_root+"/comparison_list.php?id_ad="+id_ad);req.send(null);}else{destination.innerHTML='Browser unable to create XMLHttp Object';}}
function RefreshComparisonList(destination_id){InitXMLHttpRequest();var destination=document.getElementById(destination_id);if(req){req.onreadystatechange=function(){if(req.readyState==4){if(req.responseText=="empty"){document.getElementById("comparison_str").style.display="none";destination.innerHTML="";}else{destination.innerHTML=req.responseText;}}else{destination.innerHTML="Loading data...";}}
req.open("GET",site_root+"/comparison_list.php?action=get_list");req.send(null);}else{destination.innerHTML='Browser unable to create XMLHttp Object';}}
function RefreshComparisonStr(destination_id){InitXMLHttpRequest();var destination=document.getElementById(destination_id);if(req){req.onreadystatechange=function(){if(req.readyState==4){if(req.responseText=="empty"){destination.style.display="none";destination.innerHTML="";}else{destination.style.display="inline";destination.innerHTML=req.responseText;}}else{destination.innerHTML="Loading data...";}}
req.open("GET",site_root+"/comparison_list.php?action=get_str");req.send(null);}else{destination.innerHTML='Browser unable to create XMLHttp Object';}}
function ClearComparisonList(destination_id){InitXMLHttpRequest();var destination=document.getElementById(destination_id);if(req){req.onreadystatechange=function(){if(req.readyState==4){eval(req.responseText);destination.innerHTML="";document.getElementById("comparison_str").style.display="none";}else{destination.innerHTML="Loading data...";}}
req.open("GET",site_root+"/comparison_list.php?action=clear_list");req.send(null);}else{destination.innerHTML='Browser unable to create XMLHttp Object';}}
function DeleteFromComparisonList(destination_id,id_ad){InitXMLHttpRequest();var destination=document.getElementById(destination_id);if(req){req.onreadystatechange=function(){if(req.readyState==4){eval(req.responseText);destination.innerHTML="";RefreshComparisonList("comparison_list");}else{destination.innerHTML="Loading data...";}}
req.open("GET",site_root+"/comparison_list.php?action=delete_ad&id_ad="+id_ad);req.send(null);}else{destination.innerHTML='Browser unable to create XMLHttp Object';}}


var hexcase=0;var b64pad="";var chrsz=8;function hex_md5(s){return binl2hex(core_md5(str2binl(s),s.length*chrsz));}
function b64_md5(s){return binl2b64(core_md5(str2binl(s),s.length*chrsz));}
function str_md5(s){return binl2str(core_md5(str2binl(s),s.length*chrsz));}
function hex_hmac_md5(key,data){return binl2hex(core_hmac_md5(key,data));}
function b64_hmac_md5(key,data){return binl2b64(core_hmac_md5(key,data));}
function str_hmac_md5(key,data){return binl2str(core_hmac_md5(key,data));}
function md5_vm_test()
{return hex_md5("abc")=="900150983cd24fb0d6963f7d28e17f72";}
function core_md5(x,len)
{x[len>>5]|=0x80<<((len)%32);x[(((len+64)>>>9)<<4)+14]=len;var a=1732584193;var b=-271733879;var c=-1732584194;var d=271733878;for(var i=0;i<x.length;i+=16)
{var olda=a;var oldb=b;var oldc=c;var oldd=d;a=md5_ff(a,b,c,d,x[i+0],7,-680876936);d=md5_ff(d,a,b,c,x[i+1],12,-389564586);c=md5_ff(c,d,a,b,x[i+2],17,606105819);b=md5_ff(b,c,d,a,x[i+3],22,-1044525330);a=md5_ff(a,b,c,d,x[i+4],7,-176418897);d=md5_ff(d,a,b,c,x[i+5],12,1200080426);c=md5_ff(c,d,a,b,x[i+6],17,-1473231341);b=md5_ff(b,c,d,a,x[i+7],22,-45705983);a=md5_ff(a,b,c,d,x[i+8],7,1770035416);d=md5_ff(d,a,b,c,x[i+9],12,-1958414417);c=md5_ff(c,d,a,b,x[i+10],17,-42063);b=md5_ff(b,c,d,a,x[i+11],22,-1990404162);a=md5_ff(a,b,c,d,x[i+12],7,1804603682);d=md5_ff(d,a,b,c,x[i+13],12,-40341101);c=md5_ff(c,d,a,b,x[i+14],17,-1502002290);b=md5_ff(b,c,d,a,x[i+15],22,1236535329);a=md5_gg(a,b,c,d,x[i+1],5,-165796510);d=md5_gg(d,a,b,c,x[i+6],9,-1069501632);c=md5_gg(c,d,a,b,x[i+11],14,643717713);b=md5_gg(b,c,d,a,x[i+0],20,-373897302);a=md5_gg(a,b,c,d,x[i+5],5,-701558691);d=md5_gg(d,a,b,c,x[i+10],9,38016083);c=md5_gg(c,d,a,b,x[i+15],14,-660478335);b=md5_gg(b,c,d,a,x[i+4],20,-405537848);a=md5_gg(a,b,c,d,x[i+9],5,568446438);d=md5_gg(d,a,b,c,x[i+14],9,-1019803690);c=md5_gg(c,d,a,b,x[i+3],14,-187363961);b=md5_gg(b,c,d,a,x[i+8],20,1163531501);a=md5_gg(a,b,c,d,x[i+13],5,-1444681467);d=md5_gg(d,a,b,c,x[i+2],9,-51403784);c=md5_gg(c,d,a,b,x[i+7],14,1735328473);b=md5_gg(b,c,d,a,x[i+12],20,-1926607734);a=md5_hh(a,b,c,d,x[i+5],4,-378558);d=md5_hh(d,a,b,c,x[i+8],11,-2022574463);c=md5_hh(c,d,a,b,x[i+11],16,1839030562);b=md5_hh(b,c,d,a,x[i+14],23,-35309556);a=md5_hh(a,b,c,d,x[i+1],4,-1530992060);d=md5_hh(d,a,b,c,x[i+4],11,1272893353);c=md5_hh(c,d,a,b,x[i+7],16,-155497632);b=md5_hh(b,c,d,a,x[i+10],23,-1094730640);a=md5_hh(a,b,c,d,x[i+13],4,681279174);d=md5_hh(d,a,b,c,x[i+0],11,-358537222);c=md5_hh(c,d,a,b,x[i+3],16,-722521979);b=md5_hh(b,c,d,a,x[i+6],23,76029189);a=md5_hh(a,b,c,d,x[i+9],4,-640364487);d=md5_hh(d,a,b,c,x[i+12],11,-421815835);c=md5_hh(c,d,a,b,x[i+15],16,530742520);b=md5_hh(b,c,d,a,x[i+2],23,-995338651);a=md5_ii(a,b,c,d,x[i+0],6,-198630844);d=md5_ii(d,a,b,c,x[i+7],10,1126891415);c=md5_ii(c,d,a,b,x[i+14],15,-1416354905);b=md5_ii(b,c,d,a,x[i+5],21,-57434055);a=md5_ii(a,b,c,d,x[i+12],6,1700485571);d=md5_ii(d,a,b,c,x[i+3],10,-1894986606);c=md5_ii(c,d,a,b,x[i+10],15,-1051523);b=md5_ii(b,c,d,a,x[i+1],21,-2054922799);a=md5_ii(a,b,c,d,x[i+8],6,1873313359);d=md5_ii(d,a,b,c,x[i+15],10,-30611744);c=md5_ii(c,d,a,b,x[i+6],15,-1560198380);b=md5_ii(b,c,d,a,x[i+13],21,1309151649);a=md5_ii(a,b,c,d,x[i+4],6,-145523070);d=md5_ii(d,a,b,c,x[i+11],10,-1120210379);c=md5_ii(c,d,a,b,x[i+2],15,718787259);b=md5_ii(b,c,d,a,x[i+9],21,-343485551);a=safe_add(a,olda);b=safe_add(b,oldb);c=safe_add(c,oldc);d=safe_add(d,oldd);}
return Array(a,b,c,d);}
function md5_cmn(q,a,b,x,s,t)
{return safe_add(bit_rol(safe_add(safe_add(a,q),safe_add(x,t)),s),b);}
function md5_ff(a,b,c,d,x,s,t)
{return md5_cmn((b&c)|((~b)&d),a,b,x,s,t);}
function md5_gg(a,b,c,d,x,s,t)
{return md5_cmn((b&d)|(c&(~d)),a,b,x,s,t);}
function md5_hh(a,b,c,d,x,s,t)
{return md5_cmn(b^c^d,a,b,x,s,t);}
function md5_ii(a,b,c,d,x,s,t)
{return md5_cmn(c^(b|(~d)),a,b,x,s,t);}
function core_hmac_md5(key,data)
{var bkey=str2binl(key);if(bkey.length>16)bkey=core_md5(bkey,key.length*chrsz);var ipad=Array(16),opad=Array(16);for(var i=0;i<16;i++)
{ipad[i]=bkey[i]^0x36363636;opad[i]=bkey[i]^0x5C5C5C5C;}
var hash=core_md5(ipad.concat(str2binl(data)),512+data.length*chrsz);return core_md5(opad.concat(hash),512+128);}
function safe_add(x,y)
{var lsw=(x&0xFFFF)+(y&0xFFFF);var msw=(x>>16)+(y>>16)+(lsw>>16);return(msw<<16)|(lsw&0xFFFF);}
function bit_rol(num,cnt)
{return(num<<cnt)|(num>>>(32-cnt));}
function str2binl(str)
{var bin=Array();var mask=(1<<chrsz)-1;for(var i=0;i<str.length*chrsz;i+=chrsz)
bin[i>>5]|=(str.charCodeAt(i/chrsz)&mask)<<(i%32);return bin;}
function binl2str(bin)
{var str="";var mask=(1<<chrsz)-1;for(var i=0;i<bin.length*32;i+=chrsz)
str+=String.fromCharCode((bin[i>>5]>>>(i%32))&mask);return str;}
function binl2hex(binarray)
{var hex_tab=hexcase?"0123456789ABCDEF":"0123456789abcdef";var str="";for(var i=0;i<binarray.length*4;i++)
{str+=hex_tab.charAt((binarray[i>>2]>>((i%4)*8+4))&0xF)+
hex_tab.charAt((binarray[i>>2]>>((i%4)*8))&0xF);}
return str;}
function binl2b64(binarray)
{var tab="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var str="";for(var i=0;i<binarray.length*4;i+=3)
{var triplet=(((binarray[i>>2]>>8*(i%4))&0xFF)<<16)|(((binarray[i+1>>2]>>8*((i+1)%4))&0xFF)<<8)|((binarray[i+2>>2]>>8*((i+2)%4))&0xFF);for(var j=0;j<4;j++)
{if(i*8+j*6>binarray.length*32)str+=b64pad;else str+=tab.charAt((triplet>>6*(3-j))&0x3F);}}
return str;}


var AJS={BASE_URL:"",getElement:function(id){if(typeof(id)=="string")
return document.getElementById(id);else
return id;},getElements:function(){var elements=new Array();for(var i=0;i<arguments.length;i++){var element=this.getElement(arguments[i]);elements.push(element);}
return elements;},getQueryArgument:function(var_name){var query=window.location.search.substring(1);var vars=query.split("&");for(var i=0;i<vars.length;i++){var pair=vars[i].split("=");if(pair[0]==var_name){return pair[1];}}
return null;},isIe:function(){return(navigator.userAgent.toLowerCase().indexOf("msie")!=-1&&navigator.userAgent.toLowerCase().indexOf("opera")==-1);},isNetscape7:function(){return(navigator.userAgent.toLowerCase().indexOf("netscape")!=-1&&navigator.userAgent.toLowerCase().indexOf("7.")!=-1);},isSafari:function(){return(navigator.userAgent.toLowerCase().indexOf("khtml")!=-1);},isOpera:function(){return(navigator.userAgent.toLowerCase().indexOf("opera")!=-1);},isMozilla:function(){return(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1&&navigator.productSub>=20030210);},getBody:function(){return this.getElementsByTagAndClassName('body')[0]},getElementsByTagAndClassName:function(tag_name,class_name,parent){var class_elements=[];if(!this.isDefined(parent))
parent=document;if(!this.isDefined(tag_name))
tag_name='*';var els=parent.getElementsByTagName(tag_name);var els_len=els.length;var pattern=new RegExp("(^|\\s)"+class_name+"(\\s|$)");for(i=0,j=0;i<els_len;i++){if(pattern.test(els[i].className)||class_name==null){class_elements[j]=els[i];j++;}}
return class_elements;},nodeName:function(elm){return elm.nodeName.toLowerCase();},isElementHidden:function(elm){return elm.style.visibility=="hidden";},getLast:function(list){if(list.length>0)
return list[list.length-1];else
return null;},getFirst:function(list){if(list.length>0)
return list[0];else
return null;},createArray:function(v){if(this.isArray(v))
return v;else if(!v)
return[];else
return[v];},map:function(list,fn,start_index,end_index){var i=0,l=list.length;if(start_index)
i=start_index;if(end_index)
l=end_index;for(i;i<l;i++)
fn.apply(this,[list[i]]);},isIn:function(str,list){var ein=false;var fn=function(elm){if(str==elm)
ein=true;};this.map(list,fn);return ein;},appendChildNodes:function(node){if(arguments.length>=2){AJS.map(arguments,function(n){if(this.isString(n))
n=this.TN(n);if(this.isDefined(n))
node.appendChild(n);},1);}
return node;},replaceChildNodes:function(node){var child;while((child=node.firstChild))
node.removeChild(child);if(arguments.length<2)
return node;else
return this.appendChildNodes.apply(this,arguments);return node;},insertAfter:function(node,referenceNode){referenceNode.parentNode.insertBefore(node,referenceNode.nextSibling);return node;},insertBefore:function(node,referenceNode){referenceNode.parentNode.insertBefore(node,referenceNode);return node;},showElement:function(){this.map(arguments,function(elm){elm.style.display=''});},hideElement:function(elm){this.map(arguments,function(elm){elm.style.display='none'});},swapDOM:function(dest,src){dest=this.getElement(dest);var parent=dest.parentNode;if(src){src=this.getElement(src);parent.replaceChild(src,dest);}else{parent.removeChild(dest);}
return src;},removeElement:function(){this.map(arguments,function(elm){AJS.swapDOM(elm,null);});},createDOM:function(name,attrs){var i=0,attr;elm=document.createElement(name);if(this.isDict(attrs[i])){for(k in attrs[0]){if(k=="style")
elm.style.cssText=attrs[0][k];else if(k=="class")
elm.className=attrs[0][k];else{attr=attrs[0][k];elm.setAttribute(k,attr);}}
i++;}
if(attrs[0]==null)
i=1;AJS.map(attrs,function(n){if(this.isDefined(n)){if(this.isString(n))
n=this.TN(n);elm.appendChild(n);}},i);return elm;},UL:function(){return this.createDOM.apply(this,["ul",arguments]);},LI:function(){return this.createDOM.apply(this,["li",arguments]);},TD:function(){return this.createDOM.apply(this,["td",arguments]);},TR:function(){return this.createDOM.apply(this,["tr",arguments]);},TH:function(){return this.createDOM.apply(this,["th",arguments]);},TBODY:function(){return this.createDOM.apply(this,["tbody",arguments]);},TABLE:function(){return this.createDOM.apply(this,["table",arguments]);},INPUT:function(){return this.createDOM.apply(this,["input",arguments]);},SPAN:function(){return this.createDOM.apply(this,["span",arguments]);},B:function(){return this.createDOM.apply(this,["b",arguments]);},A:function(){return this.createDOM.apply(this,["a",arguments]);},DIV:function(){return this.createDOM.apply(this,["div",arguments]);},IMG:function(){return this.createDOM.apply(this,["img",arguments]);},BUTTON:function(){return this.createDOM.apply(this,["button",arguments]);},H1:function(){return this.createDOM.apply(this,["h1",arguments]);},H2:function(){return this.createDOM.apply(this,["h2",arguments]);},H3:function(){return this.createDOM.apply(this,["h3",arguments]);},BR:function(){return this.createDOM.apply(this,["br",arguments]);},TEXTAREA:function(){return this.createDOM.apply(this,["textarea",arguments]);},FORM:function(){return this.createDOM.apply(this,["form",arguments]);},P:function(){return this.createDOM.apply(this,["p",arguments]);},SELECT:function(){return this.createDOM.apply(this,["select",arguments]);},OPTION:function(){return this.createDOM.apply(this,["option",arguments]);},TN:function(text){return document.createTextNode(text);},IFRAME:function(){return this.createDOM.apply(this,["iframe",arguments]);},SCRIPT:function(){return this.createDOM.apply(this,["script",arguments]);},CENTER:function(){return this.createDOM.apply(this,["center",arguments]);},getCssDim:function(dim){if(this.isString(dim))
return dim;else
return dim+"px";},setWidth:function(){var w=this.getLast(arguments);this.map(arguments,function(elm){elm.style.width=this.getCssDim(w)},0,arguments.length-1);},setHeight:function(){var h=this.getLast(arguments);this.map(arguments,function(elm){elm.style.height=this.getCssDim(h)},0,arguments.length-1);},setLeft:function(){var l=this.getLast(arguments);this.map(arguments,function(elm){elm.style.left=this.getCssDim(l)},0,arguments.length-1);},setTop:function(){var t=this.getLast(arguments);this.map(arguments,function(elm){elm.style.top=this.getCssDim(t)},0,arguments.length-1);},getXMLHttpRequest:function(){var try_these=[function(){return new XMLHttpRequest();},function(){return new ActiveXObject('Msxml2.XMLHTTP');},function(){return new ActiveXObject('Microsoft.XMLHTTP');},function(){return new ActiveXObject('Msxml2.XMLHTTP.4.0');},function(){throw"Browser does not support XMLHttpRequest";}];for(var i=0;i<try_these.length;i++){var func=try_these[i];try{return func();}catch(e){}}},doSimpleXMLHttpRequest:function(url){var req=this.getXMLHttpRequest();if(url.indexOf("http://")==-1)
url=AJS.BASE_URL+url;req.open("GET",url,true);return this.sendXMLHttpRequest(req);},getRequest:function(url,data){var req=this.getXMLHttpRequest();if(url.indexOf("http://")==-1)
url=AJS.BASE_URL+url;req.open("POST",url,true);req.setRequestHeader("Content-type","text/html; charset=UTF-8");return this.sendXMLHttpRequest(req);},sendXMLHttpRequest:function(req,data){var d=new AJSDeferred(req);var onreadystatechange=function(){if(req.readyState==4){try{status=req.status;}
catch(e){};if(status==200||status==304||req.responseText==null){d.callback(req,data);}
else{d.errback();}}}
req.onreadystatechange=onreadystatechange;return d;},reprString:function(o){return('"'+o.replace(/(["\\])/g,'\\$1')+'"').replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r");},serializeJSON:function(o){var objtype=typeof(o);if(objtype=="undefined"){return"undefined";}else if(objtype=="number"||objtype=="boolean"){return o+"";}else if(o===null){return"null";}
if(objtype=="string"){return AJS.reprString(o);}
var me=arguments.callee;var newObj;if(typeof(o.__json__)=="function"){newObj=o.__json__();if(o!==newObj){return me(newObj);}}
if(typeof(o.json)=="function"){newObj=o.json();if(o!==newObj){return me(newObj);}}
if(objtype!="function"&&typeof(o.length)=="number"){var res=[];for(var i=0;i<o.length;i++){var val=me(o[i]);if(typeof(val)!="string"){val="undefined";}
res.push(val);}
return"["+res.join(",")+"]";}
res=[];for(var k in o){var useKey;if(typeof(k)=="number"){useKey='"'+k+'"';}else if(typeof(k)=="string"){useKey=AJS.reprString(k);}else{continue;}
val=me(o[k]);if(typeof(val)!="string"){continue;}
res.push(useKey+":"+val);}
return"{"+res.join(",")+"}";},loadJSONDoc:function(url){var d=this.getRequest(url);var eval_req=function(req){var text=req.responseText;if(text=="Error")
d.errback(req);else
return eval('('+text+')');};d.addCallback(eval_req);return d;},evalScriptTags:function(html){var script_data=html.match(/<script.*?>((\n|\r|.)*?)<\/script>/g);if(script_data!=null){for(var i=0;i<script_data.length;i++){var script_only=script_data[i].replace(/<script.*?>/g,"");script_only=script_only.replace(/<\/script>/g,"");eval(script_only);}}},getMousePos:function(e){var posx=0;var posy=0;if(!e)var e=window.event;if(e.pageX||e.pageY)
{posx=e.pageX;posy=e.pageY;}
else if(e.clientX||e.clientY)
{posx=e.clientX+document.body.scrollLeft;posy=e.clientY+document.body.scrollTop;}
return[posx,posy];},findPosX:function(obj){var curleft=0;if(obj.offsetParent){while(obj.offsetParent){curleft+=obj.offsetLeft
obj=obj.offsetParent;}}
else if(obj.x)
curleft+=obj.x;return curleft;},findPosY:function(obj){var curtop=0;if(obj.offsetParent){while(obj.offsetParent){curtop+=obj.offsetTop
obj=obj.offsetParent;}}
else if(obj.y)
curtop+=obj.y;return curtop;},getScrollTop:function(){var t;if(document.documentElement&&document.documentElement.scrollTop)
t=document.documentElement.scrollTop;else if(document.body)
t=document.body.scrollTop;return t;},absolutePosition:function(elm){var posObj={'x':elm.offsetLeft,'y':elm.offsetTop};if(elm.offsetParent){var temp_pos=this.absolutePosition(elm.offsetParent);posObj.x+=temp_pos.x;posObj.y+=temp_pos.y;}
return posObj;},getEventElm:function(e){if(e&&!e.type&&!e.keyCode)
return e
var targ;if(!e)var e=window.event;if(e.target)targ=e.target;else if(e.srcElement)targ=e.srcElement;if(targ.nodeType==3)
targ=targ.parentNode;return targ;},getRealScope:function(fn,extra_args,dont_send_event){var scope=window;extra_args=this.$A(extra_args);if(fn._cscope)
scope=fn._cscope;return function(){var args=[];var i=0;if(dont_send_event)
i=1;AJS.map(arguments,function(arg){args.push(arg)},i);args=args.concat(extra_args);return fn.apply(scope,args);};},unloadListeners:function(){if(AJS.listeners)
AJS.map(AJS.listeners,function(elm,type,fn){AJS.removeEventListener(elm,type,fn)});AJS.listeners=[];},removeEventListener:function(elm,type,fn){if(elm.removeEventListener)
elm.removeEventListener(type,fn,false);else if(elm.detachEvent)
elm.detachEvent("on"+type,fn);},addEventListener:function(elm,type,fn,listen_once){var elms=this.$A(elm);this.map(elms,function(elmz){if(listen_once)
fn=this.listenOnce(elmz,type,fn);if(AJS.isIn(type,['submit','load','scroll','resize'])){var old=elm['on'+type];elm['on'+type]=function(){if(old){fn(arguments);return old(arguments);}
else
return fn(arguments);};return;}
if(elmz.attachEvent)
elmz.attachEvent("on"+type,fn);else if(elmz.addEventListener)
elmz.addEventListener(type,fn,false);this.listeners=AJS.$A(this.listeners);this.listeners.push([elmz,type,fn]);});},bind:function(fn,bind_to,extra_args,dont_send_event){fn._cscope=bind_to;return AJS.GRS(fn,extra_args,dont_send_event);},listenOnce:function(elm,type,fn){var r_fn=function(){AJS.removeEventListener(elm,type,r_fn);fn(arguments);}
return r_fn;},callLater:function(fn,interval){var fn_no_send=function(){fn();};window.setTimeout(fn_no_send,interval);},keys:function(obj){var rval=[];for(var prop in obj){rval.push(prop);}
return rval;},urlencode:function(str){return encodeURIComponent(str.toString());},isDefined:function(o){return(o!="undefined"&&o!=null)},isArray:function(obj){try{if(this.isDefined(obj[0]))
return true;else
return false;}
catch(e){return false;}},isString:function(obj){return(typeof obj=='string');},isObject:function(obj){return(typeof obj=='object');},isDict:function(o){var str_repr=String(o);return str_repr.indexOf(" Object")!=-1;},exportToGlobalScope:function(){for(e in AJS)
eval(e+" = this."+e);}}
AJS.$=AJS.getElement;AJS.$$=AJS.getElement;AJS.$b=AJS.bind;AJS.$A=AJS.createArray;AJS.ACN=AJS.appendChildNodes;AJS.RCN=AJS.replaceChildNodes;AJS.AEV=AJS.addEventListener;AJS.REV=AJS.removeEventListener;AJS.GRS=AJS.getRealScope;AJS.$bytc=AJS.getElementsByTagAndClassName;AJSDeferred=function(req){this.callbacks=[];this.req=req;this.callback=function(res){while(this.callbacks.length>0){var fn=this.callbacks.pop();res=fn(res);}};this.errback=function(e){alert("Error encountered:\n"+e);};this.addErrback=function(fn){this.errback=fn;};this.addCallback=function(fn){this.callbacks.unshift(fn);};this.addCallbacks=function(fn1,fn2){this.addCallback(fn1);this.addErrback(fn2);};this.sendReq=function(data){if(AJS.isObject(data)){var post_data=[];for(k in data){post_data.push(k+"="+AJS.urlencode(data[k]));}
post_data=post_data.join("&");this.req.send(post_data);}
else if(AJS.isDefined(data))
this.req.send(data);else{this.req.send("");}};};AJSDeferred.prototype=new AJSDeferred();AJS.addEventListener(window,'unload',AJS.unloadListeners);


var GB_CURRENT=null;var GB_ONLY_ONE=null;function GreyBox(){this.type="page";this.overlay_click_close=true;this.img_dir="greybox/";this.overlay_color="dark";this.center_window=false;this.g_window=null;this.g_container=null;this.iframe=null;this.overlay=null;this.timeout=null;this.defaultSize();this.url="";this.caption="";}
GreyBox.prototype.setDimension=function(width,height){this.height=height;this.width=width;}
GreyBox.prototype.setFullScreen=function(bool){this.full_screen=bool;}
GreyBox.prototype.setType=function(type){this.type=type;}
GreyBox.prototype.setCenterWindow=function(bool){this.center_window=bool;}
GreyBox.prototype.setImageDir=function(dir){this.img_dir=dir;}
GreyBox.prototype.setOverlayCloseClick=function(bool){this.overlay_click_close=bool;}
GreyBox.prototype.setOverlayColor=function(color){this.overlay_color=color;}
GreyBox.prototype.setCallback=function(fn){this.callback_fn=fn;}
GreyBox.prototype.show=function(caption,url){GB_CURRENT=this;this.url=url;this.caption=caption;AJS.map(AJS.$bytc("div","GB_dummy"),function(elm){AJS.removeElement(elm)});AJS.map(AJS.$bytc("div","GB_loader"),function(elm){AJS.removeElement(elm)});if(AJS.isIe())
AJS.map(AJS.$bytc("select"),function(elm){elm.style.visibility="hidden"});AJS.map(AJS.$bytc("object"),function(elm){elm.style.visibility="hidden"});this.initOverlayIfNeeded();this.setOverlayDimension();AJS.showElement(this.overlay);this.setFullScreenOption();this.initIfNeeded();AJS.hideElement(this.g_window);if(this.type=="page")
AJS.ACN(this.g_container,this.iframe);else{this.dummy_holder=AJS.DIV({'class':'GB_dummy','style':'width: 200px; height: 200px; background-color: #fff;'});AJS.ACN(this.g_container,this.dummy_holder);}
if(caption=="")
caption="&nbsp;";this.div_caption.innerHTML=caption;AJS.showElement(this.g_window)
this.setVerticalPosition();this.setTopNLeft();this.setWidthNHeight();this.showLoader();id=setTimeout("GB_CURRENT.startLoading()",0);return false;}
GreyBox.prototype.hide=function(){AJS.hideElement(this.g_window,this.overlay);try{AJS.removeElement(this.iframe);}
catch(e){}
this.iframe=null;if(this.type=="image"){this.width=200;this.height=200;}
if(AJS.isIe())
AJS.map(AJS.$bytc("select"),function(elm){elm.style.visibility="visible"});AJS.map(AJS.$bytc("object"),function(elm){elm.style.visibility="visible"});if(GB_CURRENT.callback_fn)
GB_CURRENT.callback_fn();GB_CURRENT=null;}
GB_initOneIfNeeded=function(){if(!GB_ONLY_ONE){GB_ONLY_ONE=new GreyBox();GB_ONLY_ONE.setImageDir(GB_IMG_DIR);}}
GB_show=function(caption,url,height,width,callback_fn){GB_ONLY_ONE.defaultSize();GB_ONLY_ONE.setFullScreen(false);GB_ONLY_ONE.setType("page");GB_ONLY_ONE.setCallback(callback_fn);GB_ONLY_ONE.setImageDir(GB_IMG_DIR);GB_ONLY_ONE.setDimension(width,height);GB_ONLY_ONE.show(caption,url);return false;}
GB_showFullScreen=function(caption,url,callback_fn){GB_ONLY_ONE.defaultSize();GB_ONLY_ONE.setType("page");GB_ONLY_ONE.setCallback(callback_fn);GB_ONLY_ONE.setImageDir(GB_IMG_DIR);GB_ONLY_ONE.setFullScreen(true);GB_ONLY_ONE.show(caption,url);return false;}
GB_showImage=function(caption,url){GB_ONLY_ONE.defaultSize();GB_ONLY_ONE.setFullScreen(false);GB_ONLY_ONE.setType("image");GB_ONLY_ONE.setImageDir(GB_IMG_DIR);GB_ONLY_ONE.show(caption,url);return false;}
GB_hide=function(){GB_CURRENT.hide();}
GreyBox.preloadGreyBoxImages=function(){var pics=[];var fn=function(path){var pic=new Image();pic.src=GB_IMG_DIR+path;pics.push(pic);};AJS.map(['indicator.gif','blank.gif','close.gif','header_bg.gif','overlay_light.png','overlay_dark.png'],AJS.$b(fn,this));}
GreyBox.prototype.getOverlayImage=function(){return"overlay_"+this.overlay_color+".png";};GreyBox.prototype.initOverlayIfNeeded=function(){this.overlay=AJS.DIV({'id':'GB_overlay'});if(AJS.isIe()){this.overlay.style.backgroundColor="#000000";this.overlay.style.backgroundColor="transparent";this.overlay.style.backgroundImage="url("+this.img_dir+"blank.gif)";this.overlay.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.img_dir+this.getOverlayImage()+"',sizingMethod='scale')";}
else
this.overlay.style.backgroundImage="url("+this.img_dir+this.getOverlayImage()+")";if(this.overlay_click_close)
AJS.AEV(this.overlay,"click",GB_hide);AJS.getBody().insertBefore(this.overlay,AJS.getBody().firstChild);};GreyBox.prototype.initIfNeeded=function(){this.init();this.setWidthNHeight=AJS.$b(this.setWidthNHeight,this);this.setTopNLeft=AJS.$b(this.setTopNLeft,this);this.setFullScreenOption=AJS.$b(this.setFullScreenOption,this);this.setOverlayDimension=AJS.$b(this.setOverlayDimension,this);GreyBox.addOnWinResize(this.setWidthNHeight,this.setTopNLeft,this.setFullScreenOption,this.setOverlayDimension);if(this.type=="page")
this.g_container.style.marginBottom="-3px";var fn=function(){this.setOverlayDimension();this.setVerticalPosition();this.setTopNLeft();this.setWidthNHeight();};AJS.AEV(window,"scroll",AJS.$b(fn,this));if(!this.iframe){var new_frame;var d={'name':'GB_frame','class':'GB_frame','frameBorder':0};if(this.type=="page"){new_frame=AJS.IFRAME(d);AJS.hideElement(new_frame);}
else
new_frame=new Image();this.iframe=new_frame;}}
GreyBox.prototype.init=function(){this.g_window=AJS.DIV({'id':'GB_window'});var table=AJS.TABLE({'class':'GB_t_frame','frameborder':0});var tbody=AJS.TBODY();AJS.ACN(table,tbody);var td_middle_m=AJS.TD({'class':'GB_content'});this.td_middle_m=td_middle_m;AJS.ACN(tbody,AJS.TR(td_middle_m));var header=AJS.DIV({'class':'GB_header'});this.header=header;var caption=AJS.DIV({'class':'GB_caption'});this.div_caption=caption;var img_close=AJS.IMG({'src':this.img_dir+'close.gif'});var close=AJS.DIV({'class':'GB_close'},img_close,"");AJS.AEV(close,"click",GB_hide);header.style.backgroundImage="url("+this.img_dir+"header_bg.gif)";var dummy=AJS.SPAN();dummy.innerHTML="&nbsp;";AJS.ACN(header,close,caption,dummy);AJS.ACN(td_middle_m,header);this.g_container=AJS.DIV({'class':'GB_container'});AJS.ACN(td_middle_m,this.g_container);AJS.ACN(this.g_window,table);AJS.getBody().insertBefore(this.g_window,this.overlay.nextSibling);}
GreyBox.prototype.startLoading=function(){this.iframe.src=this.url;if(AJS.isIe()){var check_state=function(){if(this.iframe.readyState=="complete")
GreyBox.loaded();else
AJS.callLater(AJS.$b(check_state,this),30);};AJS.callLater(AJS.$b(check_state,this),30);}
else if(AJS.isSafari()||AJS.isOpera()&&this.type=="image"){AJS.callLater(GreyBox.loaded,250);}
else{this.iframe.onload=GreyBox.loaded;}}
GreyBox.loaded=function(){var me=GB_CURRENT;if(me){AJS.removeElement(me.loader);if(me.type=="page"){AJS.showElement(me.iframe);me.setIframeWidthNHeight();}
if(me.type=="image"){var r_img=AJS.IMG({'src':me.url});var insert=function(){AJS.ACN(GB_CURRENT.g_container,r_img);GB_CURRENT.iframe=r_img;};var count=0;var fn=function(){if(count>10)
return;this.width=this.iframe.width;this.height=this.iframe.height;if(this.width==0||this.height==0){count++;AJS.callLater(AJS.$b(fn,me),100);return;}
if(AJS.isSafari())
this.overlay.style.backgroundColor="transparent";this.setTopNLeft();this.setWidthNHeight();AJS.removeElement(this.dummy_holder);AJS.callLater(AJS.$b(insert,me),50);count++;};AJS.callLater(AJS.$b(fn,me),100);}}}
GreyBox.prototype.showLoader=function(){this.loader=AJS.DIV({'class':'GB_loader'});AJS.setWidth(this.loader,this.width);AJS.setHeight(this.loader,this.height-3);var indicator=AJS.IMG({'src':this.img_dir+'indicator.gif'});AJS.ACN(this.loader,AJS.BR(),indicator,AJS.BR(),AJS.BR(),AJS.SPAN("LOADING..."));if(this.type!="page"){AJS.RCN(this.dummy_holder,this.loader);AJS.setTop(this.loader,AJS.absolutePosition(this.dummy_holder).y);}
else{AJS.ACN(this.g_container,this.loader);AJS.setTop(this.loader,AJS.absolutePosition(this.iframe).y);AJS.showElement(this.loader);}}
GreyBox.prototype.setIframeWidthNHeight=function(){try{AJS.setWidth(this.iframe,this.width);AJS.setHeight(this.iframe,this.height-3);}
catch(e){}}
GreyBox.prototype.setOverlayDimension=function(){var array_page_size=GreyBox.getWindowSize();if((navigator.userAgent.toLowerCase().indexOf("firefox")!=-1))
AJS.setWidth(this.overlay,"100%");else
AJS.setWidth(this.overlay,array_page_size[0]);var max_height=Math.max(AJS.getScrollTop()+array_page_size[1],AJS.getScrollTop()+this.height);if(max_height<AJS.getScrollTop())
AJS.setHeight(this.overlay,max_height);else
AJS.setHeight(this.overlay,AJS.getScrollTop()+array_page_size[1]);}
GreyBox.prototype.setWidthNHeight=function(){AJS.setWidth(this.g_window,this.width);AJS.setHeight(this.g_window,this.height);AJS.setWidth(this.g_container,this.width);AJS.setHeight(this.g_container,this.height);if(this.type=="page")
this.setIframeWidthNHeight();AJS.setWidth(this.td_middle_m,this.width+10);}
GreyBox.prototype.setTopNLeft=function(){var array_page_size=GreyBox.getWindowSize();AJS.setLeft(this.g_window,((array_page_size[0]-this.width)/2)-13);if(this.center_window){var fl=((array_page_size[1]-this.height)/2)-15;AJS.setTop(this.g_window,fl);}
else{if(this.g_window.offsetHeight<array_page_size[1])
AJS.setTop(this.g_window,AJS.getScrollTop());}}
GreyBox.prototype.setVerticalPosition=function(){var array_page_size=GreyBox.getWindowSize();var st=AJS.getScrollTop();if(this.g_window.offsetWidth<=array_page_size[1]||st<=this.g_window.offsetTop){AJS.setTop(this.g_window,st);}}
GreyBox.prototype.setFullScreenOption=function(){if(this.full_screen){var array_page_size=GreyBox.getWindowSize();overlay_h=array_page_size[1];this.width=Math.round(this.overlay.offsetWidth-(this.overlay.offsetWidth/100)*10);this.height=Math.round(overlay_h-(overlay_h/100)*10);}}
GreyBox.prototype.defaultSize=function(){this.width=300;this.height=300;}
GreyBox.getWindowSize=function(){var window_width,window_height;if(self.innerHeight){window_width=self.innerWidth;window_height=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){window_width=document.documentElement.clientWidth;window_height=document.documentElement.clientHeight;}else if(document.body){window_width=document.body.clientWidth;window_height=document.body.clientHeight;}
return[window_width,window_height];}
GreyBox.addOnWinResize=function(funcs){funcs=AJS.$A(funcs);AJS.map(funcs,function(fn){AJS.AEV(window,"resize",fn);});}
GB_ONLY_ONE=new GreyBox();