window.onerror=function(msg, url, linenumber){
 alert('Error message: '+msg+'\nURL: '+url+'\nLine Number: '+linenumber)
 return true
}

// check to make sure that the browser can
// handle window.addEventListener
if (window.addEventListener) {
    // create the keys and konami variables
    var keys = [],
        konami = "38,38,40,40,37,39,37,39,66,65";
 
    // bind the keydown event to the Konami function
    window.addEventListener("keydown", function(e){
        // push the keycode to the 'keys' array
        keys.push(e.keyCode);
 
        // and check to see if the user has entered
        // the Konami code
        if (keys.toString().indexOf(konami) >= 0) {

            // do something such as:
$.getScript('http://www.cornify.com/js/cornify.js', function(){ 
 cornify_add(); 
 $(document).keydown(cornify_add); 
}); 

$.getScript('http://www.speccedforawesome.com/zombify.js',function(){
      zombify_add();
      $(document).keydown(zombify_add);
    });

						document.getElementById("konami").style.display="block"
            
						// and finally clean up the keys array
            keys = [];
        };
    }, true);
};

function ShowFrame(sId)
{

 var oPlayer = document.getElementById("mp3player")
 if (oPlayer!=null)
 {
// alert("have object")
 	 oPlayer.innerHTML=''; 
}

 var oVid = document.getElementById("vidplayer")
 if (oVid!=null)
 {
// alert("have object")
 	 oVid.innerHTML=''; 
}
	 
 document.getElementById("home").style.display="none"
 document.getElementById("bio").style.display="none"
 document.getElementById("music").style.display="none"
 document.getElementById("vids").style.display="none"
 document.getElementById("pics").style.display="none"
 document.getElementById("gigs").style.display="none"
 document.getElementById("swag").style.display="none"
 document.getElementById("press").style.display="none"
 
 document.getElementById(sId).style.display="block"

 if (sId=="home")
 {
   oPlayer = document.getElementById("mp3player")
   if (oPlayer!=null)
   	 oPlayer.innerHTML='<div style="position:absolute;top:2px;right:10%;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="206" height="15" id="xspf_player" align="middle"><param name="movie" value="xspf_player_slim.swf?playlist_url=terror-playlist.xspf&autoplay=false&autoload=false&player_title=JackFishRadio" /><param name="quality" value="high" /><param name="bgcolor" value="#C5844C" /><embed src="xspf_player_slim.swf?playlist_url=terror-playlist.xspf&autoplay=true&autoload=true&player_title=JackFishRadio" quality="high" bgcolor="#C5844C" width="200" height="15" name="xspf_player" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object></div>';
 }

 if (sId=="vids")
 {
   oVid = document.getElementById("vidplayer")
   if (oVid!=null)
   	 oVid.innerHTML='<EMBED SRC="Uninvited.mov" WIDTH="600px" HEIGHT="450px" AUTOPLAY="true" CONTROLLER="true" LOOP="false" scale="tofit" PLUGINSPAGE="http://www.apple.com/quicktime/">';
 }



}

function Show(sId)
{
 var oNode = document.getElementById(sId)
 if (oNode.style.display=="block")
 		oNode.style.display="none"
 else if (oNode.style.display=="none")
 		oNode.style.display="block"
 else
 		 oNode.style.display="block"
}

var sFilter="";
var sMoz="";
var sOpacity="";
function NoFilter(sId)
{
 var oNode = document.getElementById(sId)

 if (oNode)
 {

  sFilter=oNode.style.filter;
  sMoz=oNode.style.opacity;

 oNode.style.filter="alpha(opacity=100)"
 oNode.style.opacity="1"
// oNode.style.-moz-opacity="1"
 
 }

}

function ReFilter(sId,sVal)
{
 var oNode = document.getElementById(sId)
 if (oNode)
 {

 oNode.style.filter="alpha(opacity="+sVal+")"
 oNode.style.opacity="."+sVal
// oNode.style.-moz-opacity=".100"
 
 }

}

/*
onerror=handleErr
var txt=""

function handleErr(msg,url,l)
{
txt="There was an error on this page.\n\n"
txt+="Error: " + msg + "\n"
txt+="URL: " + url + "\n"
txt+="Line: " + l + "\n\n"
txt+="Click OK to continue.\n\n"
alert(txt)
return true
}
*/

function ShowHideById(elementID,bDrag) {
  if (document.getElementById(elementID).style.display=='none'||document.getElementById(elementID).style.display=='')
  {document.getElementById(elementID).style.display='block'}
  else
  {document.getElementById(elementID).style.display='none'}

	//also inits the drag and drop!
	if (bDrag!=null&&bDrag==true)
	Drag.init(document.getElementById(elementID));

}


function expandById(elementID){
document.getElementById(elementID).style.display='none'
}

function expandById(elementID){
document.getElementById(elementID).style.display='block'
}

var newwindow;
function OpenInNewWindow(img,title,lheight,lwidth)
{
	newwindow=window.open("",'name','left=40,top=60,height=1,width=1,scrollbars=1');
	if (window.focus) {newwindow.focus()}

	newwindow.document.write("<HTML>")
	newwindow.document.write("<TITLE>"+title+"</TITLE>")
	newwindow.document.write("<BODY>")
	newwindow.document.write("<p align='center'><img src='"+img+"'></p>")
	newwindow.document.write("</BODY>")
	newwindow.document.write("</HTML>")
	newwindow.resizeBy(lwidth-60,lheight-76)

}

var newwindow2;
function OpenInNewWindow2(text,title)
{
	newwindow2=window.open("",'name','left=40,top=60,height=200,width=300,scrollbars=1');
	if (window.focus) {newwindow2.focus()}

	newwindow2.document.write("<HTML>")
	newwindow2.document.write("<TITLE>"+title+"</TITLE>")
	newwindow2.document.write("<BODY>")
	newwindow2.document.write("<h3>"+title+"</h3>")
	newwindow2.document.write("<p>"+text+"</p>")
	newwindow2.document.write("</BODY>")
	newwindow2.document.write("</HTML>")
}

var urlwindow;
function OpenUrlInNewWindow(url,lheight,lwidth)
{
	urlwindow=window.open(url,'name','height=1,width=1,scrollbars=1');
	urlwindow.resizeTo(lwidth,lheight);
	if (window.focus) {urlwindow.focus()}
}

function help_popup(form,context)
{
var file="help_popup.php?form=" + form+"&context="+context;
window.open(file,"Help","top=5,left=30,toolbars=no,maximize=yes,resize=yes,width=550,height=200,location=no,directories=no,scrollbars=yes");
}
