argstring = window.location.search;

function Mediaplex(content) {
 	switch (content) {
			case "Coors_BG":
				var imagePing = "http://altfarm.mediaplex.com/ad/bk/3660-18372-2054-4?Home_Page=1&mpuid=";
 			break
			case "TheHookUp_BG.swf": 
				var imagePing = "http://altfarm.mediaplex.com/ad/bk/3660-18372-2054-6?The_Hook_Up=1&mpuid=";
 			break 	
			case "Beats_BG.swf": 
  				var imagePing = "http://altfarm.mediaplex.com/ad/bk/3660-18372-2054-2?Beats=1&mpuid=";
 			break			 
			case "NFL_BG.swf": 
  				var imagePing = "http://altfarm.mediaplex.com/ad/bk/3660-18372-2054-5?NFL=1&mpuid=";
 			break			
			case "Ads_BG.swf": 
  				var imagePing = "http://altfarm.mediaplex.com/ad/bk/3660-18372-2054-1?Ads=1&mpuid=";
 			break			
			case "Beer_BG.swf": 
  				var imagePing = "http://altfarm.mediaplex.com/ad/bk/3660-18372-2054-3?Beer=1&mpuid=";
 			break			
			case "Cold_BG.swf": 
  				var imagePing = "http://altfarm.mediaplex.com/ad/bk/3660-18372-2054-7?COLD=1&mpuid=";
 		 	break
	}
	//alert(imagePing);
	var doPing = new Image();
	doPing.src = imagePing;
}

function integergate() { // this is the actual ping to DART.  It is a basic image request.
 	var axel = Math.random()+"";
  	var a = axel * 1000000000000; 
	
	var imagePing = "http://ad.doubleclick.net/activity;src=813520;type=maxim946;cat=agech397;ord=1;num="+ a + "?";
	var doPing = new Image();
	//alert(imagePing);
	doPing.src = imagePing;
}

function popStream(thisUrl) {
 	screenwidth = screen.availWidth;
	screenheight = screen.availHeight;
	thisWidth = 600;
	thisHeight = 400;
	thisLeft = ((screenwidth - thisWidth)/2);
	thisTop = ((screenheight - thisHeight)/2);
	optionString = ('width=' + thisWidth + ',height=' + thisHeight + ',top=' + thisTop + ',left=' + thisLeft + ',status=no,menubar=no,resizable=no,scrollbars=yes,toolbar=no');
	window.open(thisUrl,'',optionString);
}

function framecheck() {
	/*
	var parentframe = 'index_frame.html';
	if (parent.location.href == self.location.href) {
		var current = window.self.location.pathname;
		window.location.replace (parentframe + '?' + current);
	}
	*/
}

function Pop(thisUrl) {
	screenwidth = screen.availWidth;
	screenheight = screen.availHeight;
	thisWidth = 500;
	thisHeight = 600;
	thisLeft = ((screenwidth - thisWidth)/2);
	thisTop = ((screenheight - thisHeight)/2);
	optionString = ('width=' + thisWidth + ',height=' + thisHeight + ',top=' + thisTop + ',left=' + thisLeft + ',status=no,menubar=no,resizable=no,scrollbars=yes,toolbar=no');
	window.open(thisUrl,'',optionString);
}

var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
 
function URLpop(myurl, mytarget) {
	if (mytarget == "self"){
		//open in the current window
		self.location.replace(myurl);
	}
	else {
		if(window.opener) {
			if((window.opener.closed)) {
				void(CL_Window=window.open(myurl,'CL_Window'));
				CL_Window.focus();
        	} else {
            	void(window.opener.location.replace(myurl));
            	window.opener.focus();
        	}
    	} else {
        	void(CL_Window=window.open(myurl,'CL_Window'));
        	CL_Window.focus();
    	}
	}
}

function modularWindow(thisUrl,thisWidth,thisHeight,thisTop,thisLeft,autocenter,status,menubar,resizable,scrollbars,toolbar) {
	screenwidth = screen.availWidth;
	screenheight = screen.availHeight;
	if (autocenter == "true") {
		thisLeft = ((screenwidth - thisWidth)/2);
		thisTop = ((screenheight - thisHeight)/2);
	}
	optionString = ('width='+thisWidth+',height='+thisHeight+',top='+thisTop+',left='+thisLeft+',status='+status+',menubar='+menubar+',resizable='+resizable+',scrollbars='+scrollbars+',toolbar='+toolbar);
	window.open(thisUrl,'',optionString);
}

function Coors_Main_DoFSCommand(command, args) {

	var myFlashBannerObj = InternetExplorer ? Coors_Main : document.Coors_Main;
  	//
  	// Place your code here.  For instance, this is where the 
  	// Ping to the DCLK spotlight tag would go.  Such as this:
 

	var swfCommand = new Array();
 	swfCommand[command] 				=  new Array("","");
	
	//rip page
	swfCommand["Coors_CBOX_Prelaunch"]	=  new Array("CL_com_CBOX_PreLaunch ", "");
	//age verification page
	swfCommand["Coors_Age_Capture"]		=  new Array("CL_com_Age_Capture", "");
	swfCommand["CL_com_Age_Capture_Decline"]		=  new Array("CL_com_Age_Capture_Decline", "");	
	swfCommand["Coors_Home"] 			=  new Array("CL_com_Homepage", "");
	swfCommand["Coors_CBOX_Interstital"]=  new Array("CL_com_CBOX_Interstitial", "")
	//clicked on Fox Sports ad
	swfCommand['FoxSportsClick']        =  new Array('CL_com_FSN_Promo_Homepage_Float', '');
	//FoxSports pod click
	swfCommand['FSPodClick']            =  new Array('CL_com_FSN_Promo_Homepage_Bottom_Nav', '');
	
	//ads home page
	swfCommand["Ads_BG"]	 			=  new Array("CL_com_Ads_Homepage", "");
	swfCommand["Ads_NFL_LoveTrain"]	 	=  new Array("CL_com_Ads_NFL_Love_Train", "");
	swfCommand["Ads_Plastic"]	 	    =  new Array("CL_com_Ads_Plastic", "");
		
	//beats home page
	swfCommand["Beats_BG"]   			=  new Array("CL_com_Beats_Homepage", "");
	//house of blues page
	swfCommand["Beats_HOB"]				=  new Array("CL_com_Beats_Concert_Partner", "");
	swfCommand["Beats_featured"]        =  new Array("CL_com_Beats_Featured_Artist", "");
	swfCommand["Beats_Partner_Signup"]  =  new Array("CL_com_Beats_Concert_Partner_Signup", "");

	//beer home page
	swfCommand["Beer_BG"]				=  new Array("CL_com_Beer_Homepage", "");
	swfCommand["Beer_Facts"]			=  new Array("CL_com_Beer_Facts", "");
	swfCommand["Beer_Facts_Mountains"]	=  new Array("CL_com_Beer_Facts_Mountains", "");
	swfCommand["Beer_Facts_Brewing"]	=  new Array("CL_com_Beer_Facts_Brewing", "");
	swfCommand["Beer_Facts_Icy"]		=  new Array("CL_com_Beer_Facts_Icy", "");
	swfCommand["Beer_Facts_Rail"]		=  new Array("CL_com_Beer_Facts_Rail", "");
	swfCommand["Beer_Facts_ToYou"]		=  new Array("CL_com_Beer_Facts_To_You", "");
	swfCommand["Beer_Facts_Fridge"]		=  new Array("CL_com_Beer_Facts_Fridge", "");
	swfCommand["Beer_Facts_Cold"]		=  new Array("CL_com_Beer_Facts_Cold", "");
	swfCommand["Beer_Facts_Refreshing"]	=  new Array("CL_com_Beer_Facts_Refreshing", "");
	swfCommand["Beer_Company"]	        =  new Array("CL_com_Beer_Company", "");
	swfCommand["Beer_History"]	        =  new Array("CL_com_Beer_History", "");
	swfCommand["Beer_Better_Brew"]	    =  new Array("CL_com_Beer_Better_Brew", "");
	swfCommand["Beer_Brew_101"]	        =  new Array("CL_com_Beer_Brew_101", "");
	swfCommand["Beer_Brew_101_Step1"]	=  new Array("CL_com_Beer_Brew_101_Step1", "");
	swfCommand["Beer_Brew_101_Step2"]	=  new Array("CL_com_Beer_Brew_101_Step2", "");
	swfCommand["Beer_Brew_101_Step3"]	=  new Array("CL_com_Beer_Brew_101_Step3", "");
	swfCommand["Beer_Brew_101_Step4"]	=  new Array("CL_com_Beer_Brew_101_Step4", "");
	swfCommand["Beer_Brew_101_Step5"]	=  new Array("CL_com_Beer_Brew_101_Step5", "");
	swfCommand["Beer_Gear"]	            =  new Array("CL_com_Beer_Gear_Launch_Page", "");
	
 	//hookup home page
	swfCommand["TheHookUp_BG"]			=  new Array("CL_com_Hook_Up_Homepage", "");
	swfCommand["HookUp_racing_home"]    =  new Array("CL_com_Hookup_Racing_Home", "");
	swfCommand["HookUp_racing_gallery"] =  new Array("CL_com_Hookup_Racing_Photos", "");
	swfCommand["HookUp_racing_schedule"]=  new Array("CL_com_Hookup_Racing_Schedule", "");
	swfCommand["HookUp_Gear"]           =  new Array("CL_com_Hookup_Gear_Launch_Page", "");
	
	//NFL home page
	swfCommand["NFL_BG"]				=  new Array("CL_com_NFL_HomePage", "");
	//NFL screensaver
	swfCommand["NFL_Screensavers"]		=  new Array("CL_com_Free_Goods_NFL_Screensavers", "");
	swfCommand["NFL_ScreenSaver_Download"] =  new Array("CL_com_Free_Goods_NFL_Screensavers_Download", "");
	//NFL wallpaper page
	swfCommand["NFL_Wallpaper"]			=  new Array("CL_com_Free_Goods_NFL_Wallpaper", "");
	swfCommand["NFL_Wallpaper_Download"]=  new Array("CL_com_Free_Goods_NFL_Wallpaper_Download", "");
	//NFL stuff page
	swfCommand["NFL_Gear"]			    =  new Array("CL_com_NFL_Gear_Launch_Page", "");
	swfCommand["NFL_Schedule"]          =  new Array("CL_com_NFL_Schedule", "");
	swfCommand["NFL_Schedule_Download"] =  new Array("CL_com_NFL_Schedule_Download", "");
	
	//Free Goods]
	swfCommand["Free_BG"]					=  new Array("CL_com_Free_Goods", "");
	swfCommand["Free_Icons"]                =  new Array("CL_com_Free_Goods_Icons", "");
	swfCommand["Free_Icons_Download"]       =  new Array("CL_com_Free_Goods_Icons_Download", "");
	swfCommand["Free_Screensaver"]          =  new Array("CL_com_Free_Goods_Desk_Screensaver", "");
	swfCommand["Free_Screensaver_Download"] =  new Array("CL_com_Free_Goods_Desk_Screensaver_Download", "");

		
	if (swfCommand[command][0] != ""){
		var type = swfCommand[command][0];

	
 		AtlasCall(type);
 	}
 
 
	function AtlasCall(type) {
		var imagePing = "http://switch.atdmt.com/action/"+ type;
		var doPing = new Image();
		doPing.src = imagePing;

		//this is the actual ping to DART.  It is a basic image request.
	}
}

if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('Sub Coors_Main_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call Coors_Main_DoFSCommand(command, args)\n');
	document.write('end sub\n');
	document.write('</script\> \n');
}
