if(parent.frames.length!=0){
	window.top.location.replace(document.location.href)
}

function getQSEmailRequal(){
	if (getArgs().privacyPolicy==1){
		popwindow('/popups/popup_privacy.asp?Category=PRIVACY+POLICY', 516, 495, 0);
	}
	
	if (getArgs().termsOfUse==1){
		popwindow('/popups/popup_privacy.asp?Category=TERMS+OF+USE', 516, 495, 0); 	
	}
	
	if (getArgs().emailRequal==1){
			popwindow("/email_notification/email_notification_nocache.asp?sCategory=Global&HomePage=1&email=" + getArgs().email + "&first_name=" + getArgs().first_name + "&last_name=" + getArgs().last_name, 517 + (blnN6?31:0), 517, 0);	
	}
}

var blnHomeLoaded = false;

function homePageRefresh(){
	location.href = "/";
}

function initHomePage(){
	doVtxPopUp();
	preloadImagesHome();
	pageLoad();
	loadImages();
	getQSEmailRequal();
	blnHomeLoaded = true;
}

function doVtxPopUp(){
	if (typeof(getArgs().popup) != 'undefined'){
		var sPopup = getArgs().popup.toLowerCase()
		if ((sPopup == 'vtxperience') || (sPopup == 'vtxcustomshow')){
			launchVTXPromo04(sPopup)	// <- nav_global_side_pres.asp
		}
	}
}

function preloadImagesHome(){
	img1 = newImage('/images/home/homeNavMotorcycles_over.gif');
	img1_2 = newImage('/images/home/homeNavMotorcycles.gif');
	img2 = newImage('/images/home/homeNavATVs_over.gif');
	img2_2 = newImage('/images/home/homeNavATVs.gif');
	img3 = newImage('/images/home/homeNavScooters_over.gif');
	img3_2 = newImage('/images/home/homeNavScooters.gif');
	img4 = newImage('/images/home/homeNavWatercraft_over.gif');
	img4_2 = newImage('/images/home/homeNavWatercraft.gif');
	img5 = newImage('/images/home/related_links/hrca_link.gif');
	img5_2 = newImage('/images/home/related_links/hrca_link_over.gif');
	img6 = newImage('/images/home/related_links/owner_link.gif');
	img6_2 = newImage('/images/home/related_links/owner_link_over.gif');
	img7 = newImage('/images/home/related_links/racing_link.gif');
	img7_2 = newImage('/images/home/related_links/racing_link_over.gif');
	img8 = newImage('/images/home/purchasing_tools/BuildYourHonda.gif');
	img8_2 = newImage('/images/home/purchasing_tools/BuildYourHonda_over.gif');
	img9 = newImage('/images/home/purchasing_tools/RequestaQuote.gif');
	img9_2 = newImage('/images/home/purchasing_tools/RequestaQuote_over.gif');
	blnHomePage = true;
}



arrHomeImgs = new Array();
arrHomeImgs[0] = new Array('/images/home/homemotorcycle01.jpg', '/motorcycles/');
arrHomeImgs[1] = new Array('/images/home/homemotorcycles02.jpg', '/motorcycles/');
arrHomeImgs[2] = new Array('/images/home/homeATVs01.jpg', '/atvs/');
arrHomeImgs[3] = new Array('/images/home/homeATVs02.jpg', '/atvs/');
arrHomeImgs[4] = new Array('/images/home/homescooter01.jpg', '/scooters/');
arrHomeImgs[5] = new Array('/images/home/homescooters02.jpg', '/scooters/');
arrHomeImgs[6] = new Array('/images/home/homewatercraft01.jpg', '/watercraft/');
arrHomeImgs[7] = new Array('/images/home/homewatercraft02.jpg', '/watercraft/');
imgCt = arrHomeImgs.length;
randomNum = Math.round(Math.random()*(imgCt-1));

arrRelatedLinks = new Array(); 
arrRelatedLinks[0] = new Array('/images/home/related_links/owner_link.gif', '/images/home/related_links/owner_link_over.gif', 'https://www.ahm-ownerlink.com/login.asp?brand=mc');
arrRelatedLinks[1] = new Array('/images/home/related_links/hrca_link.gif', '/images/home/related_links/hrca_link_over.gif', 'http://hrca.honda.com/');
arrRelatedLinks[2] = new Array('/images/home/related_links/racing_link.gif', '/images/home/related_links/racing_link_over.gif', 'http://www.hondaredriders.com');
arrRelatedLinksLength = arrRelatedLinks.length;
 
ranNum = Math.round(Math.random()*(arrRelatedLinksLength-1));
 
function loadImages(){
 UFChangeImage('randImg', arrRelatedLinks[ranNum][0]);
 document.getElementById('homeRandomLink').href = arrRelatedLinks[ranNum][2];
 
 UFChangeImage('homeImg', arrHomeImgs[randomNum][0]);
 document.getElementById('homeImgLink').href = arrHomeImgs[randomNum][1];
}
 
function rollOnRelatedLinks(){
 UFChangeImage('randImg' , arrRelatedLinks[ranNum][1]);
}
 
function rollOffRelatedLinks(){
  UFChangeImage('randImg' , arrRelatedLinks[ranNum][0]);
}



