/*
*	Programmed By: Ignition Interactive , 2010
*	Site requires: jQuery
*/

function getWindowLocation( value )
{
	thisMovie("flashContent").getWindowLocation( value );
}

function focusHandler()
{
	if( thisMovie("flashContent").focusHandler )
	{
		thisMovie("flashContent").focusHandler();
	}
}

function blurHandler()
{
	if( thisMovie("flashContent").blurHandler )
	{
		thisMovie("flashContent").blurHandler();
	}
}

function callShare()
{
	var str = String(window.location);
	getWindowLocation( str.replace( "#", "%23" ) );
}

function thisMovie(movieName) 
{
	 if (navigator.appName.indexOf("Microsoft") != -1) 
	 {
		 return window[movieName];
	 } else {
		 return document[movieName];
	 }
}

function actionTag( value )
{
	var targ;
	switch( value )
	{
		case "home":
			targ="http://view.atdmt.com/jaction/mlaset_DriveAngryHome_1";
		break;
		case "videos":
			targ="http://view.atdmt.com/jaction/mlaset_DriveAngryVideos_1";
		break;
		case "characters":
			targ = "http://view.atdmt.com/jaction/mlaset_DriveAngryCharacters_1";
		break;
		case "gallery":
			targ= "http://view.atdmt.com/jaction/mlaset_DriveAngryGallery_1";
		break;
		case "story":
			targ= "http://view.atdmt.com/jaction/mlaset_DriveAngryStory_1";
		break;
		
		case "Piper":
			targ ="http://view.atdmt.com/jaction/mlaset_DriveAngryCharactersPiper_1";
		break;
		case "Jonah":
			targ ="http://view.atdmt.com/jaction/mlaset_DriveAngryCharactersJonah_1";
		break;
		case "Accountant":
			targ ="http://view.atdmt.com/jaction/mlaset_DriveAngryCharactersAccountant_1";
		break;
		case "Milton":
			targ ="http://view.atdmt.com/jaction/mlaset_DriveAngryCharactersMilton_1";
		break;
		
		case "facebook":
			targ="http://view.atdmt.com/jaction/mlaset_DriveAngrySocialFacebook_1";
		break;
		case "youtube":
			targ="http://view.atdmt.com/jaction/mlaset_DriveAngrySocialYouTube_1";
		break;
	}
	//alert( targ );
	document.getElementById('actionTag').src = targ;
}

function moveLike(mvTop, mvLeft) 
{
	var obj = document.getElementById('likeButtonFrame')
		obj.style.position = "absolute";
		obj.style.top = mvTop;
		obj.style.left = mvLeft;
}
	
function moveTweetBtn(mvTop, mvLeft) 
{
	var obj = document.getElementById('tweetButtonFrame')
		obj.style.position = "absolute";
		obj.style.top = mvTop;
		obj.style.left = mvLeft;
}

function showLike() 
{
	document.getElementById("likeButtonFrame").style.visibility = "visible";
}

function hideLike()
{
	document.getElementById("likeButtonFrame").style.visibility = "hidden";
}
	
function showTweet()
{
	document.getElementById("tweetButtonFrame").style.visibility = "visible";
}
	
function hideTweet()
{
	document.getElementById("tweetButtonFrame").style.visibility = "hidden";
}


/*SET FLASH OBJECT USING SWFOBJECT*/
var flashvars = 
{
	swfPath: "Main.swf"
};

var params = {
	allowScriptAccess	: "always",
	bgcolor				: "#000000",
	allowfullscreen 	: "true",
	scale				: "noscale",
	wmode				: "transparent",
	base				: "swf/",
	quality				: "high"
};

var attributes = {
	id: 	"flashContent",
	name: 	"flashContent"
};

if( navigator.appName == 'Microsoft Internet Explorer' ) //Detect if this is IE
{
	document.onfocusin = focusHandler;
	document.onfocusout = blurHandler;
} else
{	
	window.onfocus = focusHandler;
	window.onblur = blurHandler;
}

swfobject.embedSWF("swf/loader.swf", "flashContent", "100%", "100%", "10.0.0", "swf/expressinstall.swf", flashvars, params, attributes);
swffit.fit("flashContent", "1000","780" );
