var ie_version=parseFloat(navigator.appVersion.split('MSIE')[1]);var gk_menu_delim=' <span class=dim>&bull;</span> ';var gk_media='f';function isIE(){return(document.all?true:false);}if((typeof Array.prototype.copy)=='undefined'){Array.prototype.copy=function(){var copy=[];for(var i=0;i<this.length;i++){copy[i]=this[i];}return copy;};}function static_domain(){return 's.ichess.com';}function gk_get_el(name){var d=document;if(d.getElementById)return d.getElementById(name);if(d.all)return d.all[name];return null;}var gk_glop=[];var gk_glop_save_time=0;function load_global_options(my_o){var o=my_o||cc_get('GKO');if(o==''){if(location.protocol.toLowerCase()!='https'){var all_styles=[0,2,4];var all_colors=[12,14,15,16,17,18];gk_glop[9]=all_styles[Math.floor(Math.random()*all_styles.length)];gk_glop[17]=all_colors[Math.floor(Math.random()*all_colors.length)];gk_glop[19]=2;gk_glop[0]=1;save_global_options(1);}}else{if(!my_o&&o.charAt(10)=='0'){cc_forceExpire('GKO');return;}o=String(o);for(var i=0;i<o.length;i++){var v=o.charCodeAt(i);if(v<58)v-=48;else if(v<91)v+=-65+10+26;else if(v<123)v+=-97+10;else v=undefined;if(v<0)v=0;gk_glop[i]=v;}}}function save_global_options(b_cc_only){var o=[];for(var i=0;i<gk_glop.length;i++){if(i>100)break;var v=gk_glop[i];if(v<0)v='0';else if(v<10)v=String(v);else if(v<(10+26))v=String.fromCharCode(97+(v-10));else if(v<(10+26+26))v=String.fromCharCode(65+(v-10-26));else v='~';o[i]=v;}o=o.join('');cc_set('GKO',o,999);if(!b_cc_only&&(cc_get('ESID')!='')){if(gk_glop_save_time<(get_time()+1000)){gk_glop_save_time=get_time();var params=[];params.push('opt=gop');params.push('o='+o);gk_request_remote_data('/settings-post.pl',0,0,params.join('&'));}}}load_global_options();function gk_get_glop(idx,default_value){if((typeof gk_glop[idx])=='undefined')return default_value;return gk_glop[idx];}function gk_mm_init_links(){var ua=navigator.userAgent;if(!(ie_version>=6)&&(ua.indexOf('Gecko')<=0))return;var mm=gk_get_el('mainmenu');if(!mm)return;var elms=mm.getElementsByTagName('a');if(!elms||!elms.length)return;for(var el_i=0;el_i<elms.length;el_i++){var el=elms[el_i];var ih=el.innerHTML;el.innerHTML='<span class="shadow_container">'+ih+'<span>'+ih+'</span></span>';}}var gk_mm_on=0;var gk_mm_auto_hide=gk_get_glop(11,0);var gk_mm_fixed=gk_get_glop(12,ie_version>=7?1:0);var gk_mm_simple=gk_get_glop(13,0);var gk_mm_timer;var gk_mm_target=1;var gk_mm_current=1;var gk_mm_anim_time=0;var gk_mm_anim_delay=0;function gk_init_mainmenu(b_reload){gk_mm_on=1;if(!b_reload){gk_mm_init_links();}var o=gk_get_el('mainmenudiv');if(!o)return;var os=o.style;if(ie_version>3&&ie_version<7)gk_mm_fixed=0;os.position=gk_mm_fixed?'fixed':'absolute';var dbs=document.body.style;if(gk_mm_auto_hide){dbs.marginLeft='40px';os.left='-125px';gk_mm_target=0;}else{dbs.marginLeft='180px';os.left='0px';gk_mm_target=1;}gk_mm_current=gk_mm_target;}function gk_mm_animate(){var cur_time=get_time();var dt=cur_time-gk_mm_anim_time;if(gk_mm_anim_delay>0){if(dt<gk_mm_anim_delay)return;gk_mm_anim_delay=0;dt=10;}gk_mm_anim_time=cur_time;var dpx=(gk_mm_target-gk_mm_current)*(dt/50);if(dpx<0&&dpx>-0.01)dpx=-0.01;else if(dpx>0&&dpx<0.01)dpx=0.01;gk_mm_current+=dpx;if(gk_mm_current<0)gk_mm_current=0;else if(gk_mm_current>1)gk_mm_current=1;var o=gk_get_el('mainmenudiv');if(o){var os=o.style;os.left=Math.floor(125*(gk_mm_current-1))+'px';}if(gk_mm_current==gk_mm_target&&gk_mm_timer){clearInterval(gk_mm_timer);gk_mm_timer=null;}}function gk_mm_mouse_over(){if(!gk_mm_on)return;gk_mm_start_animation(1);}function gk_mm_mouse_out(){if(!gk_mm_on||!gk_mm_auto_hide)return;gk_mm_start_animation(0,500);}function gk_mm_start_animation(target,delay){if(gk_mm_timer){clearInterval(gk_mm_timer);gk_mm_timer=null;}gk_mm_target=target;gk_mm_anim_delay=delay>0?delay:0;if(gk_mm_current==gk_mm_target)return;gk_mm_anim_time=get_time();gk_mm_timer=setInterval("gk_mm_animate()",10);}function gk_set_bits(data,bits,b_on){var mask=~bits;return(data&mask)|(b_on?bits:0);}function submit_mm_options_form(){var o=gk_get_el('mm_fixed');if(o)gk_mm_fixed=o.checked?1:0;if(ie_version>3&&ie_version<7)gk_mm_fixed=0;o=gk_get_el('mm_auto_hide');if(o)gk_mm_auto_hide=o.checked?1:0;var b_old_mm_simple=gk_mm_simple;o=gk_get_el('mm_simple');if(o)gk_mm_simple=o.checked?1:0;gk_glop[11]=gk_mm_auto_hide;gk_glop[12]=gk_mm_fixed;gk_glop[13]=gk_mm_simple;save_global_options();var frame=gk_get_el('mm_options_form');if(!frame)frame=document.body;gui_pop_message('Menu settings updated',frame,1000);gui_pop_form_remove();if(gk_mm_simple!=b_old_mm_simple){window.location.reload(true);return;}document.body.style.display='none';gk_init_mainmenu(1);document.body.style.display='';}function open_mm_options_form(el){load_global_options();var txt='<table border=0 cellspacing=6 cellpadding=0 id="mm_options_form" style="margin: 2px;"><tr><td><INPUT TYPE="checkbox" id="mm_auto_hide" VALUE="1" '+(gk_mm_auto_hide?'checked':'')+'> -</td><td>auto-hide the main menu</td></tr><tr><td valign=top><INPUT TYPE="checkbox" id="mm_fixed" VALUE="1" '+(gk_mm_fixed?'checked':'')+'> -</td><td>do not scroll with the page (fixed position)<br>&nbsp;<span class=sml>(not supported by older web browsers)</span></td></tr><tr><td><INPUT TYPE="checkbox" id="mm_simple" VALUE="1" '+(gk_mm_simple?'checked':'')+'> -</td><td>simple menu (no graphic)</td></tr><tr><td colspan=2 style="text-align: center; padding-top: 6px;"><INPUT TYPE="button" VALUE="Submit" onClick="submit_mm_options_form()"> <INPUT TYPE="button" VALUE="Cancel" onClick="gui_pop_form_remove()"></td></tr></table>';gui_pop_form(txt,el,{'dir':1,'align':0,'header':'Main menu settings:'});}function popw(path,w,h,no_scroll,x,y){if(x<0)x=0;if(y<0)y=0;if(x==undefined||isNaN(x))x=Math.floor((window.screen.width-w)/2);if(y==undefined||isNaN(y))y=Math.floor((window.screen.height-h)/2);if((x+w)>window.screen.availWidth)x=window.screen.availWidth-w;if((y+h)>window.screen.availHeight)y=window.screen.availHeight-h;if(x<0)x=0;if(y<0)y=0;var params='left='+x+',top='+y+',width='+w+',height='+h+',resizable=1,toolbar=0,location=0,directories=0,status=1,scrollbars='+(no_scroll?'0':'1')+',menubar=0';var ww=window.open(path,'_blank',params);if(ww){try{ww.window_initial_position_x=x;ww.window_initial_position_y=y;ww.window_initial_position_w=w;ww.window_initial_position_h=h;}catch(e){}ww.focus();}else{alert('Pop-up windows appear to be blocked on your computer. Unable to proceed...\nPlease allow pop-ups for GameKnot.com if you wish to use this function.');}}function popa(bd,fb,mv){var params=gk_get_pop_window_pos('/analyze-board.pl');var x=(!params||params[0]==undefined)?undefined:to_int(params[0]);var y=(!params||params[1]==undefined)?undefined:to_int(params[1]);var w=!params?0:to_int(params[2]);var h=!params?0:to_int(params[3]);if(w<10)w=760;if(h<10)h=800;popw('/analyze-board.pl?bd='+bd+(fb?'&fb=1':'')+(mv?'&mv='+mv:'')+'&rnd='+Math.random(),w,h,0,x,y);}function cc_get(name){var dc=document.cookie;if(dc.length<=0)return '';var search=name.toUpperCase()+'=';var offset=dc.toUpperCase().indexOf(search);if(offset==-1)return '';offset+=search.length;var end=dc.indexOf(';',offset);if(end==-1)end=dc.length;return dc.substring(offset,end);}function cc_getDomain(){var domain=String(location.hostname);var re_ip=/^\d+\.\d+\.\d+\.\d+$/;if(re_ip.test(domain))return '';domain=domain.replace(/^.*\.([^\.]+\.[^\.]+)$/,'$1');if(!domain)domain='gameknot.com'
return '.'+domain;}function cc_forceExpire(name){var expired=new Date();expired.setTime(expired.getTime()-24*3600*1000);var expired_str=expired.toGMTString();var nn_loops=3;var domain=cc_getDomain();if(!domain)domain='.gameknot.com';while(nn_loops>0){var my_cookie=cc_get(name);if(my_cookie.length<=0)break;document.cookie=name+'='+my_cookie+'; path=/; expires='+expired_str;document.cookie=name+'='+my_cookie+'; domain='+domain+'; expires='+expired_str;document.cookie=name+'='+my_cookie+'; path=/; domain='+domain+'; expires='+expired_str;document.cookie=name+'='+my_cookie+'; expires='+expired_str;nn_loops--;}}function cc_set(name,value,days){cc_forceExpire(name);var expires='';if(days){var date=new Date();date.setTime(date.getTime()+(days*24*3600*1000));var expires=' expires='+date.toGMTString()+';';}var domain=cc_getDomain();if(domain)domain=' domain='+domain+';';document.cookie=name+'='+value+'; path=/;'+domain+expires;}function cc_erase(name){cc_set(name,'none',-1000);}function gk_html_safe(txt){if(!txt)return '';txt=String(txt);txt=txt.replace(/\"/g,'&quot;');txt=txt.replace(/</g,'&lt;');txt=txt.replace(/>/g,'&gt;');return txt;}function get_time(){var time_cur=new Date();return time_cur.getTime();}function to_int(s){var n=parseInt(s);if(!n||isNaN(n))return 0;return n;}if((typeof window.window_initial_position_x)=='number'&&(typeof window.window_initial_position_y)=='number'){var dx=window.window_initial_position_x-window_screen_x();var dy=window.window_initial_position_y-window_screen_y();if(dx>0)dx=0;if(dy>0)dy=0;if(dx<0||dy<0){window.window_position_dx=dx;window.window_position_dy=dy;}}function window_screen_x(){if((typeof window.screenX)!='undefined')return window.screenX;if((typeof window.screenLeft)!='undefined')return window.screenLeft;return undefined;}function window_screen_y(){if((typeof window.screenY)!='undefined')return window.screenY;if((typeof window.screenTop)!='undefined')return window.screenTop;return undefined;}function gk_get_absolute_pos_top(o,top_el){var pos=o.offsetTop;var parent=o.offsetParent;while(parent){pos+=parent.offsetTop;parent=parent.offsetParent;if(parent==top_el)break;}return pos;}function gk_get_absolute_pos_left(o,top_el){var pos=o.offsetLeft;var parent=o.offsetParent;while(parent){pos+=parent.offsetLeft;parent=parent.offsetParent;if(parent==top_el)break;}return pos;}function gk_is_fixed(o){while(o){if(gk_get_style(o,'position')=='fixed')return 1;o=o.offsetParent;}return 0;}function gk_get_http(){var xmlhttp=null;try{xmlhttp=new XMLHttpRequest();}catch(e){xmlhttp=null;}if(xmlhttp)return xmlhttp;try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){xmlhttp=null;}if(xmlhttp)return xmlhttp;try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){xmlhttp=null;}if(xmlhttp)return xmlhttp;}function gk_log_error(msg){var xmlhttp=gk_get_http();if(!xmlhttp)return;var log='url: '+document.location+'\n';log+='referer: '+(document.referrer?document.referrer:'-')+'\n';log+='ERROR: '+msg+'\n';log+='Call stack:\n'+gk_get_call_stack();var url='/log_error.pl?'+escape(log);if(url.length>8000)url=url.substring(0,8000);xmlhttp.open('HEAD',url,true);xmlhttp.onreadystatechange=function(){};xmlhttp.send(null);}function gk_mouse_x(evt){if(evt.pageX)return evt.pageX;if(evt.clientX)return evt.clientX+gk_scroll_x();return 0;}function gk_mouse_y(evt){if(evt.pageY)return evt.pageY;if(evt.clientY)return evt.clientY+gk_scroll_y();return 0;}function gk_scroll_x(){if(document.documentElement.scrollLeft)return document.documentElement.scrollLeft;return document.body.scrollLeft;}function gk_scroll_y(){if(document.documentElement.scrollTop)return document.documentElement.scrollTop;return document.body.scrollTop;}function gk_get_style(el,name){if(el.currentStyle)return el.currentStyle[name];if(window.getComputedStyle)return window.getComputedStyle(el,null)[name];return '';}function gk_doc_height(){if(document.documentElement)return document.documentElement.clientHeight;if(document.body)return document.body.clientHeight;return 500;}function gk_doc_width(){if(document.documentElement)return document.documentElement.clientWidth;if(document.body)return document.body.clientWidth;return 500;}function gk_mark_new_feature(year,month,day,style){var exp=new Date(year,month-1,day);var cur=new Date();if(cur.getTime()>exp.getTime())return;if(!style)var style='';document.write('<img src="/img/new-text.png" class=imgs style="width: 30px; height: 17px; margin: -6px -4px;'+style+'">');}function pb_hide(){gk_popup_bubble_hide();}function pb_show(event,txt,max_width){if(!event)var event=window.event;if(!max_width)max_width=300;var x=gk_mouse_x(event)+15;var y=gk_mouse_y(event)+3;var elm=null;if(event.srcElement)elm=event.srcElement;else if(event.target)elm=event.target;if(elm){if(!elm._old_onmouseout)elm._old_onmouseout=elm.onmouseout;elm.onmouseout=function(evt){var this_elm=elm;gk_popup_bubble_hide();if((typeof this_elm._old_onmouseout)=='function'){this_elm.onmouseout=this_elm._old_onmouseout;this_elm._old_onmouseout=null;this_elm.onmouseout(evt);}}}gk_popup_bubble_display(txt,x,y,max_width);}function gk_popup_bubble_hide(){var o=gk_get_el('temp_popup_bubble');if(o&&o.parentNode)o.parentNode.removeChild(o);}function gk_popup_bubble_display(txt,x,y,max_width){gk_popup_bubble_hide();var o=document.createElement('div');o.id='temp_popup_bubble';o.style.left=x+'px';o.style.top=y+'px';o.style.visibility='hidden';o.innerHTML=txt;document.body.insertBefore(o,document.body.firstChild);if(o.offsetWidth>max_width)o.style.width=max_width+'px';o.style.maxWidth=max_width+'px';gk_fit_on_screen(o);o.style.visibility='visible';o.onmousemove=gk_popup_bubble_hide;gui_display_shadow(o,'popup_bubble_shadow');}function gk_fit_on_screen(o){var dw=gk_scroll_x()+gk_doc_width();var dh=gk_scroll_y()+gk_doc_height();var ox=gk_get_absolute_pos_left(o);var oy=gk_get_absolute_pos_top(o);var x0=ox;var y0=oy;var w=o.offsetWidth;var h=o.offsetHeight;if((ox+w+4)>=dw)ox=dw-w-6;if((oy+h+4)>=dh)oy=dh-h-6;if(ox<1)ox=1;if(oy<1)oy=1;if(x0!=ox)o.style.left=ox+'px';if(y0!=oy)o.style.top=oy+'px';}var gk_ministats_uid=undefined;var gk_ministats_x=0;var gk_ministats_y=0;var gk_ministats_timer=0;var gk_ministats_cache=[];function gk_ministats_cancel(){if(gk_ministats_timer){window.clearTimeout(gk_ministats_timer);gk_ministats_timer=0;}gk_ministats_uid=undefined;gk_popup_bubble_hide();}function gk_mnst(event,uid){if(!event)var event=window.event;gk_ministats_x=gk_mouse_x(event)+15;gk_ministats_y=gk_mouse_y(event)+3;var elm=null;if(event.srcElement)elm=event.srcElement;else if(event.target)elm=event.target;if(elm){elm.onmouseout=gk_ministats_cancel;}gk_ministats_cancel();var cached_txt=gk_ministats_cache[uid];if(cached_txt&&cached_txt.length>0){gk_popup_bubble_display(cached_txt,gk_ministats_x,gk_ministats_y,300);return;}gk_ministats_uid=uid;gk_ministats_timer=window.setTimeout('gk_ministats_display()',200);}function gk_ministats_display(){if(!gk_ministats_uid)return;gk_popup_bubble_display('Loading stats for player '+gk_ministats_uid+' &hellip;',gk_ministats_x,gk_ministats_y,260);var url='/mini-stats.pl?u='+gk_ministats_uid+'&rnd='+Math.random();gk_request_remote_data(url,gk_ministats_uid,gk_ministats_data_callback);}function gk_ministats_data_callback(id,data){if(id)gk_ministats_cache[id]=data;if(!gk_ministats_uid)return;if(id==gk_ministats_uid)gk_popup_bubble_display(data,gk_ministats_x,gk_ministats_y,260);}var gk_popboard_bd=0;var gk_popboard_flip=0;var gk_popboard_x=0;var gk_popboard_y=0;var gk_popboard_timer=0;var gk_popboard_cache=[];function gk_popboard_cancel(){if(gk_popboard_timer){window.clearTimeout(gk_popboard_timer);gk_popboard_timer=0;}gk_popboard_bd=0;gk_popup_bubble_hide();}function gk_popbd(event,bd,flip){if(!event)var event=window.event;if((typeof draw_chess_diagram)!='function'){load_js('/js/chess-diagram.js?072311');}gk_popboard_x=gk_mouse_x(event)+15;gk_popboard_y=gk_mouse_y(event)+3;var elm=null;if(event.srcElement)elm=event.srcElement;else if(event.target)elm=event.target;if(elm){elm.onmouseout=gk_popboard_cancel;}gk_popboard_cancel();flip=flip?1:0;gk_popboard_bd=bd;gk_popboard_flip=flip;gk_popboard_timer=window.setTimeout('gk_popboard_display()',300);}function gk_popboard_display(){if(!gk_popboard_bd)return;gk_popup_bubble_display('<div id="gk_popboard_info"></div><div id="gk_popboard">Loading...</div>',gk_popboard_x,gk_popboard_y,999);gk_popboard_flip=gk_popboard_flip?1:0;var id=gk_popboard_bd+'-'+gk_popboard_flip;var cached_data=gk_popboard_cache[id];if(cached_data&&cached_data.length>0){gk_popboard_render(cached_data);}else{var url='/mini-board.pl?bd='+gk_popboard_bd+'&fb='+gk_popboard_flip+'&rnd='+Math.random();gk_request_remote_data(url,id,gk_popboard_data_callback);}}function gk_popboard_data_callback(id,data){if(id)gk_popboard_cache[id]=data;if(!gk_popboard_bd)return;gk_popboard_flip=gk_popboard_flip?1:0;var cur_id=gk_popboard_bd+'-'+gk_popboard_flip;if(id!=cur_id)return;gk_popboard_render(data);}function gk_popboard_render(data){var d=data.split(/\n/);var info=gk_get_el('gk_popboard_info');if(info&&d[1])info.innerHTML=d[1];var board=gk_get_el('gk_popboard');if(!board)return;draw_chess_diagram(board,d[0]);if(info)info.style.width=(board.offsetWidth+4)+'px';}function gk_pop_fen(event,fen,title){if(!event)var event=window.event;var x=gk_mouse_x(event)+15;var y=gk_mouse_y(event)+3;gk_popup_bubble_hide();var elm=null;if(event.srcElement)elm=event.srcElement;else if(event.target)elm=event.target;if(elm){elm.onmouseout=gk_popup_bubble_hide;}if(title){title='<div id="gk_popboard_info">'+title+'</div>';}else{title='';}var b_delay=0;if((typeof draw_chess_diagram)!='function'){b_delay=load_js('/js/chess-diagram.js?072311');}gk_popup_bubble_display(title+'<div id="gk_popboard_fen">Loading...</div>',x,y,999);if(b_delay){setTimeout('gk_pop_fen_render("'+fen+'")',100);}else{gk_pop_fen_render(fen);}}function gk_pop_fen_render(fen){var board=gk_get_el('gk_popboard_fen');if(!board)return;draw_chess_diagram(board,fen);var info=gk_get_el('gk_popboard_info');if(info)info.style.width=(board.offsetWidth+4)+'px';}function gk_create_remote_data_request(url,id,_callback_func,post_data){this.remote_data_callback=function(){if(!this.xhttp)return;if(this.xhttp.readyState!=4)return;var txt='';try{txt=this.xhttp.responseText;}catch(e){}var cf=this.callback_func;if((typeof cf)=='function'){cf(this.id,txt);}};this.get_remote_data_callback_handler=function(){var obj=this;return function(){obj.remote_data_callback();}};this.id=id;this.callback_func=_callback_func;this.xhttp=gk_get_http();if(!this.xhttp){var err='FATAL ERROR: Error initializing XMLHttpRequest object!';if((typeof _callback_func)=='function')_callback_func(so.id,err);return;}if(post_data){this.xhttp.open('POST',url,true);this.xhttp.onreadystatechange=this.get_remote_data_callback_handler();this.xhttp.send(post_data);}else{this.xhttp.open('GET',url,true);this.xhttp.onreadystatechange=this.get_remote_data_callback_handler();this.xhttp.send(null);}}function gk_request_remote_data(url,id,callback_func,post_data){if((typeof callback_func)=='function'){new gk_create_remote_data_request(url,id,callback_func,post_data);return undefined;}var xhttp=gk_get_http();if(!xhttp){return 'Error initializing XMLHttpRequest object!';}if(post_data){xhttp.open('POST',url,false);xhttp.onreadystatechange=function(){};try{xhttp.send(post_data);}catch(e){return 'ERROR communicating with the server (xhttp.post)';}}else{xhttp.open('GET',url,false);xhttp.onreadystatechange=function(){};try{xhttp.send(null);}catch(e){return 'ERROR communicating with the server (xhttp.get)';}}var txt='';try{txt=xhttp.responseText;}catch(e){}return txt;}function gk_limit_len(el,max_len){if(!el)return false;if((typeof el.value)=='undefined')return false;if(el.value.length<=max_len)return true;el.value=el.value.substr(0,max_len-1);return false;}function debug_log(msg){var o=gk_get_el('gk-debug-info');if(!o){o=document.createElement('div');o.id='gk-debug-info';o.className='sml';o.style.width='800px';o.style.height='500px';o.style.overflow='auto';document.body.appendChild(o);}o.innerHTML+=String(msg).replace(/\n/g,'<br>')+'<br>';}function fix_alpha(el,src){if(ie_version>=5.5&&ie_version<7&&(typeof document.body.filters)!='undefined'){var f_name='DXImageTransform.Microsoft.AlphaImageLoader';try{el.style.filter='progid:'+f_name+'(src="'+src+'",sizingMethod="scale",enabled="true")';el.src='http://'+static_domain()+'/img/blank.gif';}catch(e){el.src=src;}}else{el.src=src;}}function gk_get_call_stack(){var out='';if((typeof gk_get_call_stack.caller)=='undefined')return '';var f=gk_get_call_stack.caller;var depth=0;while(f&&depth++<10){var fn=String(f).split('\n')[0];if(fn.length>50)fn=fn.substring(0,50);out+='\t'+fn+'\n';if((typeof f.caller)=='undefined')break;f=f.caller;if(!f)break;}return out;}function load_js(url){var elms=document.getElementsByTagName('script');if(elms){for(var i=0;i<elms.length;i++){var s=elms[i].src;if(s==url)return 0;if(extract_url_path(s)==extract_url_path(url))return 0;}}var e=document.createElement('script');e.type='text/javascript';e.src=url;document.body.insertBefore(e,document.body.firstChild);return 1;}var old_on_before_unload=window.onbeforeunload;window.onbeforeunload=function(){gk_save_window_pos();if((typeof old_on_before_unload)=='function')old_on_before_unload();};function gk_get_pop_index(url){try{if(!url)var url=window.location.pathname;}catch(e){return 0;}url=url.toLowerCase();var all=['/analyze-board.pl','/chess-puzzle.pl'];for(var i=0;i<all.length;i++){if(url.indexOf(all[i])==0)return i+1;}return 0;}function gk_get_pop_window_pos(url){var idx=gk_get_pop_index(url);if(!idx)return;var all=cc_get('WINPOS').split('!');for(var i=0;i<all.length;i++){var pw=all[i].split('|');if(!pw||pw[0]!=idx)continue;pw.splice(0,1);return pw;}}function gk_set_window_pos_cookie(b_pos,x,y){var idx=gk_get_pop_index();if(!idx)return;var all=cc_get('WINPOS').split('!');if(all.length>10)return;var b_found=0;for(var i=0;i<all.length;i++){var pw=all[i].split('|');if(!pw||pw[0]!=idx)continue;pw[1+(b_pos?0:2)]=x;pw[2+(b_pos?0:2)]=y;all[i]=pw.join('|');b_found=1;}if(!b_found){var pw=b_pos?[idx,x,y,0,0]:[idx,0,0,x,y];all.push(pw.join('|'));}cc_set('WINPOS',all.join('!'),1000);}function gk_save_window_pos(){var x=window_screen_x();var y=window_screen_y();if(isNaN(x)||isNaN(y))return;if((typeof window.window_position_dx)=='number'&&(typeof window.window_position_dy)=='number'){x+=window.window_position_dx;y+=window.window_position_dy;}gk_set_window_pos_cookie(1,x,y);}function window_resize(target_w,target_h){gk_set_window_pos_cookie(0,target_w,target_h);if(window.innerWidth&&window.innerHeight&&window.outerWidth&&window.outerHeight){try{window.resizeTo(target_w+window.outerWidth-window.innerWidth,target_h+window.outerHeight-window.innerHeight);}catch(e){}}for(var pass=0;pass<2;pass++){var delta_w=0;var delta_h=0;if(window.innerWidth&&window.innerHeight){delta_w=window.innerWidth;delta_h=window.innerHeight;}else
if(document.documentElement){delta_w=document.documentElement.clientWidth;delta_h=document.documentElement.clientHeight;}else
if(document.body){delta_w=document.body.clientWidth;delta_h=document.body.clientHeight;}else{return;}delta_w=target_w-delta_w;delta_h=target_h-delta_h;if(Math.abs(delta_w)<5&&Math.abs(delta_h)<5)break;if(pass==0){try{window.resizeTo(target_w,target_w);}catch(e){return;}}else
if(pass==1){if(delta_w<0)delta_w=0;if(delta_h<0)delta_h=0;if(delta_w==0&&delta_h==0)break;try{if((typeof window.resizeBy)=='function')window.resizeBy(delta_w,delta_h);else window.resizeTo(target_w+delta_w,target_h+delta_h);}catch(e){return;}}}}function scroll_to_bottom(div_name){var o=gk_get_el(div_name);if(!o)return;o.scrollTop=o.scrollHeight-o.clientHeight;}function set_origurl(){var u=location.pathname+location.search;cc_set('ORIGURL',encodeURIComponent(u));return true;}function pre_round_frame(width,extra_style){if(!extra_style)var extra_style='padding: 6px 10px; border: 0px;';if(width>0)extra_style+='width:'+width+'px;';return '<table class=rndfrm><tr><td class=rndfrm><div class=rndfrm3></div><div class=rndfrm2></div><div class=rndfrm1></div></td></tr><tr class=rndfrm0><td style="'+extra_style+'">';}function post_round_frame(){return '</td></tr><tr><td class=rndfrm><div class=rndfrm1></div><div class=rndfrm2></div><div class=rndfrm3></div></td></tr></table>';}var gui_fullpage_bg;var gui_fullpage_fm;var gui_elm_match_fullpage_size;var gui_elm_match_fullpage_size_margin_x=0,gui_elm_match_fullpage_size_margin_y=0;var gui_old_on_resize=window.onresize;window.onresize=gui_on_window_resize;function gui_on_window_resize(){if(gui_fullpage_bg){gui_match_absolute_pos(gui_fullpage_bg);}if(gui_fullpage_fm){if(gui_elm_match_fullpage_size){var o=gk_get_el(gui_elm_match_fullpage_size);if(o)gui_match_fullpage_size(gui_fullpage_fm,o,gui_elm_match_fullpage_size_margin_x,gui_elm_match_fullpage_size_margin_y);}gui_center_absolute_pos(gui_fullpage_fm);}if((typeof gui_old_on_resize)=='function')gui_old_on_resize();}function gui_show_fullpage_form(txt,elm_match_fullpage_size,b_stretch){gui_hide_fullpage_form();gui_pop_menu_remove();gui_pop_form_remove();gui_elm_match_fullpage_size=elm_match_fullpage_size;var bg=document.createElement('div');bg.className='fullpage-form';bg.innerHTML='&nbsp;';document.body.insertBefore(bg,document.body.firstChild);gui_match_absolute_pos(bg);gui_fullpage_bg=bg;var fm=document.createElement('div');fm.style.position='absolute';fm.style.background='transparent';fm.style.zIndex='60';fm.style.display='block';fm.style.margin='10px';fm.style.visibility='hidden';if(b_stretch)fm.style.width='95%';fm.innerHTML=pre_round_frame()+txt+post_round_frame();document.body.insertBefore(fm,document.body.firstChild);if(gui_elm_match_fullpage_size){var o=gk_get_el(gui_elm_match_fullpage_size);if(o){gui_elm_match_fullpage_size_margin_x=40+(fm.offsetWidth-o.offsetWidth);gui_elm_match_fullpage_size_margin_y=40+(fm.offsetHeight-o.offsetHeight);gui_match_fullpage_size(fm,o,gui_elm_match_fullpage_size_margin_x,gui_elm_match_fullpage_size_margin_y);}}gui_center_absolute_pos(fm);fm.style.visibility='visible';gui_fullpage_fm=fm;return fm;}function gui_hide_fullpage_form(){if(gui_fullpage_bg){gui_fullpage_bg.style.display='none';var parent_node=gui_fullpage_bg.parentNode;if(parent_node)parent_node.removeChild(gui_fullpage_bg);gui_fullpage_bg=null;}if(gui_fullpage_fm){gui_fullpage_fm.innerHTML='';gui_fullpage_fm.style.display='none';var parent_node=gui_fullpage_fm.parentNode;if(parent_node)parent_node.removeChild(gui_fullpage_fm);gui_fullpage_fm=null;}gui_elm_match_fullpage_size='';}function gui_match_absolute_pos(o,frame){var x=0;var y=0;var w=1;var h=1;if(frame){x=gk_get_absolute_pos_left(frame)+1;y=gk_get_absolute_pos_top(frame)+1;w=frame.offsetWidth-2;h=frame.offsetHeight-2;}else{w=gk_doc_width();h=gk_doc_height();}o.style.left=x+'px';o.style.top=y+'px';o.style.width=w+'px';o.style.height=h+'px';}function gui_match_fullpage_size(frame,elm,margin_width,margin_height){if(!margin_width)var margin_width=0;var wd=gk_doc_width()-margin_width;if(!isNaN(wd)&&wd>100)elm.style.width=wd+'px';if(!margin_height)var margin_height=0;var ht=gk_doc_height()-margin_height;if(!isNaN(ht)&&ht>100)elm.style.height=ht+'px';}function gui_center_absolute_pos(o,frame){var x=0;var y=0;var w=1;var h=1;if(frame){x=gk_get_absolute_pos_left(frame);y=gk_get_absolute_pos_top(frame);w=frame.offsetWidth;h=frame.offsetHeight;}else{w=gk_doc_width();h=gk_doc_height();}var margin_left=0;var margin_top=0;if((typeof window.getComputedStyle)=='function'){var cs=window.getComputedStyle(o,null);margin_left=to_int(cs.getPropertyValue('margin-left'));margin_top=to_int(cs.getPropertyValue('margin-top'));}else
if(o.currentStyle){margin_left=to_int(o.currentStyle.marginLeft);margin_top=to_int(o.currentStyle.marginTop);}o.style.left=(x+Math.floor((w-o.offsetWidth)/2-margin_left))+'px';o.style.top=(y+Math.floor((h-o.offsetHeight)/2-margin_top))+'px';}var gui_pop_message_div;var gui_pop_message_timer;var gui_pop_message_modal_until;function gui_pop_message(txt,parent,timeout,modal_timeout,align_to){if((typeof timeout)=='undefined')timeout=3000;if((typeof modal_timeout)=='undefined')modal_timeout=500;if(!parent){if(document.body)parent=document.body;else if(document.documentElement)parent=document.documentElement;else return;}gui_pop_message_remove();var x=gk_get_absolute_pos_left(parent);var y=gk_get_absolute_pos_top(parent);gui_pop_message_div=document.createElement('div');var ms=gui_pop_message_div.style;ms.position='absolute';ms.zIndex='110';ms.display='block';ms.border='1px solid #000000';ms.backgroundColor='#ffffdd';ms.padding='10px';ms.cursor='default';ms.color='#000000';ms.textDecoration='none';ms.left=x+'px';ms.top=y+'px';ms.visibility='hidden';ms.textAlign='center';gui_pop_message_div.innerHTML=txt;document.body.insertBefore(gui_pop_message_div,document.body.firstChild);if(align_to==1){y=y-gui_pop_message_div.offsetHeight;}else{x=x+Math.floor((parent.offsetWidth-gui_pop_message_div.offsetWidth)/2);y=y+Math.floor((parent.offsetHeight-gui_pop_message_div.offsetHeight)/2);}ms.left=x+'px';ms.top=y+'px';ms.visibility='visible';if(modal_timeout>0)gui_pop_message_modal_until=get_time()+modal_timeout;else gui_pop_message_modal_until=0;gui_pop_message_div.onmousemove=gui_pop_message_on_mousemove;gui_display_shadow(gui_pop_message_div,'popup_bubble_shadow');gui_pop_message_timer=window.setTimeout('gui_pop_message_remove()',timeout);}function gui_pop_message_on_mousemove(){if(gui_pop_message_modal_until){var dt=gui_pop_message_modal_until-get_time();if(dt>0){if(gui_pop_message_timer)window.clearTimeout(gui_pop_message_timer);gui_pop_message_timer=window.setTimeout('gui_pop_message_remove()',dt);return;}}gui_pop_message_remove();}function gui_pop_message_remove(){if(gui_pop_message_timer){window.clearTimeout(gui_pop_message_timer);gui_pop_message_timer=0;}gui_pop_message_modal_until=0;if(!gui_pop_message_div)return;gui_pop_message_div.parentNode.removeChild(gui_pop_message_div);gui_pop_message_div=null;}function gui_display_shadow(e,class_name){if(!e)return;e.style.margin='0px';if(e._gui_shadow){for(var i=0;i<e._gui_shadow.length;i++){e.removeChild(e._gui_shadow[i]);}}e._gui_shadow=[];var shadowOffset=3;var border_w=Math.floor((e.offsetWidth-e.clientWidth)*0.5);var border_h=Math.floor((e.offsetHeight-e.clientHeight)*0.5);for(var step=0;step<2;++step){var sh=document.createElement('DIV');var ms=sh.style;if(class_name){sh.className=class_name;}else{ms.backgroundColor='#222222';ms.opacity='0.50';ms.MozOpacity='0.50';ms.filter='alpha(opacity=50)';}ms.position='absolute';ms.zIndex=e.style.zIndex?e.style.zIndex:'10';ms.display='block';ms.border='0px';ms.padding='0px';ms.margin='0px';ms.overflow='hidden';if(step){ms.right=(-shadowOffset-border_w)+'px';ms.width=shadowOffset+'px';ms.top=(shadowOffset-border_h)+'px';ms.bottom=(-border_h)+'px';}else{ms.left=(shadowOffset-border_w)+'px';ms.right=(-shadowOffset-border_w)+'px';ms.bottom=(-shadowOffset-border_h)+'px';ms.height=shadowOffset+'px';}e.appendChild(sh);e._gui_shadow.push(sh);}}function gui_copy_appearance(src,dst){var props=Array('fontSize','fontFamily');for(var ii=0;ii<props.length;ii++){var x=props[ii];var ss=gk_get_style(src,x);if(!ss)continue;dst.style[x]=ss;}}function gk_stop_event(evt){evt.cancelBubble=true;evt.returnValue=false;if(evt.stopPropagation)evt.stopPropagation();if(evt.preventDefault)evt.preventDefault();}function gk_create_mouse_capture(el){this.b_capture=0;this.parent=el;this.b_autorelease=1;this.handler_stop_event=function(evt){gk_stop_event(evt);return false;};this.mouse_move_event=function(ev){if(!this.b_capture)return;if((typeof this.parent.onmousemove)=='function')this.parent.onmousemove(ev);gk_stop_event(ev);return false;};this.get_handler_move_event=function(){var obj=this;return function(evt){return obj.mouse_move_event(evt);}};this.handler_move_event=this.get_handler_move_event();this.mouse_release_event=function(ev){if(!this.b_capture)return;if(this.b_autorelease)this.release_mouse_capture();if((typeof this.parent.onmouseup)=='function')this.parent.onmouseup(ev);gk_stop_event(ev);return false;};this.get_handler_release_event=function(){var obj=this;return function(evt){return obj.mouse_release_event(evt);}};this.handler_release_event=this.get_handler_release_event();this.set_mouse_capture=function(){this.b_capture=1;if((typeof this.parent.setCapture)!='undefined')this.parent.setCapture();if((typeof document.addEventListener)!='undefined'){document.addEventListener("mousemove",this.handler_move_event,true);document.addEventListener("mouseover",this.handler_stop_event,true);document.addEventListener("mouseout",this.handler_stop_event,true);document.addEventListener("mouseenter",this.handler_stop_event,true);document.addEventListener("mouseleave",this.handler_stop_event,true);document.addEventListener("mouseup",this.handler_release_event,true);}};this.release_mouse_capture=function(){if(!this.b_capture)return;this.b_capture=0;if((typeof this.parent.releaseCapture)!='undefined')this.parent.releaseCapture();if((typeof document.addEventListener)!='undefined'){document.removeEventListener("mousemove",this.handler_move_event,true);document.removeEventListener("mouseover",this.handler_stop_event,true);document.removeEventListener("mouseout",this.handler_stop_event,true);document.removeEventListener("mouseenter",this.handler_stop_event,true);document.removeEventListener("mouseleave",this.handler_stop_event,true);document.removeEventListener("mouseup",this.handler_release_event,true);}};this.set_mouse_capture();};function on_div_drag_start(event,el,type_action){if(!event)var event=window.event;if(el._drag_frame)return;var o=el.offsetParent;while(o){if(gk_get_style(o,'position')=='absolute'){frm=o;break;}o=o.offsetParent;}if(!frm)return;if(type_action==1){o=get_resizable_el(frm);if(o){o.gk_drag_start_w=to_int(gk_get_style(o,'width'));if(!o.gk_drag_start_w)o.gk_drag_start_w=o.offsetWidth;o.gk_drag_start_h=to_int(gk_get_style(o,'height'));if(!o.gk_drag_start_h)o.gk_drag_start_h=o.offsetHeight;}}if(has_css_class(frm,'popform')){reorder_pop_objects(frm);}el._drag_frame=frm;el._drag_action=type_action;el._dragged=0;el._drag_frame_x=to_int(gk_get_style(frm,'left'));el._drag_frame_y=to_int(gk_get_style(frm,'top'));el._drag_mouse_x=gk_mouse_x(event);el._drag_mouse_y=gk_mouse_y(event);el._old_on_mouse_up=el.onmouseup;el._old_on_mouse_move=el.onmousemove;el.onmouseup=function(event){var _obj=el;on_div_drag_stop(event,_obj);};el.onmousemove=function(event){var _obj=el;on_div_drag(event,_obj);};el._mouse_capture=new gk_create_mouse_capture(el);gk_stop_event(event);return false;}function on_div_drag_stop(event,el){if(!event)var event=window.event;if(!el||!el._drag_frame)return;el.onmouseup=el._old_on_mouse_up;el.onmousemove=el._old_on_mouse_move;var ff=el._drag_frame;el._drag_frame=null;el._mouse_capture.release_mouse_capture();if(el._dragged){if(el._drag_action==1){if((typeof ff.gk_on_resize_stop)=='function')ff.gk_on_resize_stop();}else{if((typeof ff.gk_on_drag_stop)=='function')ff.gk_on_drag_stop();}}gk_stop_event(event);return false;}function on_div_drag(event,el){if(!event)var event=window.event;if(!el||!el._drag_frame)return;var dx=gk_mouse_x(event)-el._drag_mouse_x;var dy=gk_mouse_y(event)-el._drag_mouse_y;el._dragged=1;if(el._drag_action==1){var o=get_resizable_el(el._drag_frame);if(o){var s=o.style;s.width=Math.max(o.gk_drag_start_w+dx,42)+'px';s.height=Math.max(o.gk_drag_start_h+dy,42)+'px';s.maxWidth='';s.maxHeight='';}}else{var fs=el._drag_frame.style;fs.left=(el._drag_frame_x+dx)+'px';fs.top=(el._drag_frame_y+dy)+'px';}gk_stop_event(event);return false;}var gui_pop_menu_div;var gui_pop_menu_timer;function gui_pop_menu(txt,parent,pop_dir,align_to){var b_show_immediately=0;var b_onclick_return=true;var params={};if((typeof pop_dir)==(typeof params)){params=pop_dir;pop_dir=params.dir;align_to=params.align;b_show_immediately=params.show_immediately?1:0;if(params.b_onclick_return_false)b_onclick_return=false;}if(gui_pop_menu_div)b_show_immediately=1;var x=gk_get_absolute_pos_left(parent);var y=gk_get_absolute_pos_top(parent);var parent_h=parent.offsetHeight;var parent_w=parent.offsetWidth;var frame=document.createElement('div');frame.onmouseover=gui_pop_menu_reset_remove;frame.onmouseout=gui_pop_menu_remove_delayed;frame.onclick=function(){if(gui_pop_menu_div==frame){gui_pop_menu_reset_remove();gui_pop_menu_timer=window.setTimeout('gui_pop_menu_remove()',10);}return b_onclick_return;};if(gk_is_fixed(parent)){x+=gk_scroll_x();y+=gk_scroll_y();}var b_header=params.header&&params.header.length>0?1:0;frame.className='popmenu';var ms=frame.style;ms.zIndex='80';ms.padding=b_header?'0px':'9px';ms.left='0px';ms.top='0px';ms.visibility='hidden';if(b_header){frame.innerHTML='<div class=hdr><em class=med>'+params.header+'</em></div><div style="padding: 9px; white-space: nowrap;">'+txt+'</div>';}else{frame.innerHTML=txt;}insert_pop_obj(frame);if(pop_dir==1){y+=parent_h;}else
if(pop_dir==2){x+=parent_w;}else
if(pop_dir==3){x-=frame.offsetWidth;}else
if(pop_dir==4){y+=Math.floor((parent_h-frame.offsetHeight)/2);}else{y-=frame.offsetHeight;}if(align_to==1){x+=Math.floor((parent_w-frame.offsetWidth)/2);}else
if(align_to==2){x+=parent_w-frame.offsetWidth;}frame._gui_pop_x=x;frame._gui_pop_y=y;frame.b_shown=0;gui_pop_menu_remove();gui_pop_menu_div=frame;if(b_show_immediately)gui_pop_menu_show();else
setTimeout("gui_pop_menu_show()",250);return gui_pop_menu_div;}function gui_pop_menu_show(){var o=gui_pop_menu_div;if(!o)return;o.b_shown=1;var ms=o.style;ms.left=to_int(o._gui_pop_x)+'px';ms.top=to_int(o._gui_pop_y)+'px';gk_fit_on_screen(o);ms.visibility='visible';gui_display_shadow(o,'popup_bubble_shadow');}function gui_pop_menu_reset_remove(){if(gui_pop_menu_timer){window.clearTimeout(gui_pop_menu_timer);gui_pop_menu_timer=0;}}function gui_pop_menu_remove_delayed(){gui_pop_menu_reset_remove();if(!gui_pop_menu_div)return;if(!gui_pop_menu_div.b_shown)gui_pop_menu_remove();else
gui_pop_menu_timer=window.setTimeout('gui_pop_menu_remove()',500);}function gui_pop_menu_remove(){gui_pop_menu_reset_remove();if(!gui_pop_menu_div)return;if(gui_pop_menu_div.parentNode)gui_pop_menu_div.parentNode.removeChild(gui_pop_menu_div);gui_pop_menu_div=null;}var gui_pop_form_div;function gui_pop_form(txt,parent,params){var pop_dir=params.dir;var align_to=params.align;var x=gk_get_absolute_pos_left(parent);var y=gk_get_absolute_pos_top(parent);var parent_h=parent.offsetHeight;var parent_w=parent.offsetWidth;var frame=document.createElement('div');if(gk_is_fixed(parent)){x+=gk_scroll_x();y+=gk_scroll_y();}if((typeof params.set_x)=='number')x=params.set_x;if((typeof params.set_y)=='number')y=params.set_y;frame.className='popform';var ms=frame.style;ms.zIndex='70';ms.padding='0px';ms.left=x+'px';ms.top=y+'px';frame.onmousedown=function(){reorder_pop_objects(frame);return true;};var on_close='gui_pop_form_remove();';if(params.on_close_js)on_close=params.on_close_js;var hint=encode_str('<div class=pp>You can move this window by dragging it with your mouse by the title bar (at the top).</div><div class=pp>To close this window, click on <em>&times;</em> in the upper right corner.</div><div class=pp>To resize (when possible) &mdash; drag <img src="/img/resize-corner-icon.png" class=imgs style="margin: 0 2px; width: 11px; height: 11px;"> icon in the bottom right corner with your mouse.</div>');hint='<div style="float: right; margin-top: -2px;" class="sml span-q" onMouseOver="pb_show(event,decode_str(\''+hint+'\'));">&nbsp;</div>';frame.innerHTML='<div style="cursor: move; white-space: nowrap;" class=hdr onMouseDown="on_div_drag_start(event,this);"><div style="float: right; font-size: 15px; margin: -2px -2px 0 4px;"><a href="javascript:void(0)" onClick="'+on_close+' return false;" title="Close">&times;</a></div>'+hint+'<em class=med>'+params.header+'</em></div><div style="padding: 8px; white-space: nowrap;" id="pop_form_body">'+txt+'</div>';insert_pop_obj(frame);if(pop_dir==1){y+=parent_h;}else
if(pop_dir==2){x+=parent_w;}else
if(pop_dir==3){x-=frame.offsetWidth;}else
if(pop_dir==4){y+=Math.floor((parent_h-frame.offsetHeight)/2);}else{y-=frame.offsetHeight;}if(align_to==1){x+=Math.floor((parent_w-frame.offsetWidth)/2);}else
if(align_to==2){x+=parent_w-frame.offsetWidth;}if((typeof params.set_x)=='number')x=params.set_x;if((typeof params.set_y)=='number')y=params.set_y;ms.left=Math.max(x,0)+'px';ms.top=Math.max(y,0)+'px';frame.b_shown=0;gui_pop_form_remove();gui_pop_form_div=frame;if((typeof params.set_x)!='number'&&(typeof params.set_y)!='number')gk_fit_on_screen(frame);gui_display_shadow(frame,'popup_bubble_shadow');return frame;}function gui_pop_form_remove(){if(!gui_pop_form_div)return;if(gui_pop_form_div.parentNode)gui_pop_form_div.parentNode.removeChild(gui_pop_form_div);gui_pop_form_div=null;}function gui_pop_form_update_header(html,div){if(!div)var div=gui_pop_form_div;if(!div)return;if(!div.firstChild)return;var el=div.firstChild.getElementsByTagName('em');if(!el||!el.length)return;el[0].innerHTML=html;}function gui_detach_pop_form(){var div=gui_pop_form_div;gui_pop_form_div=null;return div;}function insert_pop_obj(obj){var o=document.body.firstChild;while(o&&(has_css_class(o,'popform')||has_css_class(o,'popmenu'))){o=o.nextSibling;}if(o)document.body.insertBefore(obj,o);else
document.body.appendChild(obj);reorder_pop_objects(obj);}function reorder_pop_objects(obj){var all=[];var o=document.body.firstChild;while(o){if(o.style){o.gk_zi=to_int(o.style.zIndex);if(o!=obj&&has_css_class(o,'popform')&&o.gk_zi>=70&&o.gk_zi<80)all.push(o);}o=o.nextSibling;}all.sort(function(a,b){if(a.gk_zi>b.gk_zi)return 1;if(a.gk_zi<b.gk_zi)return-1;return 0;});var zi=70;for(var i=0;i<all.length;i++){all[i].style.zIndex=zi;zi++;}obj.style.zIndex=zi;}function call_handler_tab(name,func,tab,param1,param2,param3){var o=gk_get_el('tabs-'+name);if(!o)return false;if(!o.tabs_object)return false;if((typeof o.tabs_object[func])!='function')return false;o.tabs_object[func](tab,param1,param2,param3);return true;}function create_tabs(name,width){this.main_div=document.createElement('div');this.name=name;this.main_div.id='tabs-'+name;this.main_div.tabs_object=this;this.cur_tab=0;this.main_style='';this.b_detachable=0;this.detachable_cookie='';var s=this.main_div.style;s.textAlign='left';s.padding='2px';if(width)s.width=width+'px';this.tabs=[];this.set_detachable=function(cf){if(gk_media=='m')return;this.b_detachable=1;this.detachable_cookie=cf;};this.replace_div=function(_title,_div,tab_idx){this.data_w=_div.offsetWidth;this.data_h=_div.offsetHeight;_div.style.margin='0px';var o=document.createElement('div');var p=_div.parentNode;p.insertBefore(this.main_div,_div);p.removeChild(_div);o.appendChild(_div);var new_tab={'title':_title,'div':o,'b_replaced':1};if((typeof tab_idx)=='undefined')var tab_idx=this.tabs.push(new_tab)-1;else
this.tabs[tab_idx]=new_tab;return tab_idx;};this.replace_content=function(_title,_elm,tab_idx){var o=document.createElement('div');while(1){var e=_elm.firstChild;if(!e)break;_elm.removeChild(e);o.appendChild(e);}var new_tab={'title':_title,'div':o,'b_replaced':0};if((typeof tab_idx)=='undefined')var tab_idx=this.tabs.push(new_tab)-1;else
this.tabs[tab_idx]=new_tab;_elm.appendChild(this.main_div);return tab_idx;};this.add_new_tab=function(_title,html,tab_idx){var o=document.createElement('div');o.innerHTML=html;var new_tab={'title':_title,'div':o,'b_replaced':0};if((typeof tab_idx)=='undefined')var tab_idx=this.tabs.push(new_tab)-1;else
this.tabs[tab_idx]=new_tab;return tab_idx;};this.render=function(b_pre_render){for(var i=0;i<this.tabs.length;i++){var tab=this.tabs[i];if(!tab||!tab.div||tab.b_hidden||!tab.div.parentNode)continue;tab.div.parentNode.removeChild(tab.div);}var t=[];t.push('<table class=row style="margin: 0;'+this.main_style+'"><tr>');t.push('<td><table class=norm style="width: 100%; border-collapse: separate; border-spacing: 0;"><tr>');for(var i=0;i<this.tabs.length;i++){var tab=this.tabs[i];if(!tab||!tab.div||tab.b_hidden)continue;t.push('<td id="tab-'+this.name+'-'+i+'" style="white-space: nowrap;">&nbsp;</td>');}t.push('<td class="tab_empty">&nbsp;</td></tr></table></td></tr><tr><td id="data-'+this.name+'" class="tab_body"></td></tr></table>');this.main_div.innerHTML=t.join('');var o=gk_get_el('data-'+this.name);if(!o)return;var data=document.createElement('div');o.appendChild(data);s=data.style;s.padding='2px';if(this.data_w)s.width=(this.data_w+4).toString()+'px';if(this.data_h)s.height=(this.data_h+4).toString()+'px';for(var i=0;i<this.tabs.length;i++){var tab=this.tabs[i];if(!tab||!tab.div||tab.b_hidden)continue;tab.div.style.display='none';data.appendChild(tab.div);}if(!b_pre_render)this.show_tab(this.cur_tab);};this.tab_clicked=function(n){if(n<0||n>=this.tabs.length)return;this.show_tab(n);};this.show_tab=function(n){if(n>=this.tabs.length)n=this.tabs.length-1;if(n<0)n=0;var tab=this.tabs[n];if(!tab||tab.b_hidden){n=-1;for(var i=0;i<this.tabs.length;i++){if(!this.tabs[i]||this.tabs[i].b_hidden)continue;n=i;break;}if(n<0)return;}this.cur_tab=n;var display_tab;for(var i=0;i<this.tabs.length;i++){tab=this.tabs[i];if(!tab||!tab.div||tab.b_hidden)continue;if(i==n){display_tab=tab;if(tab.div.parentNode)tab.div.parentNode.style.overflow=tab.b_replaced?'hidden':'auto';}else{tab.div.style.display='none';}this.update_tab_header(i);}if(display_tab){display_tab.div.style.display='';if((typeof display_tab.callback_tab_active)=='function')setTimeout(display_tab.callback_tab_active,10);}};this.get_tab=function(n){return this.tabs[n];};this.disable_tab=function(n){var tab=this.tabs[n];if(!tab||tab.b_disabled)return;tab.b_disabled=1;this.hide_tab(n,1);};this.hide_tab=function(n,b_hide){var tab=this.tabs[n];if(!tab)return;tab.b_hidden=b_hide?1:0;if(b_hide&&tab.div){tab.div.style.display='none';if(tab.div.parentNode)tab.div.parentNode.removeChild(tab.div);}};this.update_tab_header=function(n,new_title){var tab=this.tabs[n];if(!tab)return;if((typeof new_title)!='undefined')tab.title=new_title;if(tab.detached_div)gui_pop_form_update_header(tab.title,tab.detached_div);if(tab.b_hidden)return;b_active=this.cur_tab==n?1:0;var o=gk_get_el('tab-'+this.name+'-'+n);if(!o)return;o.className=b_active?'tab_active':'tab_inactive';var html=tab.title;if(!b_active){html='<a href="javascript:void(0)" onClick="call_handler_tab(\''+this.name+'\',\'tab_clicked\','+n+'); return false;">'+html+'</a>';}else
if(this.b_detachable){html+=' <a href="javascript:void(0)" onClick="call_handler_tab(\''+this.name+'\',\'detach_tab\','+n+'); return false;" onMouseOver="pb_show(event,decode_str(\'Click here to detach this tab into a separate window, that can be positioned anywhere on the page\'))"><img src="/img/new-win.png" class=img-nw style="padding: 0; margin: 0 -6px 0 6px;"></a>';}o.innerHTML=html;RoundCornersTop(o);};this.detach_tab=function(n,b_pre_render){if(gk_media=='m')return;var tab=this.get_tab(n);if(!tab)return;tab.b_detached=1;if(tab.b_disabled)return;gk_popup_bubble_hide();this.hide_tab(n,1);this.render(b_pre_render);if(tab.div.parentNode)tab.div.parentNode.removeChild(tab.div);var params={'dir':0,'align':2,'header':tab.title+'&nbsp;','on_close_js':'call_handler_tab(\''+this.name+'\',\'reattach_tab\','+n+');'};if((typeof tab.detach_x)!='undefined'&&(typeof tab.detach_y)!='undefined'){var ox=0;var oy=0;if((typeof this.get_origin_xy)=='function'){var oo=this.get_origin_xy();if(oo&&oo.length>=2){ox=oo[0];oy=oo[1];}}params.set_x=ox+tab.detach_x;params.set_y=oy+tab.detach_y;params.align=0;params.dir=0;}gui_pop_form('<div id="detached_tab_temp">???</div>',this.main_div,params);if(tab.detached_div&&tab.detached_div.parentNode){tab.detached_div.parentNode.removeChild(tab.detached_div);tab.detached_div=null;}tab.detached_div=gui_detach_pop_form();var o=gk_get_el('detached_tab_temp');if(o)o.parentNode.replaceChild(tab.div,o);tab.div.style.display='';var frm=tab.detached_div;frm.gk_on_drag_stop=this.handler_save_state(tab);frm.gk_on_resize_stop=this.handler_save_state(tab);this.restore_detached_size(n);if(!b_pre_render)this.handler_save_state(tab)();var frame=frm.childNodes[1];if(frame){var rsz=document.createElement('img');rsz.src='/img/resize-corner-icon.png';var s=rsz.style;s.position='absolute';s.width='11px';s.height='11px';s.right='1px';s.bottom='1px';s.marginLeft='-10px';s.display='block';s.cursor='se-resize';frame.appendChild(rsz);rsz.onmousedown=function(event){on_div_drag_start(event,this,1);};}if((typeof tab.callback_on_detach)=='function')tab.callback_on_detach(tab,1);};this.handler_save_state=function(tab){var obj=this;return function(){var ox=0;var oy=0;if((typeof obj.get_origin_xy)=='function'){var oo=obj.get_origin_xy();if(oo&&oo.length>=2){ox=oo[0];oy=oo[1];}}var frm=tab.detached_div;if(!frm)return;tab.detach_x=gk_get_absolute_pos_left(frm)-ox;tab.detach_y=gk_get_absolute_pos_top(frm)-oy;var o=get_resizable_el(frm);if(o){tab.resizable_w=o.offsetWidth;tab.resizable_h=o.offsetHeight;}obj.save_detachable_state();};};this.reattach_tab=function(n){var tab=this.get_tab(n);if(!tab)return;tab.b_detached=0;if(tab.b_disabled)return;this.hide_tab(n,0);this.cur_tab=n;this.render();if(tab.detached_div){if(tab.detached_div.parentNode)tab.detached_div.parentNode.removeChild(tab.detached_div);tab.detached_div=null;}this.save_detachable_state();if((typeof tab.callback_on_detach)=='function')tab.callback_on_detach(tab,0);if((typeof tab.callback_tab_active)=='function')setTimeout(tab.callback_tab_active,10);};this.save_detachable_state=function(){if(gk_media=='m')return;if(!this.b_detachable||!this.detachable_cookie)return;var t=[];t.push(2);for(var i=0;i<this.tabs.length;i++){var tab=this.tabs[i];if(!tab)continue;var out=[];out.push(i);out.push(tab.b_detached?1:0);var b_detachable=(typeof tab.detach_x)=='undefined'||(typeof tab.detach_y)=='undefined'?0:1;out.push(b_detachable);if(b_detachable){out.push(tab.detach_x);out.push(tab.detach_y);}var b_resizable=(typeof tab.resizable_w)=='undefined'||(typeof tab.resizable_h)=='undefined'?0:1;out.push(b_resizable);if(b_resizable){out.push(tab.resizable_w);out.push(tab.resizable_h);}t.push(out.join('&'));}var s=t.join('|');if((typeof this.detachable_cookie)=='function')this.detachable_cookie(s,1);else
cc_set(this.detachable_cookie,s,999);};this.restore_detachable_state=function(){if(gk_media=='m')return;if(!this.b_detachable||!this.detachable_cookie)return;var max_w=gk_doc_width()+1000;var max_h=gk_doc_height()+1000;var data;if((typeof this.detachable_cookie)=='function')data=this.detachable_cookie();else
data=cc_get(this.detachable_cookie);var t=data.split('|');var version=to_int(t[0]);for(var i=1;i<t.length;i++){var vv=t[i].split('&');var nn=0;var n=to_int(vv[nn++]);var tab=this.tabs[n];if(!tab)tab={};if(version==1){var b_hidden=to_int(vv[nn++]);var b_detached=to_int(vv[nn++]);if(b_detached){tab.detach_x=Math.max(-max_w,Math.min(to_int(vv[nn++]),max_w));tab.detach_y=Math.max(-max_h,Math.min(to_int(vv[nn++]),max_h));var b_resizable=to_int(vv[nn++]);if(b_resizable){tab.resizable_w=Math.max(42,Math.min(to_int(vv[nn++]),max_w));tab.resizable_h=Math.max(42,Math.min(to_int(vv[nn++]),max_h));}this.detach_tab(n,1);}}else
if(version==2){var b_detached=to_int(vv[nn++]);var b_detachable=to_int(vv[nn++]);if(b_detachable){tab.detach_x=Math.max(-max_w,Math.min(to_int(vv[nn++]),max_w));tab.detach_y=Math.max(-max_h,Math.min(to_int(vv[nn++]),max_h));}var b_resizable=to_int(vv[nn++]);if(b_resizable){tab.resizable_w=Math.max(42,Math.min(to_int(vv[nn++]),max_w));tab.resizable_h=Math.max(42,Math.min(to_int(vv[nn++]),max_h));}if(b_detached){this.detach_tab(n,1);}}}};this.restore_detached_size=function(n){var tab=this.get_tab(n);if(!tab)return;var frm=tab.detached_div;if(!frm)return;if((typeof tab.resizable_w)=='undefined'||(typeof tab.resizable_h)=='undefined')return;var o=get_resizable_el(frm);if(!o)return;var s=o.style;s.maxWidth='';s.maxHeight='';s.padding='0';s.width=tab.resizable_w+'px';s.height=tab.resizable_h+'px';};this.destroy_all=function(){for(var i=0;i<this.tabs.length;i++){var tab=this.tabs[i];if(!tab)continue;if(tab.div){if(tab.div.parentNode)tab.div.parentNode.removeChild(tab.div);tab.div=null;}if(tab.detached_div){if(tab.detached_div.parentNode)tab.detached_div.parentNode.removeChild(tab.detached_div);tab.detached_div=null;}}};this.handler_window_on_resize=function(){var me=this;return function(){for(var i=0;i<me.tabs.length;i++){var tab=me.tabs[i];if(!tab||tab.b_disabled)continue;if(tab.detached_div){var ox=0;var oy=0;if((typeof me.get_origin_xy)=='function'){var oo=me.get_origin_xy();if(oo&&oo.length>=2){ox=oo[0];oy=oo[1];}}var s=tab.detached_div.style;s.left=Math.max(ox+tab.detach_x,0)+'px';s.top=Math.max(oy+tab.detach_y,0)+'px';}}if((typeof me.old_window_on_resize)=='function')me.old_window_on_resize();};};this.old_window_on_resize=window.onresize;window.onresize=this.handler_window_on_resize();}function get_resizable_el(el){var all=el.getElementsByTagName('*');for(var i=0;i<all.length;i++){var o=all[i];if(has_css_class(o,'resizable'))return o;}return null;}function gui_get_selected_option_value(elm_name,default_value){var o=gk_get_el(elm_name);if(!o)return default_value;if(!o.options)return default_value;var idx=o.selectedIndex;if(idx<0||idx>=o.options.length)return default_value;return to_int(o.options[idx].value);}function gui_set_selected_option(elm_name,value){var o=gk_get_el(elm_name);if(!o)return 0;if(!o.options)return 0;for(var i=0;i<o.options.length;i++){var v=o.options[i];if(v.value>=value){v.selected=1;return 1;}}return 0;}function gui_generate_select(id,all_options,selected,extra_options){var options='<SELECT id="'+id+'" '+(extra_options?extra_options:'class=ftx')+'>\n';for(var i=0;i<all_options.length;i+=2){var name=all_options[i];var val=all_options[i+1];options+='<OPTION VALUE="'+val+'"'+(val==selected?' SELECTED':'')+'>'+name+'\n';}options+='</SELECT>\n';return options;}function extract_url_path(l){var l=l.replace(/^http:\/\/[^\/]+/i,'');return l;}function decode_str(t){var o;try{o=decodeURIComponent(t);}catch(e){o=unescape(t);}return o;}function encode_str(t){t=encodeURIComponent(t);return t;}function has_css_class(el,cls){var cur_class=String(el.className);var re=new RegExp('\\b'+cls+'\\b');if(cur_class.search(re)>=0)return true;return false;}function set_css_class(el,cls,b_on){var cur_class=String(el.className);var re=new RegExp('\\b'+cls+'\\b');if(b_on){if(cur_class.search(re)>=0)return;el.className+=' '+cls;}else{el.className=cur_class.replace(re,'');}}function prnd(seed){this.rnd=function(max){this.iterate();return Math.floor(this.seed/65536)%max;};this.iterate=function(){this.seed=(this.seed*1103515245+12345)&0x7fffffff;};this.seed=(typeof seed)=='undefined'?get_time():seed;}var gk_sound_fx=1;function sound_player(_url,_volume){this.volume=_volume||50;this.url=_url;this.div_name='sound-'+String(this.url).replace(/\W+/g,'-');this.set_volume=function(v){this.volume=v||50;};this.play=function(){window.focus();if(!gk_sound_fx)return;var o=this.get_sound_elem();if(!o)return 0;if(this.b_audio_tag){try{o.pause();}catch(e){}try{o.volume=this.volume/100;}catch(e){}try{o.currentTime=0;}catch(e){}o.play();return 1;}var b_worked=1;try{o.Stop();}catch(e){}try{o.SetVolume(Math.floor(255*this.volume/100));}catch(e){}try{o.Rewind();}catch(e){}try{o.Play();}catch(e){b_worked=0;}if(!b_worked){try{o.volume=(this.volume-100)*40;}catch(e){}try{o.stop();}catch(e){}try{o.rewind();}catch(e){}try{o.play();}catch(e){}}return 1;};this.get_sound_elem=function(b_force_create){if(!gk_sound_fx)return;var o;if((typeof this.b_audio_tag)=='undefined'){this.b_audio_tag=0;var ua=navigator.userAgent;if(ua.indexOf('Firefox/3.')<0){var o;try{o=document.createElement('audio');if(o&&o.canPlayType)this.b_audio_tag=1;}catch(e){this.b_audio_tag=0;}try{if(this.b_audio_tag&&o){if(o.canPlayType('audio/mpeg')||o.canPlayType('audio/x-mpeg')){this.url=this.url.replace(/\.wav$/i,'.mp3');}else
if(!o.canPlayType('audio/wav')&&!o.canPlayType('audio/wav; codecs=1')&&!o.canPlayType('audio/x-wav')&&!o.canPlayType('audio/x-wav; codecs=1')){this.b_audio_tag=0;}}}catch(e){this.b_audio_tag=0;}}}if(this.b_audio_tag){if(!b_force_create){o=gk_get_el(this.div_name);if(o)return o;}o=document.createElement('audio');o.id=this.div_name;o.src=this.url;o.volume=this.volume/100;o.preload='auto';o.load();document.body.appendChild(o);return o;}var embed_name=this.div_name+'-embed';if(!b_force_create){o=gk_get_el(embed_name);if(o)return o;}o=gk_get_el(this.div_name);if(!o){o=document.createElement('DIV');o.id=this.div_name;document.body.appendChild(o);}o.innerHTML='<embed id="'+embed_name+'" type="audio/x-wav" EnableJavaScript="true" autostart="false" loop="false" width=0 height=0 volume=0 src="'+this.url+'"></embed>';return gk_get_el(embed_name);};this.get_sound_elem(1);}var Base64={key:'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',encode:function(input){var output='';var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;while(i<input.length){chr1=input.charCodeAt(i++);chr2=input.charCodeAt(i++);chr3=input.charCodeAt(i++);enc1=chr1>>2;enc2=((chr1&3)<<4)|(chr2>>4);enc3=((chr2&15)<<2)|(chr3>>6);enc4=chr3&63;if(isNaN(chr2))enc3=enc4=64;else if(isNaN(chr3))enc4=64;output+=this.key.charAt(enc1)+this.key.charAt(enc2)+this.key.charAt(enc3)+this.key.charAt(enc4);}return output;},decode:function(input){var output='';var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;var base64test=/[^A-Za-z0-9\+\/\=]/g;input=input.replace(base64test,'');while(i<input.length){enc1=this.key.indexOf(input.charAt(i++));enc2=this.key.indexOf(input.charAt(i++));enc3=this.key.indexOf(input.charAt(i++));enc4=this.key.indexOf(input.charAt(i++));chr1=(enc1<<2)|(enc2>>4);chr2=((enc2&15)<<4)|(enc3>>2);chr3=((enc3&3)<<6)|enc4;output+=String.fromCharCode(chr1);if(enc3!=64)output+=String.fromCharCode(chr2);if(enc4!=64)output+=String.fromCharCode(chr3);}return output;}};var _old_on_scroll=window.onscroll;window.onscroll=function(){if(gk_mm_auto_hide)return;var o=gk_get_el('mainmenudiv');if(o){if(gk_is_fixed(o)){var xx=gk_scroll_x();o.style.left=-xx+'px';}}if((typeof _old_on_scroll)=='function')_old_on_scroll();};function do_RoundCorners(d,widths,t_pre,t_post){d.style.display='block';d.style.background='transparent';d.style.lineHeight='1px';for(var i=0;i<widths.length;i++){var x=document.createElement('b');x.className='rounded-corner';x.style.borderWidth=t_pre+widths[i]+t_post;if(widths[i]==1)x.style.height='2px';d.appendChild(x);}}function RoundCornersTop(el){var d=document.createElement('b');var pad_l=to_int(gk_get_style(el,'paddingLeft'));var pad_t=to_int(gk_get_style(el,'paddingTop'));var pad_r=to_int(gk_get_style(el,'paddingRight'));d.style.margin='-'+pad_t+'px -'+pad_r+'px -4px -'+pad_l+'px';var widths=[4,2,1];do_RoundCorners(d,widths,'0 ','px');el.insertBefore(d,el.firstChild);}function RoundCornersBottom(el){var d=document.createElement('b');var pad_l=to_int(gk_get_style(el,'paddingLeft'));var pad_b=to_int(gk_get_style(el,'paddingBottom'));var pad_r=to_int(gk_get_style(el,'paddingRight'));d.style.margin='-4px -'+pad_r+'px -'+pad_b+'px -'+pad_l+'px';var widths=[1,2,4];do_RoundCorners(d,widths,'0 ','px');el.appendChild(d,el.firstChild);}function RoundCornerTL(el){var d=document.createElement('b');var pad_l=to_int(gk_get_style(el,'paddingLeft'));var pad_t=to_int(gk_get_style(el,'paddingTop'));d.style.margin='-'+pad_t+'px 0 '+(pad_t-4)+'px -'+pad_l+'px';var widths=[4,2,1];do_RoundCorners(d,widths,'0 0 0 ','px');el.insertBefore(d,el.firstChild);}function RoundCornerTR(el){var d=document.createElement('b');var pad_t=to_int(gk_get_style(el,'paddingTop'));var pad_r=to_int(gk_get_style(el,'paddingRight'));d.style.margin='-'+pad_t+'px -'+pad_r+'px '+(pad_t-4)+'px 0';var widths=[4,2,1];do_RoundCorners(d,widths,'0 ','px 0 0');el.insertBefore(d,el.firstChild);}function hasClass(el,cls){var name=String(el.className);var re=new RegExp('\\b'+cls+'\\b');return name.search(re)>=0?1:0;}function RoundCornersAll(){var tags=['div'];var re_round=new RegExp('\\bround\\b');var re_t=new RegExp('\\bround_t\\b');var re_b=new RegExp('\\bround_b\\b');var re_tl=new RegExp('\\bround_tl\\b');var re_tr=new RegExp('\\bround_tr\\b');for(var i=0;i<tags.length;i++){var v=document.getElementsByTagName(tags[i]);if(!v)continue;for(var j=0;j<v.length;j++){var cn=String(v[j].className);if(cn.search(re_round)>=0){RoundCornersTop(v[j]);RoundCornersBottom(v[j]);continue;}if(cn.search(re_t)>=0)RoundCornersTop(v[j]);if(cn.search(re_b)>=0)RoundCornersBottom(v[j]);if(cn.search(re_tl)>=0)RoundCornerTL(v[j]);if(cn.search(re_tr)>=0)RoundCornerTR(v[j]);}}}function RoundCornersAllTables(container){var re_list=new RegExp('\\blist\\b');var at=container.getElementsByTagName('table');for(var i=0;at&&i<at.length;i++){if(at[i].gk_corners_rounded)continue;var cn=String(at[i].className);if(cn.search(re_list)<0)continue;var atr=at[i].getElementsByTagName('tr');for(var k=0;atr&&k<atr.length;k++){var ath=atr[k].getElementsByTagName('th');if(!ath||!ath.length)continue;RoundCornerTL(ath[0]);RoundCornerTR(ath[ath.length-1]);at[i].gk_corners_rounded=1;break;}}}function gk_setup_page_gui(){RoundCornersAll();RoundCornersAllTables(document);}function gk_process_msg_codes(l){l=' '+String(l)+' ';var smileys=['(.?)\\:\\-?\\)','(\\W)\\;\\-?\\)','(.?)\\:\\-?\\|','(.?)\\:\\-?\\(','(.?)\\:\\-?D(?!\\w)','(.?)\\:\\-?[oO](?!\\w)','(\\s)B\\-?\\)','(.?)\\:\\-?\\@','(.?)\\:\\-?[sS](?!\\w)','(.?)\\:\\-?[pP](?!\\w)'];for(var n=1;n<=smileys.length;n++){var re=new RegExp(smileys[n-1],'g');l=l.replace(re,'$1<span class=smly'+n+'><wbr></span>');}l=l.replace(/([^\?\&])\bid=([\w\-]+)\b/g,'$1<a href="/stats.pl?$2" target="_blank" onMouseOver="gk_mnst(event,\'$2\')">$2</a>');l=l.replace(/([^\?\&])\b(bd|gm)=(\d+)\b/g,'$1<a href="javascript:popa($3,0)"><img src="/img/new-win.png" class=img-nw onMouseOver="gk_popbd(event,$3,0);">game</a>');l=l.replace(/([^\?\&])\bpz=(\d+)\b/g,'$1<a href="javascript:popw(\'/chess-puzzle.pl?pz=$2\',700,680)"><img src="/img/new-win.png" class=img-nw onMouseOver="gk_popbd(event,\'pz$2\',0);">puzzle #$2</a>');l=l.replace(/([^\?\&])\btc=(\d+)\b/g,'$1<a href="javascript:popw(\'/tactics-board.pl?bd=$2\',700,680)"><img src="/img/new-win.png" class=img-nw onMouseOver="gk_popbd(event,\'tc$2\',0);">tactics #$2</a>');return l.substr(1,l.length-2);}

