/*****************************************
* Open links in new window Script- By spk100 (spk100@yahoo.com)
* Script featured on/available at Dynamic Drive- http://www.dynamicdrive.com/
* Modified by DD. This notice must stay intact for use
*
* Modified by Jason Spieth
*****************************************/

/****************************************
* Name			hyperlinks
*
* Description	Processes each link on the
*               given page.  Links that go
*               offsite open in new windows
*
* Input			n/a
* Output		n/a
****************************************/
function hyperlinks()
{
    //set the location for a new window
	where = "_blank";
    var relTemp;
    
    // process each link on the page
	for (var i=0; i<=(document.links.length-1); i++)
	{
		// Check each link.  If the link is in our domain
		// or if the link is not an http link, open it in
		// the current window.  On the comparison operators
		// a value of -1 indicates not found
		if ( ((document.links[i].hostname.indexOf("swactionnews.com") == -1) ||
		      (document.links[i].href.indexOf("swactionnews.com")     == -1) )
		      &&
		      (document.links[i].href.indexOf("http:") != -1)
		   )
	    {
          document.links[i].target = "_blank"	    
	    }
	    else
	    {
          document.links[i].target = "_self"	    	    
	    }
	}
}

window.onload=hyperlinks


// on and off image buttons
play_off = new Image()
enhc_off = new Image()
vote_off = new Image()
digg_off = new Image()
iTns_off = new Image()
read_off = new Image()

play_on = new Image()
enhc_on = new Image()
vote_on = new Image()
digg_on = new Image()
iTns_on = new Image()
read_on = new Image()

m_play_off = new Image()
m_enhc_off = new Image()
m_play_on = new Image()
m_enhc_on = new Image()

// load images source
play_off.src = "http://www.swactionnews.com/images/common/buttons/play.gif"
enhc_off.src = "http://www.swactionnews.com/images/common/buttons/playenhanced.gif"
vote_off.src = "http://www.swactionnews.com/images/common/buttons/vote.gif"
digg_off.src = "http://www.swactionnews.com/images/common/buttons/digg.gif"
iTns_off.src = "http://www.swactionnews.com/images/common/buttons/itunes.gif"
read_off.src = "http://www.swactionnews.com/images/common/buttons/read.gif"

play_on.src  = "http://www.swactionnews.com/images/common/buttons/play_on.gif"
enhc_on.src  = "http://www.swactionnews.com/images/common/buttons/playenhanced_on.gif"
vote_on.src  = "http://www.swactionnews.com/images/common/buttons/vote_on.gif"
digg_on.src  = "http://www.swactionnews.com/images/common/buttons/digg_on.gif"
iTns_on.src  = "http://www.swactionnews.com/images/common/buttons/itunes_on.gif"
read_on.src  = "http://www.swactionnews.com/images/common/buttons/read_on.gif"

m_play_off.src = "http://www.swactionnews.com/images/common/buttons/play.gif"
m_enhc_off.src = "http://www.swactionnews.com/images/common/buttons/playenhanced.gif"
m_play_on.src  = "http://www.swactionnews.com/images/common/buttons/play_on.gif"
m_enhc_on.src  = "http://www.swactionnews.com/images/common/buttons/playenhanced_on.gif"

// turn button on
function ActiveButton(imgName)  
{
imgOn = eval(imgName + "_on.src");
document[imgName].src = imgOn;
}  

// turn button off
function InactiveButton(imgName) 
{
imgOff = eval(imgName + "_off.src");
document[imgName].src = imgOff;
} 


