var lastpop=0; var getpos=250; var getobj=''; var getrandomp=0; var getrandomq=0; var thequote=''; var quotesarr=''; var quotebox=''; var quoteboxt=''; var quoteboxtop=1; var quoteboxleft=1; var quoteboxttop=12; var quoteboxtleft=6; var killcommand='no'; var timeoutup=''; var timeoutdown=''; var timeoutgorandom=''; var timeoutsquote=''; var loadgo = "no"; function goUp(obj) { if (killcommand=="no"){ document.getElementById(obj).style.top=getpos+'px'; getpos-=2; if(getpos>3){ timeoutup = window.setTimeout("goUp('"+obj+"');", 0); }else{ showQuote(obj); } } } function goDown(obj) { if (killcommand=="no"){ document.getElementById(obj).style.top=getpos+'px'; getpos+=2; if(getpos<251) { timeoutdown = window.setTimeout("goDown('"+obj+"');", 0); }else{ timeoutgorandom = window.setTimeout("getRandomPop();", 2000); } } } function showQuote(obj) { thequote = getRandomQuote(obj); document.getElementById(quotebox).style.top=quoteboxtop+'px'; document.getElementById(quotebox).style.left=quoteboxleft+'px'; document.getElementById(quoteboxt).style.top=quoteboxttop+'px'; document.getElementById(quoteboxt).style.left=quoteboxtleft+'px'; document.getElementById(quoteboxt).innerHTML=thequote; timeoutsquote = window.setTimeout("hideQuote('"+obj+"');", 6000); } function hideQuote(obj) { document.getElementById(quotebox).style.top='300px'; document.getElementById(quotebox).style.left='1px'; document.getElementById(quoteboxt).style.top='300px'; document.getElementById(quoteboxt).style.left='1px'; document.getElementById(quoteboxt).innerHTML=''; if (killcommand=="no") goDown(obj); } function showOnePop(obj) { if (loadgo=="yes"){ killcommand = "yes"; document.getElementById(quotebox).style.top='300px'; document.getElementById(quotebox).style.left='1px'; document.getElementById(quoteboxt).style.top='300px'; document.getElementById(quoteboxt).style.left='1px'; document.getElementById(quoteboxt).innerHTML=''; document.getElementById(getobj).style.top='250px'; getVariables(obj); document.getElementById(getobj).style.top='1px'; showQuote(getobj); } } function backToAll() { if (loadgo=="yes"){ document.getElementById(quotebox).style.top='300px'; document.getElementById(quotebox).style.left='1px'; document.getElementById(quoteboxt).style.top='300px'; document.getElementById(quoteboxt).style.left='1px'; document.getElementById(quoteboxt).innerHTML=''; document.getElementById(getobj).style.top='250px'; killcommand = "no"; getRandomPop(); } } function getRandomPop() { if (killcommand=="no"){ loadgo = "yes"; getVariables(); goUp(getobj); } } function getVariables(thefixobj) { clearTimeout(timeoutup); clearTimeout(timeoutdown); clearTimeout(timeoutgorandom); clearTimeout(timeoutsquote); getpos=250; getobj=''; getrandomp=0; getrandomq=0; thequote=''; quotesarr=''; quotebox=''; quoteboxt=''; quoteboxtop=1; quoteboxleft=1; quoteboxttop=12; quoteboxtleft=6; do{ getrandomp=Math.ceil(Math.random()*7); } while (lastpop==getrandomp); lastpop=getrandomp; if (parseInt(thefixobj)!="NaN"&&parseInt(thefixobj)>0) getrandomp=thefixobj; if (getrandomp==1){ getobj = 'headerpopsR'; quoteboxleft = 328; }else if (getrandomp==2){ getobj = 'headerpopsC'; quoteboxleft = 75; }else if (getrandomp==3){ getobj = 'headerpopsJ'; quoteboxleft = 289; }else if (getrandomp==4){ getobj = 'headerpopsA'; quoteboxleft = 201; }else if (getrandomp==5){ getobj = 'headerpopsH'; quoteboxleft = 403; }else if (getrandomp==6){ getobj = 'headerpopsD'; quoteboxleft = 489; }else{ getobj = 'headerpopsCL'; quoteboxleft = 274; } quoteboxtleft = parseInt(quoteboxleft)+12; quotebox='headerpopsQL'; quoteboxt='headerpopsQLtext'; if (getobj=='headerpopsR'||getobj=='headerpopsCL'){ quotebox='headerpopsQR'; quoteboxt='headerpopsQRtext'; } } function getRandomQuote(obj){ if (obj=='headerpopsR'){ quotesarr=new Array( "", "I'm R!", "Kick Buttowski.", "Hello, World!", "OUCH! I hurt myself...again!", "Really? REALLY?!", "Basically.", "OMG!", "Stupid dogs!" ); }else if (obj=='headerpopsC'){ quotesarr=new Array( "", "I'm C!", "I like to cook weird food.", "I need a haircut.", "My dog is cooler than your dog.", "Did you know...?", "I'm not sure." ); }else if (obj=='headerpopsJ'){ quotesarr=new Array( "", "I'm J!", "Can I have a burrito for dinner?", "Do you like swimming in my sea of awesomeness?", "I look like barf.", "This is the best burrito ever.", "Leroy Jenkins!", "I rock at CoD.", "Shazam!" ); }else if (obj=='headerpopsA'){ quotesarr=new Array( "", "I'm A!", "I'm a game addict.", "I beat Zelda in 4 minutes.", "Literately.", "Can I play my DSi?", "*sniff*", "Can I play RE5?" ); }else if (obj=='headerpopsH'){ quotesarr=new Array( "", "I'm H!", "Power Rangers rock!", "Can we go to Target?", "Polka dot face!", "I'm hungry.", "Can we make cookies?", "Can I have a penny?" ); }else if (obj=='headerpopsD'){ quotesarr=new Array( "", "I'm D!", "I like Lady Gaga.", "Lah? Lah?", "Me game? Me game?", "Mulk?", "Man now? Man now?", "Peas, Mama?" ); }else{ quotesarr=new Array( "", "I'm CL!", "Welcome to my site!", "Ugh! Those kids.", "Enjoy the site!", "I need another Michael Kors purse.", "Can I get another BFG game?", "Can you make me another CD?" ); } getrandomq=Math.floor( Math.random() * quotesarr.length ); if (getrandomq < 1) getrandomq=1; return quotesarr[getrandomq]; } function addAccordian() { //ACCORDION BUTTON ACTION $('div.accordionButton').click(function() { // $('div.accordionContent').slideUp('normal'); $(this).next().slideToggle('normal'); }); //HIDE THE DIVS ON PAGE LOAD $("div.accordionContent").hide(); } $(document).ready(function(){ $.preloadCssImages(); }); function addEvent( obj, type, fn ) { if (obj.addEventListener) obj.addEventListener( type, fn, false ); else if (obj.attachEvent) { obj["e"+type+fn] = fn; obj[type+fn] = function() { obj["e"+type+fn]( window.event ); } obj.attachEvent( "on"+type, obj[type+fn] ); } } function removeEvent( obj, type, fn ) { if (obj.removeEventListener) obj.removeEventListener( type, fn, false ); else if (obj.detachEvent) { obj.detachEvent( "on"+type, obj[type+fn] ); obj[type+fn] = null; obj["e"+type+fn] = null; } } addEvent(window, 'load', getRandomPop); addEvent(window, 'load', addAccordian);