/*
               ,'``.._   ,'``.
              :,--._:)\,:,._,.:       ALL GLORY TO
              :`--,''   :`...';\      THE HYPNOTOAD!
               `,'       `---'  `.
               /                 :
              /                   \
            ,'                     :\.___,-.
           `...,---'``````-..._    |:       \
             (                 )   ;:    )   \  _,-.
              `.              (   //          `'    \
               :               `.//  )      )     , ;
             ,-|`.            _,'/       )    ) ,' ,'
            (  :`.`-..____..=:.-':     .     _,' ,'
             `,'\ ``--....-)='    `._,  \  ,') _ '``._
          _.-/ _ `.       (_)      /     )' ; / \ \`-.'
         `--(   `-:`.     `' ___..'  _,-'   |/   `.)
             `-. `.`.``-----``--,  .'
               |/`.\`'        ,','); SSt
                   `         (/  (/

HYPNOTOAD ASCII Art by Sebastian St?cker :D
Thanks to http://r33b.net/ for hosting the flash. (totallly stolen from them)

** Site Logo/ Watermark Script- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com.
** Available/ usage terms at http://www.dynamicdrive.com
** v2.0 (April 19th, 09')
*/

var $ = {  		
				
	enabled: false,  
	tmp: Array(),  
	_konamiCode: Array(65,66,39,37,39,37,40,40,38,38),  
	
	init: function() {  
		this.tmp = Array(65,66,39,37,39,37,40,40,38,38);  
		
	},  
	
	konamiCode: function(e) {  
		if(!this.enabled) {  
			var t = this.tmp.pop();  
			if((e.keyCode-t) == 0) {  
				if(this.tmp.length == 0) {  
					this.enabled = true;  
				}  
			}  
			else {  
				this.init();  
			}  
		}  
		else {  
			this.cheat();  
		}  
	},  
   
	// Change the action() function to whatever you want to  
	cheat: function() {  
		this.enabled = false;
				
		var title = 'Hypnotoad Homepage'
		title = title + '		<div id="desc" class="desc">';
		title = title + '			All glory to the Hypnotoad!';
		title = title + '</div>';
		document.getElementById('title').innerHTML = title;
		
		if (document.body) {
			document.body.style.backgroundImage = 'url(http://static.writhem.com/images/hypnotoad.jpg)';
		}
		
		
		//** Site Logo/ Watermark Script- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com.
		//** Available/ usage terms at http://www.dynamicdrive.com
		//** v2.0 (April 19th, 09')


		var ddsitelogo={
			setting: {orientation:4, visibleduration:0, fadeduration:[1000, 500]}, //orientation=1|2|3|4, duration=millisec or 0, fadedurations=millisecs
			offsets: {x:10, y:10},//offset of logo relative to window corner
			logoHTML: '<a href="http://r33b.net/" title="All Glory to the Hypnotoad"><img src="http://static.writhem.com/images/hypnotoad.gif" style="width:474px; height:332px; border:0" /></a>     <object type="application/x-shockwave-flash" data="http://r33b.net/flash/straightlegit.swf" width="0" height="0" id="hypnotoad"><param name="movie" value="http://r33b.net/flash/straightlegit.swf"><param name="loop" value="true"><param name="quality" value="high"><param name="menu" value="false"></object>',

			coord: {},

			keepfixed:function(){
				if (!this.cssfixedsupport){
					var $window=jQuery(window)
					var is1or3=/^[13]$/.test(this.setting.orientation)
					var is1or2=/^[12]$/.test(this.setting.orientation)
					var x=$window.scrollLeft() + (is1or3? this.offsets.x : $window.width()-this.$control.width()-this.offsets.x)
					var y=$window.scrollTop() + (is1or2? this.offsets.y : $window.height()-this.$control.height()-this.offsets.y)
					this.$control.css({left:x+'px', top:y+'px'})
				}
			},

			showlogo:function(){
				var mainobj=ddsitelogo
				this.$control.animate({opacity:1}, this.setting.fadeduration[0])
				if (this.setting.visibleduration>0){
					setTimeout(function(){
						mainobj.$control.stop().animate({opacity:0}, mainobj.setting.fadeduration[1], function(){
							jQuery(window).unbind('scroll.fixed resize.fixed')
						})
					}, this.setting.visibleduration+this.setting.fadeduration[0])
				}
			},
			
			init:function(){
				jQuery(document).ready(function($){
					var mainobj=ddsitelogo
					var iebrws=document.all
					mainobj.cssfixedsupport=!iebrws || iebrws && document.compatMode=="CSS1Compat" && window.XMLHttpRequest //not IE or IE7+ browsers in standards mode
					if (mainobj.cssfixedsupport){
						mainobj.coord[(/^[13]$/.test(mainobj.setting.orientation))? 'left' : 'right']=mainobj.offsets.x
						mainobj.coord[(/^[12]$/.test(mainobj.setting.orientation))? 'top' : 'bottom']=mainobj.offsets.y
					}
					mainobj.$control=$('<div id="mysitelogo">'+mainobj.logoHTML+'</div>')
						.css({position:mainobj.cssfixedsupport? 'fixed' : 'absolute', opacity:0})
						.css(mainobj.coord)
						.appendTo('body')
					if (document.all && !window.XMLHttpRequest && mainobj.$control.text()!='') //loose check for IE6 and below, plus whether control contains any text
						mainobj.$control.css({width:mainobj.$control.width()}) //IE6- seems to require an explicit width on a DIV containing text
					mainobj.keepfixed()
					mainobj.showlogo()
					$(window).bind('scroll.fixed resize.fixed', function(){mainobj.keepfixed()})
				})
			}
		}

		ddsitelogo.init();
		scroll(0,0);
	}  
}  