function openVideo() {
// Change "_blank" to something like "newWindow" to load all links in the same new window
var newWindow = window.open('http://www.youtube.com/watch?v=hXbGBk5pVrI', 'video');
var newWindow2 = window.open('off.html', 'music');
newWindow2.blur();
document.marquee1.text.value = CD211
newWindow.focus();
return false;
}

function setbkbg() {
thisCookie = document.cookie.split("; ");
var cookieFound = "0";
for (i=0; i<thisCookie.length; i++) {
   if (thisCookie[i].split("=")[0] == "bkgd") {
        var bkgd = thisCookie[i].split("=")[1];
        cellImg("maintable",bkgd);
        cookieFound = "1";
          }
   }
   if (cookieFound == "0") {
    cellImg("maintable","images2/jjj_bg.jpg");
   }
}


var animateSpeed = 5; // Higher Number = Faster Animation
var object = null;
var fX = null; //Final x position
var fY = null; //Final y position
var cX = null; //Current x position
var cY = null; //Current y position
var dX = null;
var dY = null;
var stepX = null;
var stepY = null;
var slope = null;

function initAnimate(objectID,x,y) {
	object = document.getElementById(objectID);
	fX = x;
	fY = y;
	cX = object.offsetLeft;
	cY = object.offsetTop;
	dX = Math.abs(fX-cX);
	dY = Math.abs(fY-cY);
	if ((dX == 0) || (dY == 0)) slope = 0;
	else slope= dY/dX;
		if (dX>=dY) {
			if (cX<fX) stepX =  animateSpeed;
			else if (cX>fX) stepX = - animateSpeed;
			if (cY<fY) stepY = animateSpeed*slope;
			else if (cY>fY) stepY =  -animateSpeed*slope;
		}
		else if (dX<dY)  {
			if (cY<fY) stepY= animateSpeed;
			else if (cY>fY) stepY=  - animateSpeed;
			if (cX<fX) stepX = animateSpeed/slope;
			else if (cX>fX) stepX =  -animateSpeed/slope;
		}
	animateObject()
}

function animateObject()  {
	if (( dX > 0  ) || (dY > 0)) {
		object.style.left = Math.round(cX) + 'px';
		object.style.top = Math.round(cY) + 'px';
		cX = cX + stepX;
		cY = cY + stepY;
		dX = dX - Math.abs(stepX);
		dY = dY - Math.abs(stepY);
		setTimeout ('animateObject()',0);
	}
  else {
	object.style.left = fX + 'px';
	object.style.top = fY + 'px';
}
	return;
}

/***********************************************
* Pop-it menu- &#194;&#169; Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var defaultMenuWidth="180px" //set default menu width.
var CD301="             Now playing: BAD VOODOO from the Play That Damn Guitar CD...      "
var CD302="             Now playing: BLUES FOR THE DEVIL from the Play That Damn Guitar CD...      "
var CD303="             Now playing: PLAY THAT DAMN GUITAR from the Play That Damn Guitar CD...      "
var CD304="             Now playing: HEAR NO EVIL from the Play That Damn Guitar CD...      "
var CD305="             Now playing: RATTLESNAKE STOMP from the Play That Damn Guitar CD...      "
var CD306="             Now playing: SALT OF THE EARTH from the Play That Damn Guitar CD...      "
var CD307="             Now playing: SIX STRING ANGEL from the Play That Damn Guitar CD...      "
var CD101="             Now playing: CRADLE TO THE GRAVE from the I\' ve Got an Ax to Grind CD...      "
var CD102="             Now playing: IT AIN\' T EASY from the I\' ve Got an Ax to Grind CD...     "
var CD103="             Now playing: SITTIN\'  BY THE RIVERSIDE from the I\' ve Got an Ax to Grind CD...     "
var CD104="             Now playing: DEMONS from the I\' ve Got an Ax to Grind CD...      "
var CD105="             Now playing: I\' VE GOT AN AX TO GRIND from the I\' ve Got an Ax to Grind CD...     "
var CD106="             Now playing: SPELL OF WINTER from the I\' ve Got an Ax to Grind CD...      "

var CD201="             Now playing: STRANGE IMAGINATION from the Strange Imagination CD...     "
var CD202="             Now playing: CAN\' T GIVE UP ON LOVE from the Strange Imagination CD...       "
var CD203="             Now playing: WAIT\' N ON THE TRAIN from the Strange Imagination CD...      "
var CD204="             Now playing: WICKED LITTLE HEARTBREAKER from the Strange Imagination CD...      "
var CD205="             Now playing: ROCKIN TRAIN from the Strange Imagination CD...      "
var CD206="             Now playing: JUMP INTO THE FIRE from the Strange Imagination CD...      "
var CD207="             Now playing: LIBERTY from the Strange Imagination CD...      "
var CD208="             Now playing: RAINBOW from the Strange Imagination CD...      "
var CD209="             Now playing: LAURA LEE from the Strange Imagination CD...       "
var CD210="             Now playing: END OF THE DAY from the Strange Imagination CD...      "
var CD211="             Nothing is playing...are you ok?             Select a song and crank it up!       "

var linkset=new Array()
//SPECIFY MENU SETS AND THEIR LINKS. FOLLOW SYNTAX LAID OUT
// Now playing: STRANGE IMAGINATION from the Strange Imagination CD...
linkset[0]='<a href="jjj_badvoodoo.html" target="music" onclick="document.marquee1.text.value = CD301;">New! BAD VOODOO</a>'
linkset[0]+='<a href="jjj_blues4d.html" target="music" onclick="document.marquee1.text.value = CD302;">New! BLUES FOR THE DEVIL</a>'
linkset[0]+='<a href="jjj_damnguitar.html" target="music" onclick="document.marquee1.text.value = CD303;">New! PLAY THAT DAMN GUITAR</a>'
linkset[0]+='<a href="jjj_hearnoevil.html" target="music" onclick="document.marquee1.text.value = CD304;">New! HEAR NO EVIL</a>'
linkset[0]+='<a href="jjj_rattlesnakestomp.html" target="music" onclick="document.marquee1.text.value = CD305;">New! RATTLESNAKE STOMP</a>'
linkset[0]+='<a href="jjj_saltoftheearth.html" target="music" onclick="document.marquee1.text.value = CD306;">New! SALT OF THE EARTH</a>'
linkset[0]+='<a href="jjj_sixstringangel.html" target="music" onclick="document.marquee1.text.value = CD307;">New! SIX STRING ANGEL</a>'

linkset[0]+='<a href="jjj_cradle.html" target="music" onclick="document.marquee1.text.value = CD101;">CRADLE TO THE GRAVE</a>'
linkset[0]+='<a href="jjj_easy.html" target="music" onclick="document.marquee1.text.value = CD102;">IT AIN\' T EASY</a>'
linkset[0]+='<a href="jjj_river.html" target="music" onclick="document.marquee1.text.value = CD103;">SITTIN\'  BY THE RIVERSIDE</a>'
linkset[0]+='<a href="jjj_demons.html" target="music" onclick="document.marquee1.text.value = CD104;"><DEMONS></a>'
linkset[0]+='<a href="jjj_grind.html" target="music" onclick="document.marquee1.text.value = CD105;">I\' VE GOT AN AX TO GRIND</a>'
linkset[0]+='<a href="jjj_spell.html" target="music"onclick="document.marquee1.text.value = CD106;">SPELL OF WINTER</a>'
linkset[0]+='<a href="jjj_strangeimagination.html" target="music" onclick="document.marquee1.text.value = CD201;">STRANGE IMAGINATION</a>'
linkset[0]+='<a href="jjj_love.html" target="music" onclick="document.marquee1.text.value = CD202;">CAN\' T GIVE UP ON LOVE</a>'
linkset[0]+='<a href="jjj_waitn.html" target="music" onclick="document.marquee1.text.value = CD203;">WAIT\' N ON THE TRAIN</a>'
linkset[0]+='<a href="jjj_wicked.html" target="music" onclick="document.marquee1.text.value = CD204;">WICKED LITTLE HEARTBREAKER</a>'
linkset[0]+='<a href="jjj_rockin.html" target="music" onclick="document.marquee1.text.value = CD205;">ROCKIN TRAIN</a>'
linkset[0]+='<a href="jjj_jump.html" target="music" onclick="document.marquee1.text.value = CD206;">JUMP INTO THE FIRE</a>'
linkset[0]+='<a href="jjj_liberty.html" target="music" onclick="document.marquee1.text.value = CD207;">LIBERTY</a>'
linkset[0]+='<a href="jjj_rainbows.html" target="music" onclick="document.marquee1.text.value = CD208;">RAINBOW\' S END</a>'
linkset[0]+='<a href="jjj_laura.html" target="music" onclick="document.marquee1.text.value = CD209;">LAURA LEE</a>'
linkset[0]+='<a href="jjj_end.html" target="music" onclick="document.marquee1.text.value = CD210;">END OF THE DAY</a>'
linkset[0]+='<a href="off.html" target="music" onclick="document.marquee1.text.value = CD211;">(music off)</a>'

linkset[1]='<a href="jjj_home.html" target="content">Home</a>'
linkset[1]+='<a href="jjj_bio.html" target="content">Bio</a>'
linkset[1]+='<a href="jjj_contact.html" target="content">Contact Jay!</a>'
linkset[1]+='<a href="jjj_music.html" target="content">Current Releases</a>'
linkset[1]+='<a href="jjj_disc.html" target="content">Discography</a>'
linkset[1]+='<a href="#" onclick="openVideo()">Music Video</a>'
//<a href="http://www.youtube.com/watch?v=hXbGBk5pVrI" target="video" height="200" width="200"></a><a href="off.html" target="music" onclick="document.marquee1.text.value = CD211;">Music Video on YouTube</a>'
linkset[1]+='<a href="javascript:cellImg(\'maintable\',\'images2/jjj_bg.jpg\');" >Change Background: Lightnin\' JJJ</a>'
linkset[1]+='<a href="javascript:cellImg(\'maintable\',\'images2/strangecover.jpg\');" >Change Background: Strange Imagination</a>'
linkset[1]+='<a href="javascript:cellImg(\'maintable\',\'images2/AxCover.jpg\');" >Change Background: ...an Ax to Grind</a>'


////No need to edit beyond here

var ie5=document.all && !window.opera
var ns6=document.getElementById

if (ie5||ns6)
document.write('<div id="popitmenu" onMouseover="clearhidemenu();" onMouseout="dynamichide(event)"></div>')

function iecompattest(){
return (document.compatMode && document.compatMode.indexOf("CSS")!=-1)? document.documentElement : document.body
}

function showmenu(e, which, optWidth){
if (!document.all&&!document.getElementById)
return
clearhidemenu()
menuobj=ie5? document.all.popitmenu : document.getElementById("popitmenu")
menuobj.innerHTML=which
menuobj.style.width=(typeof optWidth!="undefined")? optWidth : defaultMenuWidth
menuobj.contentwidth=menuobj.offsetWidth
menuobj.contentheight=menuobj.offsetHeight
eventX=ie5? event.clientX : e.clientX
eventY=ie5? event.clientY : e.clientY
//Find out how close the mouse is to the corner of the window
var rightedge=ie5? iecompattest().clientWidth-eventX : window.innerWidth-eventX
var bottomedge=ie5? iecompattest().clientHeight-eventY : window.innerHeight-eventY
//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<menuobj.contentwidth)
//move the horizontal position of the menu to the left by it's width
menuobj.style.left=ie5? iecompattest().scrollLeft+eventX-menuobj.contentwidth+"px" : window.pageXOffset+eventX-menuobj.contentwidth+"px"
else
//position the horizontal position of the menu where the mouse was clicked
menuobj.style.left=ie5? iecompattest().scrollLeft+eventX+"px" : window.pageXOffset+eventX+"px"
//same concept with the vertical position
if (bottomedge<menuobj.contentheight)
menuobj.style.top=ie5? iecompattest().scrollTop+eventY-menuobj.contentheight+"px" : window.pageYOffset+eventY-menuobj.contentheight+"px"
else
menuobj.style.top=ie5? iecompattest().scrollTop+event.clientY+"px" : window.pageYOffset+eventY+"px"
menuobj.style.visibility="visible"
return false
}

// Change the background
function cellImg(idCell,imgName) {
document.getElementById(idCell).style.background = "url(" + imgName + ")";
expireDate=new Date; expireDate.setMonth(expireDate.getMonth()+6);
document.cookie = "bkgd=" +imgName+";expires=" + expireDate.toGMTString();
} 

/*Text box  javascript="marquee.marquee by Dave Methvin,
Windows Magazine
May be used/modified if credit line is
retained*/
ScrollSpeed = 180
ScrollChars = 1

function ScrollMarquee() {
window.setTimeout('ScrollMarquee()',ScrollSpeed);
var msg = document.marquee1.text.value;
document.marquee1.text.value =
msg.substring(ScrollChars) +
msg.substring(0,ScrollChars);
}

ScrollMarquee()

function contains_ns6(a, b) {
//Determines if 1 element in contained in another- by Brainjar.com
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function hidemenu(){
if (window.menuobj)
menuobj.style.visibility="hidden"
}

function dynamichide(e){
if (ie5&&!menuobj.contains(e.toElement))
hidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
hidemenu()
}

function delayhidemenu(){
delayhide=setTimeout("hidemenu()",500)
}

function clearhidemenu(){
if (window.delayhide)
clearTimeout(delayhide)
}

if (ie5||ns6)
document.onclick=hidemenu

function popitup(url,name) {
        newwindow=window.open(url,name,'height=400,width=800,scrollbars=yes');
	        if (window.focus) {newwindow.focus()}
		        return false;
			}

