function sitesearch_validation(formNm){
  if(formNm.keyword.value == "" || checkBlank(formNm.keyword.value)){
    alert("Please enter keyword");
    formNm.keyword.focus();
    return false;
  } else{
    formNm.submit();
  }
}


function categorywise_validation(formNm){
  if(formNm.catID.selectedIndex == 0 ){
    alert("Please select one category");
    formNm.catID.focus();
    return false;
  } else{

		catID = formNm.catID.value;
		formNm.submit();
		//url = "ajaxsearch.php?action=search&catid="+catID;
		//window.open(url);
		//window.open(url,'centerwindow','scrollbars=yes,menubar=no,width=600,height=600');
  }
}

function show_alphabetically(alphabet)
{
	var url = '' ;
	url = "api_alphabets_pages/"+alphabet+".html";
	window.open(url,'centerwindow','scrollbars=yes,menubar=no,width=600,height=600');
	//window.open(url);
}

var req;

function categorywise_validation2(obj) {
	if(obj.catID.selectedIndex == 0 ){
    alert("Please select one category");
    obj.catID.focus();
    return false;
  } else{
	frm = obj;
	catid = obj.catID.value;
	req = new XMLHttpRequest();
    req.onreadystatechange = processPopulateProductpage;
    req.open("GET","ajaxsearch.php?action=search&catid="+catid, true);
    req.send("");
  }
}
function processPopulateProductpage() {
    if (req.readyState == 4) {
	        if (req.status == 200) {
				url = req.responseText;
				window.open(url,'centerwindow','scrollbars=yes,menubar=no,width=600,height=600');
				}			
         } else {
          // alert("Error: While trying to fetching  Records, please try again later");
         }

}
function show_categories(){
	var cat_id = document.getElementById ("cat_id");

	if (cat_id.style.display=="none"){
    	 if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion >= "4.0"){
	    	cat_id.style.display="";		
		    }
		else{
			cat_id.style.display="";		
		 }
	}
	else{
		cat_id.style.display="none";		
	}

}
