function elcSendURL( url ) {
      location.replace(wsmlMakeWebServiceHref(url));
}

function sendURL(targetURI) {
	window.location = wsmlMakeWebServiceHref(targetURI);
}

function elcOpenerURL( url ) {
	if (!window.opener || window.opener.closed) {
		var myWin = window.open(wsmlMakeWebServiceHref(url), '_blank');
		myWin.focus();
		return;
	}

	if (window.opener) {
		window.opener.location.replace(wsmlMakeWebServiceHref(url));
		window.opener.focus();
	} else {
		var myWin = window.open(wsmlMakeWebServiceHref(url), '_blank');
		myWin.focus();
	}
}

function leakPopup(url,h,w) {
	var location = wsmlMakeLeakHref(url);
	window.open(location,'Popup','height='+h+',width='+w+',scrollbars=no,toolbar=no,location=no,menubar=no,personalbar=no,status=no,resizable=yes');
}

function sendURLparent(targetURI) {
        window.opener.location.href = wsmlMakeWebServiceHref(targetURI);
        window.close();
}

var shopNav = new elcNavigation();
var whatsNav = new elcNavigation();
var CMSGlobal = new elcNavigation();
var gnav = new elcNavigation();
var pnav = new elcNavigation('pnav');
var voffer = new elcNavigation('voffer');
var lnav = new clLeftNav('lnav');
pnav.hasTimeout = true;
pnav.offLayer = "pNavOff";
var psnav = new elcNavigation('psnav');
psnav.hasTimeout = true;

var navMenuBGColorOn = '#DDDDDD';
var navMenuBGColorOff = '#FFFFFF';
var navMenuColorOn = '#D6A847';
var navMenuColorOff = '#A8A8A8';

elcNavigation.prototype.hSetOn = function(oItem){
	if (oItem.myLayer) {
		oItem.myLayer.style.color = navMenuColorOn;
	}
}

elcNavigation.prototype.hSetOff = function(oItem){
	if (oItem.myLayer) {
		oItem.myLayer.style.color = navMenuColorOff;
	}
}

/* popup window */
function popWin(url,winName, popWidth,popHeight,popScroll) { 
var options = 'width='+popWidth+',height='+popHeight+',scrollbars='+popScroll+',location=no,toolbar=0,menubar=0,resizable=0,directories=0';
var myWin = window.open(url, winName, options);
myWin.focus();
}

function popWindow(w,h,x,y) {
var subwindow = window.open('','subWindow_name','toolbar=no,menubar=no,location=no,scrollbars=yes,width='+w+',height='+h+',left='+x+',top='+y);
subwindow.resizeTo(w,h);
subwindow.moveTo(x,y);
subwindow.focus();
}

//(name) is the name of the window i.e.
function micrositeLaunchFull(name,url) {
	// object checking
	var isIE = (document.all) ? 1 : 0;
	var isNS = (document.layers) ? 1 : 0;
	var isDOM = (document.getElementById && !document.all) ? 1 : 0;

	// platform checking
	var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? 1 : 0;
	var isMac = (navigator.appVersion.indexOf("Mac") != -1) ? 1 : 0;

	// fullscreen stuff
	var opts = ",toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=0,copyhistory=0,menubar=0";

	if (isNS || isDOM) {

		//opts = opts+",left=0,top=0";
		opts = opts+",left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight;
	} else if (isIE) {
		opts = opts+",width="+screen.availWidth+",height="+screen.availHeight;
		if (isMac) {
			//this uses a value of 13 for the extra width and 32 for the extra height
			opts = opts+",width="+(screen.availWidth + 13)+",height="+(screen.availHeight + 32);
		} else if (isWin) {
			//this uses a value of 12 for the extra width and 25 for the extra height
			opts = opts+",width="+(screen.availWidth - 12)+",height="+(screen.availHeight - 25);
		} else {
			opts = opts+",width="+screen.availWidth+",height="+screen.availHeight;
		}
	} else {
		return;
	}

	// open a new window
	var newWin = window.open(url,name,opts);
	newWin.focus();
	// move to 0,0 (JavaScript 1.2)
	if (parseInt(navigator.appVersion) >= 4) {
		newWin.moveTo(0,0);
	}
}

var condText;
function clearTextBoxOnCondition(textBox,conditionText){
        if(textBox.value == conditionText) {
          textBox.value="";
          condText=conditionText;
        }
}


function fillTextBoxOnCondition(textBox){
        if(textBox.value == "") {
          textBox.value=condText;
        }
}
