var divid;
function view_search(opt)
{
	if(opt!='0')
	{
	var strUrl = "collect_val.php?var_course="+opt;
	divid="det";
	xmlhttpPost(strUrl);
	}
}
function view_search1(opt)
{
	if(opt!='0')
	{
	var strUrl = "collect_val1.php?var_course="+opt;
	divid="pass";
	xmlhttpPost(strUrl);
	}
}

function frmClose()
{
	document.getElementById('detail').innerHTML="<div id='detail'></div>";
}

function go_Clear()
	{
		if(document.getElementById("find_field").value=="Search a Product")
		document.getElementById("find_field").value="";
		return true;
	}

/*function doSubmit()
{
	val1=document.getElementById("product_search").value
	val2=document.getElementById("category_search").value
    if(val1==0)
    {
      alert("select any category");
    	return false;
    }  
	if(val2==0)
    {
      alert("select any category");
    	return false;
    }
   qstr = "category_search=" + document.getElementById("category_search").value;
   qstr += "range_search=" + document.getElementById("range_search").value;
   qstr += "find_field=" + document.getElementById("find_field").value;	
   var strUrl = "search_session.php?" + qstr;
	xmlhttpPost(strUrl);
}
*/
function xmlhttpPost(strURL)
 {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest)
	{
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
	strURL = strURL;

    self.xmlHttpReq.open('POST', strURL, true);
	
    self.xmlHttpReq.onreadystatechange = function() 
	{
	    if (self.xmlHttpReq.readyState == 4) 
		{
            updatepage(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystring());
}

function getquerystring() {

   	var qstr="";
    return qstr;
}

function updatepage(str){

	document.getElementById(divid).innerHTML = str;
//	document.getElementById('detail').style.display =''; 
}
