//programmed deeplinks: video, about, more
//deeplink variable: dl

//title numbers:
//1: villain files
//2: sitch in time
//3: secret files
//4: movie: so the drama

//detect for netscape 4.x
if (!document.getElementById)top.location.replace("http://disney.go.com/home/html/index.html");

//find query attached
var pageLoc = String(document.location);
var queryPos = pageLoc.indexOf("?");
var queryString = (queryPos < 0) ? "" : pageLoc.substring(queryPos);

//flash detect
var MM_contentVersion = 6;
	var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
	var FlashMode = "";
	
	if ( plugin ) {
			var words = navigator.plugins["Shockwave Flash"].description.split(" ");
		    for (var i = 0; i < words.length; ++i)
		    {
			if (isNaN(parseInt(words[i])))
			continue;
			var MM_PluginVersion = words[i]; 
		    }
		var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
	}
	else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
	   && (navigator.appVersion.indexOf("Win") != -1)) {
		document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
		document.write('on error resume next \n');
		document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
		document.write('</SCR' + 'IPT\> \n');
	}

//popup
function popup( url, w, h, windowName, r, s ) {
	win = window.open(url, windowName, 'height=' +h+ ', width=' +w+ ', resizable=' +r+ ', status=no, scrollbars=' +s+ ', location=no, menubar=no, toolbar=no, left=50, top=50');
}

//START HBX REFERENCES--------------------------------------------------------------------------------

//exit links
exitLink = new Array();
exitLink[0] = escape("Exit_kim+possible_multimedia_dvp_trailer+villain+files");//trailer - villain files
exitLink[1] = escape("Exit_kim+possible_multimedia_dvp_trailer+sitch");//trailer - sitch in time
exitLink[2] = escape("Exit_kim+possible_multimedia_dvp_trailer+secret+files");//trailer - secret files
exitLink[3] = escape("Exit_kim+possible_multimedia_dvp_trailer+so+drama");//trailer - so the drama
exitLink[4] = escape("Exit_kim+possible_multimedia_dvp_mvideo+so+drama");//music video
exitLink[5] = escape("Exit_kim+possible_multimedia_dvp_clip+christy");//ccr interview
exitLink[6] = escape("Exit_kim+possible_multimedia_dvp_clip+deleted+scene");//deleted scene

exitLink[7] = escape("Exit_kim+possible_sell+movies_dvp_order+villain+files");//order - villain files
exitLink[8] = escape("Exit_kim+possible_sell+movies_dvp_order+sitch");//order - sitch in time
exitLink[9] = escape("Exit_kim+possible_sell+movies_dvp_order+secret+files");//order - secret files
exitLink[10] = escape("Exit_kim+possible_sell+movies_dvp_order+so+drama");//order - so the drama

exitLink[11] = escape("Exit_kim+possible_tracking_dvp_details+villain+files");//details - villain files
exitLink[12] = escape("Exit_kim+possible_tracking_dvp_details+sitch");//details - sitch in time
exitLink[13] = escape("Exit_kim+possible_tracking_dvp_details+secret+files");//details - secret files

exitLink[14] = escape("Exit_kim+possible_synergy_dvp_disney+channel");//disney channel
exitLink[15] = escape("Exit_kim+possible_synergy_dvp_radio+disney");//radio disney
exitLink[16] = escape("Exit_kim+possible_synergy_dvp_walt+disney+records");//walt disney records
exitLink[17] = escape("Exit_kim+possible_synergy_dvp_cinemagna+comics");//cinemagna comics
exitLink[18] = escape("Exit_kim+possible_tokenzone_dvp");//tokenzone trading cards

//flash tracking - mlc's (corresponds with flashLinkPN array)
flashLinkMLC = new Array();
flashLinkMLC[0] = escape("/kim+possible/generate+awareness/information/about;/generate+awareness/information/dvp/kim+possible/about");
flashLinkMLC[1] = escape("/kim+possible/generate+awareness/information/story;/generate+awareness/information/dvp/kim+possible/story");
flashLinkMLC[2] = escape("/kim+possible/generate+awareness/information/bonus+features;/generate+awareness/information/dvp/kim+possible/bonus+features");
flashLinkMLC[3] = escape("/kim+possible/generate+awareness/multimedia;/generate+awareness/multimedia/dvp/kim+possible");
flashLinkMLC[4] = escape("/kim+possible/generate+awareness/information/about;/generate+awareness/information/dvp/kim+possible/about");

//flash tracking - pn's (corresponds with flashLinkMLC array)
flashLinkPN = new Array();
flashLinkPN[0] = escape("about");
flashLinkPN[1] = escape("story");
flashLinkPN[2] = escape("features");
flashLinkPN[3] = escape("clips+main");
flashLinkPN[4] = escape("more+titles");

//END HBX REFERENCES--------------------------------------------------------------------------------

//view trailer - pass me the number
function popTrailer(number){
	switch(number){
		case 1: //villain files trailer
			popup('http://www.totaleclips.com/player/splash.aspx?custid=3&playerid=2&clipid=e22202', 360, 480, 'trailer', 'no', 'no');
			hitbox.Set_hbExitLink(exitLink[0]);
			break;
		case 2: //sitch in time trailer
			popup('http://www.totaleclips.com/player/splash.aspx?custid=3&playerid=2&clipid=e19331', 360, 480, 'trailer', 'no', 'no');
			hitbox.Set_hbExitLink(exitLink[1]);
			break;
		case 3: //secret files trailer
			popup('http://www.totaleclips.com/player/splash.aspx?custid=3&playerid=2&clipid=e18059', 360, 480, 'trailer', 'no', 'no');
			hitbox.Set_hbExitLink(exitLink[2]);
			break;
		case 4: //so the drama trailer
			popup('http://www.totaleclips.com/player/splash.aspx?custid=3&playerid=2&clipid=e23537', 360, 480, 'trailer', 'no', 'no');
			hitbox.Set_hbExitLink(exitLink[3]);
			break;
		case 5: //music video
			popup('http://www.totaleclips.com/player/splash.aspx?custid=3&playerid=2&clipid=e23679', 360, 480, 'trailer', 'no', 'no');
			hitbox.Set_hbExitLink(exitLink[4]);
			break;
		case 6: //CCR interview clip
			popup('http://www.totaleclips.com/player/splash.aspx?custid=3&playerid=2&clipid=e23579', 360, 480, 'trailer', 'no', 'no');
			hitbox.Set_hbExitLink(exitLink[5]);
			break;
		case 7: //deleted scene clip
			popup('http://www.totaleclips.com/player/splash.aspx?custid=3&playerid=2&clipid=e23582', 360, 480, 'trailer', 'no', 'no');
			hitbox.Set_hbExitLink(exitLink[6]);
			break;
		default:
			break;
	}
}

//order now link - pass me the volume number
//****  NOTE  ****:
//if you are linking to tdso, use:
//window.open('your page link.html');
//if you are linking to a call to order popoup, use:
//popup('your page link.html', 390, 300, 'calltoorder', 'no', 'no');
function orderNow(number){
	switch(number){
		case 1: //villain files
			window.open('http://go-disneystore.com/kimpossiblethevillainfilesdvd');
			hitbox.Set_hbExitLink(exitLink[7]);
			break;
		case 2: //sitch in time
			window.open('http://go-disneystore.com/kimpossible-astitchintimedvd');
			hitbox.Set_hbExitLink(exitLink[8]);
			break;
		case 3: //secret files
			window.open('http://go-disneystore.com/kimpossiblethesecretfilesdvd');
			hitbox.Set_hbExitLink(exitLink[9]);
			break;
		case 4: //movie: so the drama
			//popup('http://disneyvideos.disney.go.com/moviefinder/calltoorder.html', 390, 300, 'calltoorder', 'no', 'no');
			window.open('http://www.go-disneydirect.com/kimpossiblesothedramadvd');
			hitbox.Set_hbExitLink(exitLink[10]);
			break;
		default:
			break;
	}
}

function movieDetails(number){
	switch(number){
		case 1: //villain files
			window.open('http://disneyvideos.disney.go.com/moviefinder/products/3752303.html');
			hitbox.Set_hbExitLink(exitLink[11]);
			break;
		case 2: //sitch in time
			window.open('http://disneyvideos.disney.go.com/moviefinder/products/3505903.html');
			hitbox.Set_hbExitLink(exitLink[12]);
			break;
		case 3: //secret files
			window.open('http://disneyvideos.disney.go.com/moviefinder/products/3120703.html');
			hitbox.Set_hbExitLink(exitLink[13]);
			break;
		default:
			break;
	}
}

function synergyLink(page){
	switch(page){
		case 'dc': //disney channel link
			//window.open('http://transfer.go.com/cgi/transfer.dll?srvc=dis&goto=http://psc.disney.go.com/disneychannel/kimpossible/index.html&name=dc_kp_disneyvideos'); //new window
			location.href='http://transfer.go.com/cgi/transfer.dll?srvc=dis&goto=http://psc.disney.go.com/disneychannel/kimpossible/index.html&name=dc_kp_disneyvideos'; //same window
			hitbox.Set_hbExitLink(exitLink[14]);
			break;
		case 'dc_NF': //disney channel link
			//window.open('http://transfer.go.com/cgi/transfer.dll?srvc=dis&goto=http://psc.disney.go.com/disneychannel/kimpossible/index.html&name=dc_kp_disneyvideos'); //new window
			UpgradeFlash('','','http://transfer.go.com/cgi/transfer.dll?srvc=dis&goto=http://psc.disney.go.com/disneychannel/kimpossible/index.html&name=dc_kp_disneyvideos'); //GETFLASH
			hitbox.Set_hbExitLink(exitLink[14]);
			break;			
		case 'rd': //radio disney link
			//window.open('http://radio.disney.go.com/contactus/request.html'); //new window
			location.href='http://radio.disney.go.com/contactus/request.html'; //same window
			hitbox.Set_hbExitLink(exitLink[15]);
			break;
		case 'rd_NF': //radio disney link
			//window.open('http://radio.disney.go.com/contactus/request.html'); //new window
			UpgradeFlash('','','http://radio.disney.go.com/contactus/request.html'); //GETFLASH
			hitbox.Set_hbExitLink(exitLink[15]);
			break;			
		case 'wdr': //soundtrack link
			//window.open('http://disney.go.com/disneyrecords/Soundtracks/kimpossible/index.html'); //new window
			location.href='http://disney.go.com/disneyrecords/Soundtracks/kimpossible/index.html'; //same window
			hitbox.Set_hbExitLink(exitLink[16]);
			break;
		case 'wdr_NF': //soundtrack link
			//window.open('http://disney.go.com/disneyrecords/Soundtracks/kimpossible/index.html'); //new window
			UpgradeFlash('','','http://disney.go.com/disneyrecords/Soundtracks/kimpossible/index.html'); //GETFLASH
			hitbox.Set_hbExitLink(exitLink[16]);
			break;			
		case 'comic': //books link
			//window.open('http://tokyopop.com/dbpage.php?propertycode=KIM&categorycode=BCM'); //new window
			//location.href='http://tokyopop.com/dbpage.php?propertycode=KIM&categorycode=BCM'; //same window
			openDisclaimer('http://tokyopop.com/dbpage.php?propertycode=KIM&categorycode=BCM');
			hitbox.Set_hbExitLink(exitLink[17]);
			break;
		case 'trading': //trading cards link
			window.open('http://apsc.disney.go.com/disneychannel/kimpossible/games/tradingcards/index.html'); //new window
			//location.href='http://apsc.disney.go.com/disneychannel/kimpossible/games/tradingcards/index.html'; //same window
			hitbox.Set_hbExitLink(exitLink[18]);
			break;
		case 'dcom': //dcom
			//window.open('http://www.DCOM-DVD.com'); //new window
			window.open('http://disney.go.com/disneyvideos/television/disneychanneloriginalmovies/'); //new window
			//location.href='http://www.DCOM-DVD.com'; //same window
		default:
			break;
	}
}