// Niels Damkjær :: Codeserver.dk //

//**********************************************************************
//* BEGIN NAVIGATION FUNCTIONS
//**********************************************************************

function navigate(strUrl) {
	var strUrl
	document.location = strUrl;
	return false;
}

function popup(mypage, myname, w, h, scroll) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height=' + h + ',width=' + w + ',top=' + wint + ',left=' + winl + ',scrollbars=' + scroll + ''
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function Cart_Add(itemID, qty, strRedirect){
	navigate('cart.asp?action=add&itemID=' + itemID + '&redirect=' + strRedirect + '&qty=' + qty);
}

function Cart_Remove(itemID, strRedirect) {
	navigate('cart.asp?action=remove&itemID=' + itemID + '&redirect=' + strRedirect);
}


//**********************************************************************
//* END NAVIGATION FUNCTIONS
//**********************************************************************


//**********************************************************************
//* BEGIN ELEMENT APPERANCE FUNCTIONS
//**********************************************************************

function hideElement(obj){ document.getElementById(obj).style.visibility = "hidden"; }
function showElement(obj){ document.getElementById(obj).style.visibility = "visible"; }

/* BEGIN MOUSE HOWER FUNCTIONS */
function MO_BgColor(e, xBgColor) { e.style.backgroundColor = '#' + xBgColor; }
function MU_BgColor(e, xBgColor) { e.style.backgroundColor = '#' + xBgColor; }
function MO_ClassName(e, strClassName) { e.className = strClassName; }
function MU_ClassName(e, strClassName) { e.className = strClassName; }
/* END MOUSE HOWER FUNCTIONS */

//**********************************************************************
//* END ELEMENT APPERANCE FUNCTIONS
//**********************************************************************


//**********************************************************************
//* BEGIN FORM FUNCTIONS
//**********************************************************************

function SubmitForm(e) {
	if(e.onsubmit()) {//this check triggers the validations
		e.submit();
	}
}

//**********************************************************************
//* END FORM FUNCTIONS
//**********************************************************************