<!-- Pop a window -->
var popupWindow;
function popup(url,scrollbars,width,height){
    popupWindow = open(url, 'pxPopupWindow', 'toolbar=0,location=0,directories=0,status=0,menubars=0,resizable=0,scrollbars='+scrollbars+',width='+width+',height='+height+',top=20,left=20');
    if (popupWindow != null) {
        popupWindow.focus();
    }
}

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


function popWin(url, winName, popWidth, popHeight, popTop, popLeft, popScroll){
	var top = (popTop == "undefined" || popTop < 0) ? 20 : popTop;
	var left = (popLeft == "undefined" || popLeft < 0) ? 20 : popLeft;
	var options = 'width='+popWidth+',height='+popHeight+',scrollbars='+popScroll+',top='+top+',left='+left+',location=no,toolbar=0,menubar=0,resizable=0,directories=0';
	var myWin = window.open(url, winName, options);
	myWin.focus();
}
<!--- footer email input field --->
var condText;
function clearTextBoxOnCondition(textBox,conditionText){
        if(textBox.value == conditionText) {
          textBox.value="";
          condText=conditionText;
        }
}

function fillTextBoxOnCondition(textBox){
        if(textBox.value == "") {
          textBox.value=condText;
        }
}
function sendURL(targetURI) {
	window.location = wsmlMakeWebServiceHref(targetURI);
}
var img_ld=0;
function ld_imgs() { }
function nav_ld_imgs() { }
function MakeArray(n) {
	this.length = n;
	for (var i = 0; i< n; i++) this[i] = new Image();
	return this;
}
	
function chng_img(imgName,imgNum) {
	if (document.images && img_ld) {
		document [imgName].src = iobj[imgNum].src; 
	}
}


function mission() {
document.emp.src = Image2.src; return true;
}

function original() {
document.emp.src = Image1.src; return true; 
}

function getCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function setCookie(name, value, expires, path, domain, secure) {
    document.cookie = 
    	name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

function deleteCookie(name, path, domain) {
	document.cookie = name + "=" + 
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		"; expires=Thu, 01-Jan-70 00:00:01 GMT";
}

function more(myPage, windowName, myWidth, myHeight, resize, scroll){
	LeftPosition= (screen.width*0.5)-(myWidth*0.5);
	TopPosition= (screen.height*0.4)-(myHeight*0.5);
	window.open(myPage, windowName, 'width='+myWidth+',height='+myHeight+',top='+TopPosition+',left='+LeftPosition+',scrollbars=' + scroll +',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=' + resize);
}

/* 21Dec2007 SuH   Bug: 31203; added functions isEmpty() and hasZip() to detect         */
/*                 user not supplying Zip/Post code for location search.                */
/*                 hasZip() is called by .../templates/includes/locator.tmpl            */

/* function isEmpty() detects if a string is empty(includes all spaces).                */
/*      isEmpty(elem, "Help its empty message")   -- gives a debug pop up box.          */
/*      isEmpty(elem)                             -- silent running,                    */
function isEmpty(elem, helperMsg){
        if ((elem != null) && (elem != "") && (elem.value != null) ) {
            var elem_length = elem.value.length ;
            if (elem_length != 0){
                 for (var i = 0; i < elem_length; i++) {
                      if (elem.value[i] != " ") {
                            /* *debug*   alert('*debug* We have an input with length= ' + elem_length );   */
                            return false ;
                      }
                 }
            }
        } 

        if (null != helperMsg) {
                if (helperMsg.length > 0) {
                        alert(helperMsg);
            }
        }

        elem.focus();
        return true;

}  /* Ends; isempty()  */

/* function hasZip() returns false if the arg string(elem) is empty or elem has all words on emptyWordList.  */
/* returns false if the input contains "undef" - undefined as entered by some functions.                     */
/* Loop through each word on emptyWordList see if it exists in customer string. If not, we assume the elem   */
/* given is a zip or postcode.                                                                               */
function hasZip(elem, emptyWordList){
      if (isEmpty(elem)) {
            return false ;
      }
      else {
            var l_wList = emptyWordList.toLowerCase() ;
            var srchWdArray = new Array() ;
            srchWdArray = l_wList.split(" ");

            var zipStr = elem.value ;
            var l_str = zipStr.toLowerCase() ;
            if (l_str.indexOf('undef') < 0) {
                 var max_i = srchWdArray.length ;
                 var pos ;

                 for (var i = 0; i < max_i ; i++) {
                       pos = l_str.indexOf(srchWdArray[i]) ;

                       if (pos < 0) {
                             /* *debug*  alert('*debug* Zip:' + elem.value + ' ;def words(' + l_wList +
                                                        ') i is(' + i + ') word 0 is(' + srchWdArray[0] + ')');  */

                             return true ;
                       }
                 } /* ends; for each srchWdArray[] */
            }

            /* *debug*    alert('*debug* Need zip code input.');     */

            return false;
      }

}  /* Ends; haszip() */


