function _open_popup_window(w,h,url,slug,title) {
 var regex = /\W+/;
 if(regex.test(slug)) {
  slug = slug.replace(/\W+/, '_');
 }

 if(w != '' && h != '') {
  framesPopUp(url,title,slug,w,h);
  return false;
 }
 return true;
}

//author: bora nikolic
function framesPopUp(filename,winTitle,winName,w,h) {
 var winName = "__" + winName;
 var regex = /\W+/;

 if(regex.test(winName)) {
  winName = winName.replace(/\W+/, '_');
 }

 params = "width="+ w +",height="+h + ",resizable";
 winExec = winName +"= window.open('','"+winName+"', params)";
 // old
 //content = "<html><head><title>"+winTitle+"</title><script>window.onload=function(){}</script></head><frameset rows='0,*' frameborder='NO' border='0' framespacing='0'><frame name='topFrame' scrolling='NO' noresize src='about:blank'><frame name='mainFrame' src='"+ filename +"' scrolling=AUTO></frameset><noframes><body bgcolor='#FFFFFF' text='#000000'></body></noframes></html>";
 content = "<html><head><title>"+winTitle+"</title></head><frameset rows='0,*' frameborder='NO' border='0' framespacing='0'><frame name='topFrame' scrolling='NO' src='about:blank'><frame name='mainFrame' src='"+ filename +"' scrolling='AUTO'></frameset><noframes><body bgcolor='#FFFFFF' text='#000000'>Frames are not enabled on your browser. Please enable frames.</body></noframes></html>"; 

 eval(winExec);
 eval(winName + ".document.open()");
 eval(winName + ".document.write(content)");
 eval(winName + ".document.close()");
}

function validateSearch(theForm) {
 var re = /^(\s)*$/;
 var noSearchWordFound = theForm.query.value.search(re);
 //if(theForm.query.value == "") {
 if(noSearchWordFound != -1) {
  alert("Please enter a search term!");
  return false;
 } else {
  theForm.submit();
 }
}
