var currentRowID		= '';

/*
FUNCTION: searchForDealers				
										
PARAMETERS: 							
	formName							
		- string: the name of the form	
*/
function searchForDealers(formName) {
	aryErrors	= new Array();
	var frm		= document.forms[formName];
	var zipcode	= frm.zipcode.value;
	
	if (zipcode == '') {
		addErr('Your 5 digit zip code is missing.');
	}
	
	if (!hasErrors()) {
		newWindow('/dealerlocator/?zipcode=' + zipcode, 'winDealerLocator', 790, 600, ',resizable=no,status=no,scrollbars=yes');
	}
}
/*
FUNCTION: downloaFileAlert	
							
PARAMETERS: none			
*/
function downloaFileAlert() {
	if (confirm('The File you are trying to download requires you to be logged in.\n\nTo log into your account or register for an account click the "OK" button below, otherwise click "Cancel".')) {
		changeWindowLocation('/login');
	}
}
/*
FUNCTION: showFloatingWindow										
																	
PARAMETERS:															
	pageToLoad														
		- string: the page to load									
	windowName														
		- string: the ID of the window								
	windowTitle														
		- string: the title of the window							
	windowLoc														
		- string: the folder location where the window page exists	
*/
function showFloatingWindow(pageToLoad, windowName, windowTitle, windowLoc) {
	var folderPath		= '';
	var newWindowName	= windowName.charAt(0).toUpperCase() + windowName.substring(1, windowName.length);
	
	switch(windowLoc) {
		case 'product':
			folderPath	= 'products/windows';
		break;
		
		case 'customersupport':
			folderPath	= 'customersupport/windows';
		break;
		
		case 'myaccount':
			folderPath	= 'myaccount/windows';
		break;
		
		case 'about':
			folderPath	= 'about/windows';
		break;
		
		case 'dealerlocator':
			folderPath	= 'dealerlocator/windows';
		break;
	}
	
	if (windowTitle != '') {
		changeCFWindowTitle(windowName + '_title', windowTitle);
	}
	
	document.getElementById('div' + newWindowName).innerHTML = 'Loading window ... Please wait.';
	callPage(pageToLoad + '&' + Math.random(), folderPath, 'div' + newWindowName, '');
	showHideCFWindow('show', windowName);
}
/*
FUNCTION: changeListRowColor					
												
PARAMETERS:										
	rowID										
		- string: the row ID					
	cName										
		- string: the class name				
	mouse										
		- over: the mouse if over the row		
		- out: the mouse moved out from the row	
*/
function changeListRowColor(rowID, cName, mouse) {
	var row						= document.getElementById(rowID);
	
	if (currentRowID != rowID) {
		if (mouse == 'over') {
			row.className		= 'highlight';
		} else if (mouse == 'out') {
			if (currentRowID != rowID) {
				row.className	= cName;
			}
		}
	}
}