/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */




//HTTP OBJECT varable define globaly
var htobj;

function getHtObj()
{
 if (window.ActiveXObject) 
       return new ActiveXObject("Microsoft.XMLHTTP");
   else if (window.XMLHttpRequest) 
       return new XMLHttpRequest();
   else {
      alert("Your browser does not support AJAX.");
      return null;
   }   
}

/*
 * function request for next product
 *
 * @param string url requested url
 * @param string id  current product id
 * @param string page page number
 * @param string reqf request for like next/previous
 * @param string divid after responce changable div id
 *
 * @return change the inner html of the given div
 */


function changeDiv(url,id,reqf,req,divid)
{
requrl=url+"?";
if(id!="")
    {
        requrl+="snid="+id;
       if(reqf!="")requrl+="&reqf="+reqf;
       if(req!="")requrl+="&req="+req;
    } 
   htobj=getHtObj();
try{
   if(htobj!=null)
       {

        htobj.onreadystatechange = function(){
		if(htobj.readyState == 4){

			                  $o(divid).innerHTML = htobj.responseText;
		                          }
	              }
	htobj.open("GET", requrl, true);
	htobj.send(null);
            }
}catch(err){
        alert(err);
        }

      
 }



 function $o(str)
 {
     return document.getElementById(str);
 }


