

if (document.images) { 
img1N= new Image(95,32); 
img1N.src= 'http://www.naturist.com.au/naturist/images/homebutton.png' ; 
img1H= new Image(95,32); 
img1H.src= 'http://www.naturist.com.au/naturist/images/pinkhomebutton.png' ; 

img2N= new Image(95,32); 
img2N.src= 'http://www.naturist.com.au/naturist/images/personalsbutton.png' ; 
img2H= new Image(95,32); 
img2H.src= 'http://www.naturist.com.au/naturist/images/pinkpersonalsbutton.png' ;

img3N= new Image(95,32); 
img3N.src= 'http://www.naturist.com.au/naturist/images/chatbutton.png' ; 
img3H= new Image(95,32); 
img3H.src= 'http://www.naturist.com.au/naturist/images/pinkchatbutton.png' ; 

img4N= new Image(95,32); 
img4N.src= 'http://www.naturist.com.au/naturist/images/gallerybutton.png' ; 
img4H= new Image(95,32); 
img4H.src= 'http://www.naturist.com.au/naturist/images/pinkgallerybutton.png' ; 

img5N= new Image(95,32); 
img5N.src= 'http://www.naturist.com.au/naturist/images/scenebutton.png' ; 
img5H= new Image(95,32); 
img5H.src= 'http://www.naturist.com.au/naturist/images/pinkscenebutton.png' ; 

img6N= new Image(95,32); 
img6N.src= 'http://www.naturist.com.au/naturist/images/sexshopbutton.png' ; 
img6H= new Image(95,32); 
img6H.src= 'http://www.naturist.com.au/naturist/images/pinksexshopbutton.png' ; 

img7N= new Image(95,32); 
img7N.src= 'http://www.naturist.com.au/naturist/images/linksbutton.png' ; 
img7H= new Image(95,32); 
img7H.src= 'http://www.naturist.com.au/naturist/images/pinklinksbutton.png' ; 

img8N= new Image(95,32); 
img8N.src= 'http://www.naturist.com.au/naturist/images/helpbutton.png' ; 
img8H= new Image(95,32); 
img8H.src= 'http://www.naturist.com.au/naturist/images/pinkhelpbutton.png' ; 

img9N= new Image(20,20); 
img9N.src= 'http://www.naturist.com.au/naturist/images/redoff.png' ; 
img9H= new Image(20,20); 
img9H.src= 'http://www.naturist.com.au/naturist/images/redon.png' ; 

img10N= new Image(20,20); 
img10N.src= 'http://www.naturist.com.au/naturist/images/purpleoff.png' ; 
img10H= new Image(20,20); 
img10H.src= 'http://www.naturist.com.au/naturist/images/purpleon.png' ; 

img11N= new Image(20,20); 
img11N.src= 'http://www.naturist.com.au/naturist/images/blueoff.png' ; 
img11H= new Image(20,20); 
img11H.src= 'http://www.naturist.com.au/naturist/images/blueon.png' ; 

img12N= new Image(20,20); 
img12N.src= 'http://www.naturist.com.au/naturist/images/greenoff.png' ; 
img12H= new Image(20,20); 
img12H.src= 'http://www.naturist.com.au/naturist/images/greenon.png' ; 

img13N= new Image(20,20); 
img13N.src= 'http://www.naturist.com.au/naturist/images/blackoff.png' ; 
img13H= new Image(20,20);  
img13H.src= 'http://www.naturist.com.au/naturist/images/blackon.png' ; 

img14N= new Image(20,20); 
img14N.src= 'http://www.naturist.com.au/naturist/images/redoff1.png' ; 
img14H= new Image(20,20); 
img14H.src= 'http://www.naturist.com.au/naturist/images/redon1.png' ; 

img15N= new Image(20,20); 
img15N.src= 'http://www.naturist.com.au/naturist/images/purpleoff1.png' ; 
img15H= new Image(20,20); 
img15H.src= 'http://www.naturist.com.au/naturist/images/purpleon1.png' ; 

img16N= new Image(20,20); 
img16N.src= 'http://www.naturist.com.au/naturist/images/blueoff1.png' ; 
img16H= new Image(20,20); 
img16H.src= 'http://www.naturist.com.au/naturist/images/blueon1.png' ; 

img17N= new Image(20,20); 
img17N.src= 'http://www.naturist.com.au/naturist/images/greenoff1.png' ; 
img17H= new Image(20,20); 
img17H.src= 'http://www.naturist.com.au/naturist/images/greenon1.png' ; 

img18N= new Image(20,20); 
img18N.src= 'http://www.naturist.com.au/naturist/images/blackoff1.png' ; 
img18H= new Image(20,20);  
img18H.src= 'http://www.naturist.com.au/naturist/images/blackon1.png' ; 

img19N= new Image(260,30); 
img19N.src= 'http://www.naturist.com.au/naturist/images/priorityoff.png' ; 
img19H= new Image(260,30);  
img19H.src= 'http://www.naturist.com.au/naturist/images/priorityon.png' ; 

img20N= new Image(260,30); 
img20N.src= 'http://www.naturist.com.au/naturist/images/priorityoff.png' ; 
img20H= new Image(260,30);  
img20H.src= 'http://www.naturist.com.au/naturist/images/priorityon.png' ; 

img21N= new Image(170,80); 
img21N.src= 'http://www.naturist.com.au/naturist/images/join1off.png' ; 
img21H= new Image(170,80);  
img21H.src= 'http://www.naturist.com.au/naturist/images/join1on.png' ; 

img22N= new Image(170,80); 
img22N.src= 'http://www.naturist.com.au/naturist/images/join2off.png' ; 
img22H= new Image(170,80);  
img22H.src= 'http://www.naturist.com.au/naturist/images/join2on.png' ; 

img23N= new Image(130,60); 
img23N.src= 'http://www.naturist.com.au/naturist/images/chatroomoff.png' ; 
img23H= new Image(130,60);  
img23H.src= 'http://www.naturist.com.au/naturist/images/chatroomon.png' ; 

img24N= new Image(120,70); 
img24N.src= 'http://www.naturist.com.au/naturist/images/swingersclubsoff.png' ; 
img24H= new Image(120,70);  
img24H.src= 'http://www.naturist.com.au/naturist/images/swingersclubson.png' ; 

img25N= new Image(120,70); 
img25N.src= 'http://www.naturist.com.au/naturist/images/coupleseventsoff.png' ; 
img25H= new Image(120,70);  
img25H.src= 'http://www.naturist.com.au/naturist/images/coupleseventson.png' ; 

img26N= new Image(120,70); 
img26N.src= 'http://www.naturist.com.au/naturist/images/ladieseventsoff.png' ; 
img26H= new Image(120,70);  
img26H.src= 'http://www.naturist.com.au/naturist/images/ladieseventson.png' ; 

img27N= new Image(120,70); 
img27N.src= 'http://www.naturist.com.au/naturist/images/gangbangsoff.png' ; 
img27H= new Image(120,70);  
img27H.src= 'http://www.naturist.com.au/naturist/images/gangbangson.png' ; 

img28N= new Image(120,70); 
img28N.src= 'http://www.naturist.com.au/naturist/images/bdsmclubsoff.png' ; 
img28H= new Image(120,70);  
img28H.src= 'http://www.naturist.com.au/naturist/images/bdsmclubson.png' ; 

img29N= new Image(120,70); 
img29N.src= 'http://www.naturist.com.au/naturist/images/xxxgalleriesoff.png' ; 
img29H= new Image(120,70);  
img29H.src= 'http://www.naturist.com.au/naturist/images/xxxgallerieson.png' ; 

img30N= new Image(120,70); 
img30N.src= 'http://www.naturist.com.au/naturist/images/xxxmoviesoff.png' ; 
img30H= new Image(120,70);  
img30H.src= 'http://www.naturist.com.au/naturist/images/xxxmovieson.png' ; 

img31N= new Image(120,70); 
img31N.src= 'http://www.naturist.com.au/naturist/images/membersmoviesoff.png' ; 
img31H= new Image(120,70);  
img31H.src= 'http://www.naturist.com.au/naturist/images/membersmovieson.png' ; 

img32N= new Image(120,70); 
img32N.src= 'http://www.naturist.com.au/naturist/images/xxxstoriesoff.png' ; 
img32H= new Image(120,70);  
img32H.src= 'http://www.naturist.com.au/naturist/images/xxxstorieson.png' ; 

img33N= new Image(120,70); 
img33N.src= 'http://www.naturist.com.au/naturist/images/entersiteoff.png' ; 
img33H= new Image(120,70);  
img33H.src= 'http://www.naturist.com.au/naturist/images/entersiteon.png' ; 

img34N= new Image(120,70); 
img34N.src= 'http://www.naturist.com.au/naturist/images/exitsiteoff.png' ; 
img34H= new Image(120,70);  
img34H.src= 'http://www.naturist.com.au/naturist/images/exitsiteon.png' ; 

img35N= new Image(120,70); 
img35N.src= 'http://www.naturist.com.au/naturist/images/doggingoff.png' ; 
img35H= new Image(120,70);  
img35H.src= 'http://www.naturist.com.au/naturist/images/doggingon.png' ; 

img36N= new Image(120,70); 
img36N.src= 'http://www.naturist.com.au/naturist/images/upgradeoff.png' ; 
img36H= new Image(120,70);  
img36H.src= 'http://www.naturist.com.au/naturist/images/upgradeon.png' ; 


img37N= new Image(300,30); 
img37N.src= 'http://www.naturist.com.au/naturist/images/tour2off.png' ; 
img37H= new Image(300,30);  
img37H.src= 'http://www.naturist.com.au/naturist/images/tour2on.png' ; 

img38N= new Image(300,30); 
img38N.src= 'http://www.naturist.com.au/naturist/images/tour3off.png' ; 
img38H= new Image(300,30);  
img38H.src= 'http://www.naturist.com.au/naturist/images/tour3on.png' ; 

img39N= new Image(300,30); 
img39N.src= 'http://www.naturist.com.au/naturist/images/tour4off.png' ; 
img39H= new Image(300,30);  
img39H.src= 'http://www.naturist.com.au/naturist/images/tour4on.png' ; 

img40N= new Image(300,30); 
img40N.src= 'http://www.naturist.com.au/naturist/images/tour5off.png' ; 
img40H= new Image(300,30);  
img40H.src= 'http://www.naturist.com.au/naturist/images/tour5on.png' ; 

img41N= new Image(300,30); 
img41N.src= 'http://www.naturist.com.au/naturist/images/tour6off.png' ; 
img41H= new Image(300,30);  
img41H.src= 'http://www.naturist.com.au/naturist/images/tour6on.png' ; 

img42N= new Image(300,30); 
img42N.src= 'http://www.naturist.com.au/naturist/images/tour7off.png' ; 
img42H= new Image(300,30);  
img42H.src= 'http://www.naturist.com.au/naturist/images/tour7on.png' ; 

img43N= new Image(150,150); 
img43N.src= 'http://www.naturist.com.au/naturist/images/freejoinoff.png' ; 
img43H= new Image(150,150);  
img43H.src= 'http://www.naturist.com.au/naturist/images/freejoinon.png' ; 

img44N= new Image(150,100); 
img44N.src= 'http://www.naturist.com.au/naturist/images/reasonoff.png' ; 
img44H= new Image(150,100);  
img44H.src= 'http://www.naturist.com.au/naturist/images/reasonon.png' ; 

img45N= new Image(130,60); 
img45N.src= 'http://www.naturist.com.au/naturist/images/nudistbeachoff.png' ; 
img45H= new Image(130,60);  
img45H.src= 'http://www.naturist.com.au/naturist/images/nudistbeachon.png' 


function myOn(myImgName) {document[myImgName].src=eval(myImgName+ 'H' ).src;} 
function myOut(myImgName) {document[myImgName].src=eval(myImgName+ 'N' ).src;} 
} 

var manual_or_random="manual" //"manual" or "random"
var randomsetting="1 days" //"eachtime", "sessiononly", or "x days (replace x with desired integer)". Only applicable if mode is random.


function getCookie(Name) { 
var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
if (document.cookie.match(re)) //if cookie found
return document.cookie.match(re)[0].split("=")[1] //return its value
return null
}

function setCookie(name, value, days) {
var expireDate = new Date()
//set "expstring" to either future or past date, to set or delete cookie, respectively
var expstring=(typeof days!="undefined")? expireDate.setDate(expireDate.getDate()+parseInt(days)) : expireDate.setDate(expireDate.getDate()-5)
document.cookie = name+"="+value+"; expires="+expireDate.toGMTString()+"; path=/";
}

function deleteCookie(name){
setCookie(name, "moot")
}


function setStylesheet(title, randomize){ //Main stylesheet switcher function. Second parameter if defined causes a random alternate stylesheet (including none) to be enabled
var i, cacheobj, altsheets=[""]
for(i=0; (cacheobj=document.getElementsByTagName("link")[i]); i++) {
if(cacheobj.getAttribute("rel").toLowerCase()=="alternate stylesheet" && cacheobj.getAttribute("title")) { //if this is an alternate stylesheet with title
cacheobj.disabled = true
altsheets.push(cacheobj) //store reference to alt stylesheets inside array
if(cacheobj.getAttribute("title") == title) //enable alternate stylesheet with title that matches parameter
cacheobj.disabled = false //enable chosen style sheet
}
}
if (typeof randomize!="undefined"){ //if second paramter is defined, randomly enable an alt style sheet (includes non)
var randomnumber=Math.floor(Math.random()*altsheets.length)
altsheets[randomnumber].disabled=false
}
return (typeof randomize!="undefined" && altsheets[randomnumber]!="")? altsheets[randomnumber].getAttribute("title") : "" //if in "random" mode, return "title" of randomly enabled alt stylesheet
}

function chooseStyle(styletitle, days){ //Interface function to switch style sheets plus save "title" attr of selected stylesheet to cookie
if (document.getElementById){
setStylesheet(styletitle)
setCookie("mysheet", styletitle, days)
}
}

function indicateSelected(element){ //Optional function that shows which style sheet is currently selected within group of radio buttons or select menu
if (selectedtitle!=null && (element.type==undefined || element.type=="select-one")){ //if element is a radio button or select menu
var element=(element.type=="select-one") ? element.options : element
for (var i=0; i<element.length; i++){
if (element[i].value==selectedtitle){ //if match found between form element value and cookie value
if (element[i].tagName=="OPTION") //if this is a select menu
element[i].selected=true
else //else if it's a radio button
element[i].checked=true
break
}
}
}
}

if (manual_or_random=="manual"){ //IF MANUAL MODE
var selectedtitle=getCookie("mysheet")
if (document.getElementById && selectedtitle!=null) //load user chosen style sheet from cookie if there is one stored
setStylesheet(selectedtitle)
}
else if (manual_or_random=="random"){ //IF AUTO RANDOM MODE
if (randomsetting=="eachtime")
setStylesheet("", "random")
else if (randomsetting=="sessiononly"){ //if "sessiononly" setting
if (getCookie("mysheet_s")==null) //if "mysheet_s" session cookie is empty
document.cookie="mysheet_s="+setStylesheet("", "random")+"; path=/" //activate random alt stylesheet while remembering its "title" value
else
setStylesheet(getCookie("mysheet_s")) //just activate random alt stylesheet stored in cookie
}
else if (randomsetting.search(/^[1-9]+ days/i)!=-1){ //if "x days" setting
if (getCookie("mysheet_r")==null || parseInt(getCookie("mysheet_r_days"))!=parseInt(randomsetting)){ //if "mysheet_r" cookie is empty or admin has changed number of days to persist in "x days" variable
setCookie("mysheet_r", setStylesheet("", "random"), parseInt(randomsetting)) //activate random alt stylesheet while remembering its "title" value
setCookie("mysheet_r_days", randomsetting, parseInt(randomsetting)) //Also remember the number of days to persist per the "x days" variable
}
else
setStylesheet(getCookie("mysheet_r")) //just activate random alt stylesheet stored in cookie
} 
}






