/* 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();
}
  	
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;
	}
}

/* Copied from elcNavigation and head_common.tmpl */
if ((typeof wsmlMakeWebServiceHref) == "undefined")
{
  wsmlMakeWebServiceHref =
  wsmlMakeResourceHref =
  wsmlMakeResourceUrl =
  wsmlMakeLeakHref =
  wsmlMakeComponentHref =
  wsmlMakeCssHref = new Function ("u", "return u;");
}

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

// ARR 1/7/08 - Added for new navigation
function sendURL(targetURI) {
        window.location = wsmlMakeWebServiceHref(targetURI);
}

function setPNGtrans(img) {
	img.src='/images/shim.gif';
}

function checkGiftwrapFields() {
  // If any of the message fields on the giftwrap section
  // have text in them, the radio button will automatically
  // change from No to Yes (and vice versa)
  if(document.all.CARDMESSAGE_TO.value   != "" ||
     document.all.CARDMESSAGE.value      != "" ||
     document.all.CARDMESSAGE_FROM.value != "" ) {

    document.all.GIFTWRAP[0].checked = true;

  } else {

    document.all.GIFTWRAP[1].checked = true;

  }
}

/* Includes for LNAV - ARR - M.Lapicki, Commented out as no longer used
var lnav = new orLeftNav('lnav');
var navMenuBGColorOn = '#DDDDDD';
var navMenuBGColorOff = '#FFFFFF';
var navMenuColorOn = '#ba9a28';
var navMenuColorOff = '#808080';
*/
