function GetXmlHttpObject(){
var xmlHttp=null;
try {
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e) {
// Internet Explorer
try {
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}

xmlHttp=GetXmlHttpObject()
function rs(){
if(xmlHttp.readyState==4){
document.getElementById('main').innerHTML=xmlHttp.responseText;
}else{
document.getElementById('main').innerHTML='من فضلك انتظر جاري  تنفيذ طلبك';
}
}




function validateS(){
var s=document.getElementById('search').value;
if(s<2){
alert('من فضلك ادخل اسم منتج للبحث');
//document.getElementById(search).style.borderColor= '#ff0000';
//form.elements[i].focus();
return false;
}
}


function vS(){
var s=document.getElementById('search').value;
if(s<2){
alert('من فضلك ادخل اسم منتج للبحث');
//document.getElementById(search).style.borderColor= '#ff0000';
//form.elements[i].focus();
//return false;
}else{
var url='search.php';
url=url+'?s='+s+'&sid='+Math.random();
xmlHttp.open('GET',url,true);
xmlHttp.onreadystatechange=rs;
xmlHttp.send(null)
}
}
