var preloadFlag = false;

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

function preloadImages() {
	if (document.images) {
		gowns_over = newImage("images/nav_bridal_gowns_on.gif");
		couture_over = newImage("images/nav_reception_gowns_on.gif");
		formalwear_over = newImage("images/nav_bridesmaid_prom_on.gif");
		preloadFlag = true;
	}
}

function hide(div)
{
	document.getElementById(div).style.display = "none";	
}

function refresh() {
	window.location = window.location;	
}

function displaydesc(which, descriptionarray, container)
{
	if (document.getElementById)
	document.getElementById(container).innerHTML=descriptionarray[which.selectedIndex]
}

function newSimpleWindow(name,url,width,height,scrollbar)
{
	var assetWindow = window.open(url,name,'toolbar=0,location=0,directories=0,menubar=0,status=1,scrollbars=' + scrollbar + ',resizable=1,width=' + width + ',height=' + height);
	if(window.focus)
	{
		assetWindow.focus();	
	}
}

function inputCheck()
{
	if(document.searchForm.searchInput.value == "SEARCH_")
	{
		document.searchForm.searchInput.value = "";
	}
}

function selectStyle(url,formObj,selectType)
{
	window.location = url + '?id=' + eval('document.' + formObj + '.' + selectType + '.options[document.' + formObj + '.' + selectType + '.selectedIndex].value');
}

function confirmRemove(style,id)
{
	if(confirm("Are you sure you want to permantly remove style: " + style + "?"))
	{
		document.assets.removeID.value = id;
		document.assets.removeStyle.value = style;
		document.assets.submit();
	}
}

function submitOrderForm()
{
	document.orderForm.submit();
}
