
var timerlen=5;var slideAniLen=100;var timerID=new Array();var startTime=new Array();var obj=new Array();var endHeight=new Array();var moving=new Array();var dir=new Array();var cursorloc={x:0,y:0};var wallpaperid=0;var activethumbpopup=0;var popupthumbdiv_timer=0;var galleriespopup_timer=0;var add2favspopup=false;var shadeDivPoppedUp=false;var hoverthumb=false;var sendingemail2friend=false;var avgvoteid=0;var voteid=0;var tmrWait;var categories={abstract:['3D and CG','Collages','Fantasy','Fireworks','Graffiti','Mind Teasers','Photography','Textures','Other'],aircraft:['Airfields','Antique','Blimps','Commercial','Concepts','Gliders','Helicopters','Hot Air Balloons','Military','Missiles','Private Planes','Other'],animals:['Bears','Birds','Butterflies','Cats','Cows','Deer','Dinosaurs','Dogs','Dolphins','Ducks','Elephants','Fish','Frogs','Giraffes','Horses','Kangaroos','Primates','Reptiles','Rodents','Sharks','Sheep','Squirrels','Whales','Zebras','Other'],anime:['Ah My Goddess','Akira','Appleseed','Azumanga','Beck','Berserk','Bleach','Boogiepop','Bubblegum Crisis','Burst Angel','Card Captor Sakura','Chobits','Chrono Crusade','Cowboy Bebop','Dead or Alive','Digimon','DNA','Dragonball','Escaflowne','Evangelion','Excel Saga','Fate Stay Night','Final Fantasy','FLCL','Fruits Basket','Full Metal Alchemist','Full Metal Panic','Galaxy Angel','Gantz','Get Backers','Ghost in the Shell','Gundam Seed','Gundam Wing','Gunslinger Girl','Hack Sign','Haibane Renmei','Hamtaro','Hello Kitty','Hellsing','Howls Moving Castle','Hyper Police','Initial D','Inuyasha','Kanon','Kiddy Grade','Kimi ga Nozomu Eien','King of Bandit','Lain','Last Exile','Loki Ragnarok','Love Hina','Macross','Mars','My Neighbor Totoro','Naruto','Ninja Scroll','Noir','Onegai Teacher','Onegai Twins','Outlaw Star','Paranoia Agent','Pokemon','Rahxephon','Ranma','Read or Die','Robotech','Rurouni Kenshin','Sailor Moon','Scrapped Princess','Slayers','Spirited Away','Tekken','Trigun','Tsubasa','Tsukihime','Vampire Hunter D','Vandread','War of Genesis III','Witch Hunter Robin','Wonderful Days','Yu Gi Oh','Zoids','Other'],architecture:['Amusement Parks','Ancient','Bridges','Farms','Houses','Lighthouses','Medieval','Modern','Monuments','Religious','Skyscrapers','Other'],boats:['Commercial','Competition','Cruise Ships','Fan Boats','Ferryboats','Human Powered','Inflatables','Military','New Age','Personal Boats','Powerboats','Sailboats','Ship Wrecks','Submarines','Other'],cars:['Acura','Alfa Romeo','Ascari','Aston Martin','Audi','Bentley','Bugatti','Buick','BMW','Cadillac','Chevrolet','Chrysler','Citroen','Digital Art','Dodge','Ferrari','Fiat','Ford','Girls and Cars','GMC','Honda','Hummer','Hyundai','Infiniti','Jaguar','Jeep','Kia','Koenigsegg','KTM','Lamborghini','Land Rover','Lexus','Lincoln','Lotus','Maserati','Mazda','McLaren','Mercedes','Mini Cooper','Mitsubishi','Nissan','Oldsmobile','Peugeot','Plymouth','Pontiac','Porsche','Renault','Rolls Royce','Saab','Saturn','Scion','Smart','Spyker','Subaru','Suzuki','TVR','Toyota','Volkswagen','Volvo','Other'],entertainment:['Bollywood','Fashion','Funny','Movies','Music','Theater','TV Series','Other'],motorcycles:['Aprilia','BMW','Buell','Ducati','Harley Davidson','Honda','Indian','Kawasaki','KTM','Moto Guzzi','MV Augusta','Suzuki','Triumph','Victory','Yamaha','Other'],nature:['Beaches','Bugs','Canyons','Coral Reefs','Deserts','Fields','Flowers','Forces of Nature','Forests','Grass','Greenroofs','Lakes','Mountains','Oceans','Rainbows','Rivers','Sky','Sunsets','Waterfalls','Winter','Other'],people:['Actors','Actresses','Business','Models Female','Models Male','Political','Other'],space:['Galaxies','Moons','People','Planets','Rockets','Stars','Satellites','Shuttles','Space Stations','Other'],sports:['Auto Racing','Baseball','Basketball','Biking','Boxing','Cheerleading','Dance','Equestrian','Fishing','Football','Golf','Hockey','Hunting','Ice Skating','Lacrosse','Martial Arts','Polo','Skateboarding','Skiing','Skydiving','Snowboarding','Soccer','Swimming','Roller Blading','Rugby','Tennis','Track','Water Sports','Weight Lifting','Wrestling','Other'],technology:['AMD','Apple','ATI','Cell Phones','Firefox','Gnome','Intel','KDE','Keyboards','Laptops','Linux','NVidia','PDAs','Servers','Unix','Windows','Other'],videogames:['Age of Conan','Bioshock','Castlevania','Classic Arcade Games','Command and Conquer','Commandos','Counter Strike','Crazy Taxi','Crysis','Deus Ex','Doom','Everquest','Final Fantasy','Gears of War','God of War','Gran Turismo','Grand Theft Auto','Guild Wars','Halo','Half Life','Handheld Devices','Hitman','Kingdom Hearts','Mario','Max Payne','MDK','Megaman','Metal Gear Solid','Metroid','Mortal Kombat','Nintendo Console','Parasite Eve','Playstation Console','Quake','Ragnarok Online','Resident Evil','Sonic','Soul Calibur','Starcraft','Star Wars','Street Fighter','Team Fortress','Tekken','The Sims','Theif','Tomb Raider','Unreal Tournament','Warcraft Series','World of Warcraft','XBox','Zelda','Other']};var ajaxLoadingText="<img src=\"http://cdn.desktopnexus.com/images/working-blue.gif\" border=\"0\" alt=\"\" align=\"top\" /> <span style=\"color: #6787AF; font-weight: bold;\">Loading...</span>";if(document.images){preload_image=new Image();preload_image.src="http://cdn.desktopnexus.com/images/headerbarbg-hover.gif";}
function toggleSlide(objname){if(document.getElementById(objname).style.display!="none")
slideup(objname);else
slidedown(objname);return;}
function headerNavHideAll(){slideup('sortorderdiv');slideup('resolutiondiv');slideup('galleriespopup');return;}
function slidedown(objname){if(moving[objname])
return;if(document.getElementById(objname).style.display!="none")
return;moving[objname]=true;dir[objname]="down";startslide(objname);}
function slideup(objname){if(moving[objname])
return;if(document.getElementById(objname).style.display=="none")
return;moving[objname]=true;dir[objname]="up";startslide(objname);}
function startslide(objname){obj[objname]=document.getElementById(objname);if(!obj[objname].style.height)
obj[objname].style.height=obj[objname].scrollHeight+"px";endHeight[objname]=parseInt(obj[objname].style.height);startTime[objname]=(new Date()).getTime();if(dir[objname]=="down"){obj[objname].style.height="1px";}
obj[objname].style.display="block";timerID[objname]=setInterval('slidetick(\''+objname+'\');',timerlen);}
function slidetick(objname){var elapsed=(new Date()).getTime()-startTime[objname];if(elapsed>slideAniLen)
endSlide(objname)
else{var d=Math.round(elapsed/slideAniLen*endHeight[objname]);if(dir[objname]=="up")
d=endHeight[objname]-d;obj[objname].style.height=d+"px";}
return;}
function endSlide(objname){clearInterval(timerID[objname]);if(dir[objname]=="up")
obj[objname].style.display="none";obj[objname].style.height=endHeight[objname]+"px";switch(window.location.pathname.substring(window.location.pathname.lastIndexOf('/')+1)){case"login.php":loginfluff_off();break;}
delete(moving[objname]);delete(timerID[objname]);delete(startTime[objname]);delete(endHeight[objname]);delete(obj[objname]);delete(dir[objname]);return;}
function searchGo(){searchtext=document.getElementById('searchbox').value+"/";if(searchtext=="Search all wallpapers.../")
searchtext="";window.location='http://www.desktopnexus.com/search/'+escape(searchtext.replace(/ /g,"+"));return;}
function handleJoinGroup(){document.getElementById('joingroupdiv').innerHTML="<a href=\"javascript:void(0);\" onclick=\"javascript:ajaxPutGet('leavegroup', '"+groupid+"', '');\"><img src=\"http://cdn.desktopnexus.com/images/leavegroup.gif\" border=\"0\" alt=\"Leave Group\" /></a>";alert("You have successfully joined this group!\n\nYou can now share your uploaded wallpapers with this group's gallery.");return;}
function handleLeaveGroup(results){if(results=="lastadmin"){alert("You're the last administrator of this group!\n\nYou can't leave until you first upgrade another member to admin status.");return;}
document.getElementById('joingroupdiv').innerHTML="<a href=\"javascript:void(0);\" onclick=\"javascript:ajaxPutGet('joingroup', '"+groupid+"', '');\"><img src=\"http://cdn.desktopnexus.com/images/jointhisgroup.gif\" border=\"0\" alt=\"Join This Group\" /></a>";alert("You have successfully left this group.");return;}
function popupthumbdiv(id,flip,thumbsize){popupthumbdiv_timer=setTimeout('popupthumbdiv_in("'+id+'","'+flip+'","'+thumbsize+'");',250);return;}
function popupthumbdiv_in(id,flip,thumbsize){var pushleft=0,pushtop=0;var thumbpopup=document.getElementById('thumbpopup-'+id);hoverthumb=true;if(activethumbpopup>0)
document.getElementById("thumbpopup-"+activethumbpopup).style.display="none";if(thumbsize=="small"){pushleft=129+getElementLeft('thumbnail-'+id);pushtop=15+getElementTop('thumbnail-'+id);}else if(thumbsize=="normal"){pushleft=154+getElementLeft('thumbnail-'+id);pushtop=15+getElementTop('thumbnail-'+id);}else if(thumbsize=="signup"){pushleft=340;pushtop=10+getElementTop('box'+id)-getElementTop('box1');}
if(flip==1){thumbpopup.style.display="block";pushleft-=149+thumbpopup.offsetWidth+7;}
activethumbpopup=id;thumbpopup.style.display="block";thumbpopup.style.left=pushleft+"px";thumbpopup.style.top=pushtop+"px";return;}
function popupthumbdiv_out(){clearTimeout(popupthumbdiv_timer);hoverthumb=false;return;}
function popupthumbdiv_close(){document.getElementById("thumbpopup-"+activethumbpopup).style.display="none";activethumbpopup=0;hoverthumb=false;return;}
function showGalleriesPopup(){clearTimeout(galleriespopup_timer);if(document.getElementById('galleriespopup').style.display!="none")
endslide('galleriespopup');slidedown('galleriespopup');return;}
function hideGalleriesPopup(){galleriespopup_timer=setTimeout('document.getElementById(\'galleriespopup\').style.display = \'none\';',200)
return;}
function popwalls_nav_over(id){document.getElementById('popwalls_'+id).style.background="#FFFFFF url('http://cdn.desktopnexus.com/images/popwalls-"+id+".gif') no-repeat scroll top left";return;}
function popwalls_nav_out(id){document.getElementById('popwalls_'+id).style.background="";return;}
function openPopWallsPrevious(){if(document.getElementById('popwalls_previousdayblock').style.display!="block"){document.getElementById('popwalls_previousdayblock').style.display="block";}else{document.getElementById('popwalls_previousdayblock').style.display="none";}}
function getObjNN4(obj,name)
{var x=obj.layers;var foundLayer;for(var i=0;i<x.length;i++)
{if(x[i].id==name)
foundLayer=x[i];else if(x[i].layers.length)
var tmp=getObjNN4(x[i],name);if(tmp)foundLayer=tmp;}
return foundLayer;}
function getElementLeft(Elem){if(document.layers){var elem=getObjNN4(document,Elem);return elem.pageX;}else{var elem;if(document.getElementById){var elem=document.getElementById(Elem);}else if(document.all){var elem=document.all[Elem];}
xPos=elem.offsetLeft;tempEl=elem.offsetParent;while(tempEl!=null){xPos+=tempEl.offsetLeft;tempEl=tempEl.offsetParent;}
return xPos;}}
function getElementTop(Elem){if(document.layers){var elem=getObjNN4(document,Elem);return elem.pageY;}else{if(document.getElementById){var elem=document.getElementById(Elem);}else if(document.all){var elem=document.all[Elem];}
yPos=elem.offsetTop;tempEl=elem.offsetParent;while(tempEl!=null){yPos+=tempEl.offsetTop;tempEl=tempEl.offsetParent;}
return yPos;}}
function checkSignupUsername(){if(document.getElementById('box1').value=="")return;getAjaxContent('signupusernamestatus','checksignupusername',document.getElementById('box1').value);return;}
function showYBAd300x250(){yieldbuild_client=125;yieldbuild_loc="300x250";yieldbuild_options={};document.write('<script type="text/javascript" src="http://hook.yieldbuild.com/s_ad.js"></scr'+'ipt>');return;}
function shadeDivMouseDown(){document.getElementById('shadediv').style.display='none';document.getElementById('shadePopupDiv').style.display='none';shadeDivPoppedUp=false;return;}
function showDropdownCategories(dropdowntarget,usingdncat){var ddrop=document.getElementById(dropdowntarget);ddrop.options.length=0;for(var i=0;i<categories[usingdncat].length;i++){ddrop.options[i]=new Option(categories[usingdncat][i],categories[usingdncat][i]);}
return;}
function shadeDivPopup(panel,option){document.getElementById('shadePopupDivContent').innerHTML="<div style=\"padding: 16px 12px;\">"+ajaxLoadingText+"</div>";scroll(0,0);document.getElementById('shadediv').style.display='block';document.getElementById('shadePopupDiv').style.display='block';getAjaxContent('shadePopupDivContent','shadePopupDiv',panel+"||"+option);shadeDivPoppedUp=true;return;}
function bodyMouseClick(e){var el=(typeof event!=='undefined')?event.srcElement:e.target;while(el.tagName!="BODY"){if(el.id=="addtofavoritespopup")return;if(el.id=="sortorderdiv")return;if(el.id=="resolutiondiv")return;if(el.id=="galleriespopup")return;if(el.className=="viewwhitepopup")return;el=el.parentNode;if(el==null)break;}
headerNavHideAll();if(add2favspopup)
document.getElementById('addtofavoritespopup').style.display="none";return;}
function bodyMouseMove(){if(!hoverthumb&&activethumbpopup>0)
popupthumbdiv_close();return;}
window.document.onclick=bodyMouseClick;window.document.onmousemove=bodyMouseMove;