// Global Nav search and email field clear and replace functions

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


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


// Pop a window

// Store a reference to the popped window
var popupWindow;

function popup(url, scrollbars, width, height, x, y, windowName){
	
	x = (x) ? x : 200;
	y = (y) ? y : 200;
	
	var winName = (windowName) ? windowName : 'jmPopupWindow';
	
	popupWindow = open(url, winName, 'toolbar=0,location=0,directories=0,status=0,menubars=0,resizable=0,scrollbars='+scrollbars+',width='+width+',height='+height+',left='+x+',top='+y);
	
	if (popupWindow != null) {
		popupWindow.focus();
	}
}

// Close window
function closewindow() {
	this.window.close();
}


// wsml functions are defined in /js/wsmlMakeWebServiceHref.js
// and included in /templates/includes/head_common_qf.tmpl
function elcSendURL( url ) {
//	printurl = wsmlMakeWebServiceHref(url);
//	alert(printurl);
	location.replace(wsmlMakeWebServiceHref(url));
}

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

function elcPopURLID(url,scrollbars,width,height,id){
    popupWindow = open(wsmlMakeLeakHref(url), id, '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();
    }
}

