function gs_popup_win(url,w,h) {
  var ContextWindow = window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width='+w+',height='+h+',screenX='+(screen.width-w)/2+',screenY='+(screen.height-h)/2+',left='+(screen.width-w)/2+',top='+(screen.height-h)/2)
  ContextWindow.focus();
  return false;
}

String.prototype.trim = function() {
    return this.replace(/^\s+|\s+$/g,'');
}

function submitStaticSearchLink(sid,mid,url){

	    var nodeDropdown = document.getElementById(mid).value;
	//if (document.getElementById(sid) != null){
		var sKeyword = document.getElementById(sid).value;
		
		if (/[^\w\-\s,]/.test(sKeyword) || sKeyword.search(/\S/)==-1 || !url) return true;
        sKeyword = sKeyword.trim();
		//sKeyword = sKeyword.replace(/-/g, '_-_');
		//sKeyword = sKeyword.replace(/\s+/g, ' ');
		sKeyword = sKeyword.replace(/\s/g, '-');
		var func = typeof(encodeURIComponent) != "undefined" ? encodeURIComponent : escape;

		url = url.replace(/KEYWORD/g, func(sKeyword));
		url = url.replace(/MID/g, func(nodeDropdown));
		
		location.href = url;
		return false;
	//}
	//return true;
}
