/* BEGIN GLOBAL NAV CODE */
	function elcSendURL( url ) {
		location.replace(wsmlMakeWebServiceHref(url));
	}
	function sendURL(targetURI) {
		window.location = wsmlMakeWebServiceHref(targetURI);
	}
	var CMSGlobal = new elcNavigation();
	var pnav = new elcNavigation('pnav');
	pnav.hasTimeout = false;
	pnav.offLayer = "pNavOff";
	var psnav = new elcNavigation('psnav');
	psnav.hasTimeout = true;
	psnav.offLayer = "pNavOff";
	var pssnav = new elcNavigation('pssnav');
	pssnav.hasTimeout = true;
	pssnav.offLayer = "pNavOff";
	
	var navMenuColorOn = '#FFFFFF';
	var navMenuColorOff = '#000000';
	var navMenuColorOff_grey = '#CCCCCC';
	
	
	elcNavigation.prototype.hSetOn = function(oItem){
		if (oItem == "undefined" || oItem == null || !oItem || oItem.myLayer == null || !oItem.myLayer) { return };
	
		if (oItem.myLayer) {
			var sDocumentURL = document.URL;
			if (sDocumentURL == 'http://www.artdeco.org.uk/makeup-products.htm' || sDocumentURL == 'http://www.artdeco.org.uk/press.htm' || sDocumentURL == 'http://www.artdeco.org.uk/mobo_mixedpage1.htm' || sDocumentURL == 'http://www.artdeco.org.uk/mobo_mixedpage2.htm' || sDocumentURL == 'http://www.artdeco.org.uk/mobo_mixedpage3.htm' || sDocumentURL == 'http://www.artdeco.org.uk/mobo_mixedpage4.htm' || sDocumentURL == 'http://www.artdeco.org.uk/mobo_mutyabuena.htm' || sDocumentURL == 'http://www.artdeco.org.uk/mobo_sinitta.htm' || sDocumentURL == 'http://www.artdeco.org.uk/mobo_yungjoc.htm' || sDocumentURL == 'http://www.artdeco.org.uk/voda_holly-will.htm' || sDocumentURL == 'http://www.artdeco.org.uk/voda_jimmycarr.htm' || sDocumentURL == 'http://www.artdeco.org.uk/voda_nikkiandmishelle.htm' || sDocumentURL == 'http://www.artdeco.org.uk/voda_paulkaye.htm' || sDocumentURL == 'http://www.artdeco.org.uk/voda_riosin-murphy.htm' || sDocumentURL == 'http://www.artdeco.org.uk/voda_snowdon.htm' || sDocumentURL == 'http://www.artdeco.org.uk/voda_tamsin2.htm' 
|| sDocumentURL == 'http://www.artdeco.org.uk/makeup-products_face.htm'
|| sDocumentURL == 'http://www.artdeco.org.uk/voda_avidmerrion.htm' 
|| sDocumentURL == 'http://www.artdeco.org.uk/voda_css.htm' 
|| sDocumentURL == 'http://www.artdeco.org.uk/voda_debbieharry.htm' 
|| sDocumentURL == 'http://www.artdeco.org.uk/voda_katenash.htm' 
|| sDocumentURL == 'http://www.artdeco.org.uk/voda_louiseredknapp.htm' 
|| sDocumentURL == 'http://www.artdeco.org.uk/voda_lovefoxx.htm' 
|| sDocumentURL == 'http://www.artdeco.org.uk/voda_pigeondetectives.htm' 
|| sDocumentURL == 'http://www.artdeco.org.uk/voda_rachelstevens.htm' 
|| sDocumentURL == 'http://www.artdeco.org.uk/voda_stereophonics.htm' 
|| sDocumentURL == 'http://www.artdeco.org.uk/voda_tarareid.htm' 
|| sDocumentURL == 'http://www.artdeco.org.uk/voda_mixedpage1.htm' 

|| sDocumentURL == 
'http://www.artdeco.org.uk/makeup-products_lips.htm' || sDocumentURL == 
'http://www.artdeco.org.uk/makeup-products_eyes.htm' || sDocumentURL == 'http://artdeco.org.uk/makeup-products_looks.htm') 
			
			
			
			navMenuColorOff = navMenuColorOff_grey;
			
		    oItem.myLayer.css.color = navMenuColorOn;
		}
		/*	}*/
		/*	oItem.myLayer.css.color = navMenuColorOn;
		}*/
	}
	
	
	
	elcNavigation.prototype.hSetOff = function(oItem){
		if (oItem == "undefined" || oItem == null || !oItem || oItem.myLayer == null || !oItem.myLayer) { return };

		if (oItem.myLayer) {
			oItem.myLayer.css.color = navMenuColorOff;
		}
	}
	

	
	
/* END GLOBAL NAV CODE */

/* NAV VARIABLES */
/*  Also use rightnav object for product rollovers */
var leftnav = new elcNavigation('leftnav');
var rightnav = new elcNavigation('rightnav');
var footnav = new elcNavigation('footnav');
/* END NAV VARIABLES */

/* popup window */
function popWin(url,winName, popWidth,popHeight,popScroll, popResize) { 
		if (!popScroll) { popScroll = 'no'}
		if (!popResize) { popResize = 0}
	    var options = 'width='+popWidth+',height='+popHeight+',scrollbars='+popScroll+',location=no,toolbar=0,menubar=0,resizable='+popResize+',directories=0';
            var myWin = window.open(url, winName, options);
	    myWin.focus();
//		return myWin;
}
  	
  function properWindowOpener(url, w, h, scroll, resize)
  {
  	var windowWidth  = w;
  	var windowHeight = h;
  
  	//find out how big the screen is
  	var screenWidth  = screen.availWidth;
  	var screenHeight = screen.availHeight;
  
  	//get the left position - which is half the screen width minus half the window width
  	var leftPoint = parseInt(screenWidth/2) - parseInt(windowWidth/2);
	
  	//get the top position - which is half the screen height minus half the window height
  	var topPoint  = parseInt(screenHeight/2) - parseInt(windowHeight/2);
  
  	//var winprops = 'height='+h+', left='+leftPoint+', top='+topPoint+', width='+w+',scrollbars=1 ,resizable=1'
	var winprops = 'height='+h+', left='+leftPoint+', top='+topPoint+', width='+w+', resizable=1, scrollbars='+scroll;

	var win = window.open( url, "macwin", winprops);
  
	//return win;
  	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
  }

 
var condText;
function clearTextBoxOnCondition(textBox,conditionText){
        if(textBox.value == conditionText)
          textBox.value="";
		condText=conditionText;
    }

function fillTextBoxOnCondition(textBox){
        if(textBox.value == "") {
          textBox.value=condText;
        }
}

function checkMaxLength (textarea, evt, maxLength) {
	if (textarea.selected && evt.shiftKey)
	// ignore shift click for select
		return true;
	var allowKey = false;
	if (textarea.selected && textarea.selectedLength > 0)
		allowKey = true;
	else {
		var keyCode = document.layers ? evt.which : evt.keyCode;
		if (keyCode < 32 && keyCode != 13)
			allowKey = true;
		else
			allowKey = textarea.value.length < maxLength;
		}
	textarea.selected = false;
	return allowKey;
}

function storeSelection (field) {
	if (document.all) {
		field.selected = true;
		field.selectedLength = field.createTextRange ? document.selection.createRange().text.length : 1;
	}
}

	var minPageHeight = 0;
	var iMacContentH = 0;
	var bracerNameArr = new Array("maclnav", "macrnav");
	var bracerObjArr = new Array();
	var iBracerY = minPageHeight;
	var iFooterOffset = 0;
	
	function addBracerObj(sLayerName) {
		bracerObjArr[bracerObjArr.length] = new elcLayer(sLayerName);
	}

	function setFooterY() {
		oMacContentObj = new elcLayer("content");
		iMacContentH = (oMacContentObj && oMacContentObj.h)? oMacContentObj.h : iMacContentH;
		for (var i=0; i<bracerNameArr.length; i++) {
			addBracerObj(bracerNameArr[i]);
			if (bracerObjArr[i] && bracerObjArr[i].h && (bracerObjArr[i].h > iBracerY)) {
				iBracerY = bracerObjArr[i].h;
			}
		}
		iFooterOffset = ((iBracerY - iMacContentH) > 0)? (iBracerY - iMacContentH) : 0;
		if (iFooterOffset > 0) {
			document.write('<table><tr><td><img src="/images/1x1.gif" height="' + iFooterOffset + '"></td></tr></table>');
		}
	}

/* Form email validation */
	function isNumeric(sInput) {
		return ((sInput.search(/^[0-9]*$/g) > -1));
	}
	
	function isAlphabetic(sInput) {
		return ((sInput.search(/^[A-Za-z0-9_@\.-]*$/g) > -1));
	}
	
	function isValidEmailFormat(sInput) {
		return ((sInput.indexOf("@") > -1) && (sInput.indexOf(".") > -1));
	}
	
/* COMMERCE */
function mADD(qtyBox, formName) {
	if (!formName) {
		formName = 'prodform';
	}
	if (!document.forms[formName].elements[qtyBox].value) {
		document.forms[formName].elements[qtyBox].value=1;
	}
	document.forms[formName].submit();
}
