// RugDecor.com
// written by NinthVector
// 03/2008


// Preload Images
function simplePreload() {
	var args = simplePreload.arguments;
	document.imageArray = new Array(args.length);
	for(var i=0; i<args.length; i++) {
		document.imageArray[i] = new Image;
		document.imageArray[i].src = args[i];
	}
}

// Initialize
simplePreload( '../img/home_hov.png', '../img/rugs_hov.png', '../img/shop_hov.png', '../img/forum_hov.png', '../img/store_hov.png', '../img/help_hov.png', '../img/tooltipBak.png', '../img/tooltipBakM.png', '../img/tooltipBakL.png', '../img/monthly-specials-down.png', '../img/rug-decor-store.png' );




// newsletter - carries email address entered on home page into newsletter signup form
function mirrorEmail(email) {
		var emailEle = document.getElementById('email_field');
		emailEle.value = email;
}




// Check to make sure that the search field has query contents in it before we allow 
// the form to be submitted. This will prevent users from clicking the button after having
// made a selection from the jum menus, thinking they need to click submit to activate their
// selection.
function checkSubmit() {
	var ele = document.getElementById( 'search' );
	if( ele.value!='' ) {
		document.searchForm.submit();
	}
}