function wopen(url,width,height)
{newwindow=window.open(url,'name','height='+height+',width='+width);if(window.focus){newwindow.focus()}
return false;}
function sure(url,text)
{if(confirm(text))
{document.location=url;}}
function bookmark(a)
{if(window.sidebar)
{window.sidebar.addPanel(title,homepage,'');return true;}
else if(window.opera&&window.print)
{a.href=homepage;a.rel="sidebar";a.title=title;return true;}
else if(document.all)
{window.external.AddFavorite(homepage,title);return true;}
var chr='CTRL-D';var agt=navigator.userAgent.toLowerCase();if(agt.substr(agt.indexOf('opera')+6,1)<9)chr='CTRL-T';alert("Press '+chr+' to bookmark us!");}
function get(id)
{return document.getElementById(id);}
function toggle(theDiv)
{var elem=document.getElementById(theDiv);if(theDiv=='codes')
{elem.style.display='block';clip_init();return true;}
if(elem.style.display=="none")
{elem.style.display='block';return true;}
else
{elem.style.display='none';return false;}}
function upload_status(perc)
{get('status_uploading').style.width=perc+'%';perc=perc+1;if(perc>99)
{perc=0;}
setTimeout('upload_status('+perc+')',500);}
function submit_form()
{if(get('upload'))
{if(!get('upload').value)
{return false;}}
if(get("l_adult_no"))
{if(!get("l_adult_no").checked&&!get("l_adult_yes").checked)
{alert(text_alert);return false;}}
if(get("presubmit"))
{get('presubmit').style.display='none';get('progress').style.display='';setTimeout('upload_status(0)',500);}
var c=new Date();hashArr=new Array();hashArr[hashArr.length]=typeof screen.colorDepth!="undefined"?screen.colorDepth:"?";hashArr[hashArr.length]=typeof screen.width!="undefined"?screen.width:"?";hashArr[hashArr.length]=typeof screen.height!="undefined"?screen.height:"?";hashArr[hashArr.length]=typeof navigator.cookieEnabled!="undefined"?"true":"?";hashArr[hashArr.length]=typeof navigator.systemLanguage!="undefined"?navigator.systemLanguage:"?";hashArr[hashArr.length]=typeof navigator.userLanguage!="undefined"?navigator.userLanguage:"?"
if(c.toLocaleString())
{hashArr[hashArr.length]=c.toLocaleString();}
else
{hashArr[hashArr.length]="?";}
hashArr[hashArr.length]=typeof navigator.userAgent!=navigator.userAgent?navigator.userAgent:"?";var d="";for(var e=0;e<hashArr.length;e++)
{d=d+hashArr[e]+"__"}
get('ui').value=d;return true;}
function bot_test()
{get('antibot').value="test";return true;}
function update_code()
{var field=get('layout');var str=get('selectbox').value;var result="";if(get('type')&&get('type').selectedIndex==1)
{var gallery_url=get('type').value;switch(get('selectbox').selectedIndex)
{case 0:result='[url='+gallery_url+']'+gallery_url+'[/url]';break;case 1:result='[url]'+gallery_url+'[/url]';break;case 2:result='<a href="'+gallery_url+'" target="_blank">';break;case 4:result='[url='+gallery_url+']'+gallery_url+'[/url]';break;case 5:result='[url]'+gallery_url+'[/url]';break;case 6:result='<a href="'+gallery_url+'" target="_blank">';break;default:result=gallery_url;}}
else
{if(field.value==1||get('selectbox').selectedIndex==3)
{result=str;}
else
{if(get('selectbox').selectedIndex==2||get('selectbox').selectedIndex==6)
{var code=str.split("<br /><br />");}
else
{var code=str.split("\n\n");}
for(i=0;i<code.length;i++)
{if(field.value==6)
{result=result+code[i]+" ";}
else
{if((i+1)%field.value==false)
{if(get('selectbox').selectedIndex==2||get('selectbox').selectedIndex==6)
{result=result+code[i]+"<br /><br />";}
else
{result=result+code[i]+"\n\n";}}
else
{result=result+code[i]+" ";}}}}}
get('code_1').value=result;}
function do_open(url,name,w,h)
{if(p_shown===true)
{return true;}
var new_window=window.open(url,name,"toolbar,status,resizable,scrollbars,menubar,location,height="+h+",width="+w);window.setTimeout(window.focus,100);if(new_window)
{new_window.blur();p_shown=true;}
return new_window;}
function set_cookie(name,value,time)
{var expires=new Date();expires.setTime(expires.getTime()+time);document.cookie=name+"="+value+"; expires="+expires.toGMTString()+"; path=/; domain=.postimage.org";}
function get_cookie(name)
{var cookies=document.cookie.toString().split('; ');var cookie,c_name,c_value;for(var n=0;n<cookies.length;n++)
{cookie=cookies[n].split("=");c_name=cookie[0];c_value=cookie[1];if(c_name==name)
{return c_value;}}
return null;}
function check_target()
{i=1;var input_e=document.getElementsByTagName('INPUT');for(var i=0;i<input_e.length;i++)
{if(input_e[i].type=='hidden')
{if(input_e[i].value.match(/^http/i))
{ad=input_e[i].name.split('_');var cookie=get_cookie(ad[0]);if(cookie===null)
{do_open(input_e[i].value,ad[0],ad[1],ad[2]);set_cookie(ad[0],1,24*60*60*7*1000);break;}}}}}
var p_shown=false;var to_open=false;var input_e=document.getElementsByTagName('INPUT');for(var i=0;i<input_e.length;i++)
{if(input_e[i].type=='hidden')
{if(input_e[i].value.match(/^http/i))
{ad=input_e[i].name.split('_');var cookie=get_cookie(ad[0]);if(cookie===null)
{to_open=true;break;}}}}
var a_elem=document.getElementsByTagName('A');for(var i=0;i<a_elem.length;i++)
{if(a_elem[i].id=='aroul')
{if(to_open)
{a_elem[i].onclick=new Function("check_target()");}
else
{}}}
