var urlFromParent,xFromParent,xName,b_thumber=false;
function o(){
getURLFromParent();
getXFromParent();
g(0,false);
initThumberOrNot();
if(document.forms[0].tU.value)document.forms[0].bN.focus();
else document.forms[0].tU.focus();
r();
changeAd(xFromParent);
}
function embedIt(f,U){if(U.indexOf("<")>-1||U.indexOf("rawdataserver.com")>-1){f.location.href=U;return;}
var L=U.length;var u=U.toLowerCase();
if(u.lastIndexOf('.mpg')==L-4||u.lastIndexOf('.avi')==L-4||u.lastIndexOf('.wmv')==L-4||u.lastIndexOf('.asf')==L-4||u.lastIndexOf('.mpeg')==L-5)u='<embed src="'+U+'" autostart=true autostart loop=true>';
else u='<img src="'+U+'">';
f.document.open("text/html","replace");
f.document.write(u);
f.document.close();
try{f.location.reload();}catch(e){}
}
function r(){
if(parent.frames[0]&&parent.frames[0].document.forms[0]){
var w=700;
if(navigator.userAgent.indexOf('MSIE')>-1)w=document.body.clientWidth;
//else w=self.innerWidth;
else w=parent.innerWidth;
parent.frames[0].document.forms[0].tU.style.width=w-600;
}
}
function changeAd(f){
if(f=='g'||xFromParent=='g'){parent.ad.location.href="goop.html";return;}
if(!f&&Math.random()<1)return;
var n=navigator.userAgent;
if(n.indexOf("Opera")<0&&n.indexOf("Safari")<0&&n.indexOf("MSIE")>-1){//||n.indexOf("Mozilla")>-1)
 try{parent.ad.document.open("text/html","replace");
 parent.ad.document.write("<html><body vlink=0000FF bgcolor=ffffdd><center><SCRIPT SRC=http://3.adbrite.com/mb/text_group.php?sid=28293&newwin=1></SCRIPT>");
 parent.ad.document.close();
 parent.ad.location.reload();
}catch(e){parent.ad.location.href="ad.html";}
}else parent.ad.location.href="ad.html";
}
function getURL(){var u=parent.location.href,i=u.indexOf("u=");if(i>-1){u=u.substring(i+2);return u;}return "";}
function getX(){var u=parent.location.href,i=u.indexOf("?x=");if(i>-1){u=u.substring(i+3,i+4);return u;}return "0";}
function getURLFromParent(){urlFromParent=getURL();setTextField();}
function getXFromParent(){xFromParent=getX();}
function nW(){
if(xName)return xName;
getXFromParent();
if(xFromParent=='w')xName="WebGoggles";
else if(xFromParent=='h')xName="HandJerker";
else if(xFromParent=='f')xName="FlowingWu";
else if(xFromParent=='g')xName="GoOgleOfPorn";
else if(xFromParent==2)xName="AmIAnal";
else if(xFromParent==1)xName="AmIAsian";
else xName="AmINaked";
return xName;
}
function setTextField(){
if(document==null||document.forms[0]==null||document.forms[0].tU==null)setTimeout("setTextField()",500);
else document.forms[0].tU.value=urlFromParent;
}
function setLocationField(URL){document.forms[0].tU.value=URL;}
function getCurrentURL(){return document.forms[0].tU.value;}
function showDir(){
var URL=document.forms[0].tU.value,r=URL.match(/^(.*\/)/);
if(r==null){alert("The NAKEDBROWSER! cannot figure out how to extract\nthe directory information from this URL.");return;}
window.open(r[1],"","");
}
function f(){
var URL=document.forms[0].tU.value,r=URL.match(/^(.*\D)(\d+)(.*)/);
if(r==null||r.length<3){alert("The NAKEDBROWSER! cannot figure out how\nto go to the first pic in the series.");return;}
var a=r[2],z=r[3],b="",zeros_then_one=false;
if(a.length>1&&a.indexOf("1")==a.length-1){
var zeros=true;
for(var j=0;j<a.length-1;j++){if(a.charAt(j)!="0"){zeros=false;break;}}
zeros_then_one=zeros;
}
if(zeros_then_one)b="1";
else{
for(var i=0;i<a.length-1;i++)b+="0";
b+="1";
var t="The NAKEDBROWSER! will try to load the first picture in the series,\nhowever, the picture may not exist on this server.";
if(b.charAt(0)=="0")t+="\n\nOR it may not be named "+b+z+". If a picture does not appear,\nyou can click the  |<  button AGAIN to load 1"+z+". (No zero.)"+"\n\nTurn off these & other popups: in 'thumbs' sidebar, click 'no popups' checkbox.";
if(getCookie("nopop")!="true")alert(t);
}
setLocationField(r[1]+b+r[3]);g(0,false);
}
function g(goNum,dir){
var URL=document.forms[0].tU.value;
if(goNum==0){setPicWindowLocation(URL);return;}
var a,b,num;
if(URL=="")return;
var r=URL.match(/^(.*\D)(\d+)(.*)/);
if(r==null||r.length<3){alert("The NAKEDBROWSER! cannot figure out how\nto change this URL to go to the next picture.");return;}
a=r[1];num=r[2];b=r[3];
if(dir){
var y=URL.indexOf("://");y=URL.indexOf("/",y+3),search=a.substring(y),myResult=search.match(/^(.*\D)(\d+)(.*)/);
if(myResult==null||myResult.length<3){alert("The NAKEDBROWSER! cannot figure out how\nto change this URL to go to the next directory.");return;}
a=URL.substring(0,y)+myResult[1];num=myResult[2];b=myResult[3]+r[2]+r[3];
}
var numLenWithZero=(""+num).length,numLenNoZero=((num-0)+"").length,original_num=num;
num=(goNum-0)+(num-0);
if(num<0){
if(goNum<-1)g(-1*original_num,dir);
else alert("The NAKEDBROWSER! will not go negative.");
return;
}
var num$=""+num;
while(numLenWithZero>num$.length)num$="0"+num$;
var newNumLenNoZero=((num$-0)+"").length;
if((getCookie("nopop")!="true")&&numLenNoZero>newNumLenNoZero){
alert("The NAKEDBROWSER! is adding a zero to the URL. So instead of this:\n\n"+a+num+b+"\n\nthe URL is now this:\n\n"+a+num$+b+"\n\nAdding the zero(s) may not be necessary. If no picture shows up next,\ndelete the zero(s) and click 'go'. Hopefully you'll get a picture. You know."+"\n\nTurn off these & other popups: in 'thumbs' sidebar, click 'no popups' checkbox.");
}
var newURL=a+num$+b;
setPicWindowLocation(newURL);document.forms[0].tU.value=newURL;
}
function sP(){if(xFromParent=="w")xFromParent=0;setPicWindowLocation("http://rawdataserver.com/cgi-bin/a/ainon.cgi?from=browz&x="+xFromParent+"&ben="+document.forms[0].tU.value);}
function uZoom(){window.open("zoom.html?nakedurl="+document.forms[0].tU.value,"","");}
function series(){top.location.href="http://rawdataserver.com/dude/series/series.html?url="+document.forms[0].tU.value;}
function keep(){window.open("http://rawdataserver.com/cgi-bin/a/my.cgi?add="+document.forms[0].tU.value,"","height=205,width=515,location=no,resizable=yes,menubar=yes,personalbar=no,status=no,toolbar=no");}
function initThumber(){b_thumber=true;parent.P.location.href="ti.html";setCookie("thumber","yes");}
function cT(){b_thumber=false;var URL=getCurrentURL();
if(URL=="")parent.P.document.write("");
else parent.P.location.href=URL;
setCookie("thumber","no");}
function uThumb(){changeAd();initThumber();}
function setPicWindowLocation(URL){changeAd();if(URL!=""){

if(b_thumber){
parent.P.sPWL(URL);
}else{

//if(getCookie("embedit")=="true")embedIt(parent.P,URL);else
parent.P.location.href=URL;

}
//if(parent.b_thumber)parent.P.sPWL(URL);
//else parent.P.location.href=URL;

}}
function initThumberOrNot(){
if(document.cookie.indexOf("thumber=no")>-1);else initThumber();
//if(document.cookie.indexOf("thumber=yes")>-1)initThumber();
}
function getCookie(key){var c=document.cookie,a=c.indexOf(key+"=");if(a<0)return "";a+=key.length+1;var b=c.indexOf(";",a);if(b<=a)return c.substring(a);return c.substring(a,b);}
function setCookie(key,val){if(getCookie(key)==val)return;var cookie_expiration=new Date();cookie_expiration.setTime(cookie_expiration.getTime()+365*24*60*60*1000);document.cookie=key+"="+val+";expires="+cookie_expiration.toGMTString();}