function ajax_fun(url,id)
{var ajax_obj;if(window.XMLHttpRequest)
{ajax_obj=new XMLHttpRequest();}
else if(window.ActiveXObject)
{ajax_obj=new ActiveXObject("Microsoft.XMLHTTP");}
else
{alert("Your browser does not support XMLHTTP!");}
ajax_obj.onreadystatechange=function()
{if(ajax_obj.readyState==4)
{document.getElementById(id).innerHTML=ajax_obj.responseText;}
if(ajax_obj.readyState!=4)
{document.getElementById(id).innerHTML='<img src="images/loading.gif" alt="Loading...">';}}
ajax_obj.open("GET",url,true);ajax_obj.send(null);}
function ajax_fun_loader(url,id,loader_div)
{var ajax_obj;if(window.XMLHttpRequest)
{ajax_obj=new XMLHttpRequest();}
else if(window.ActiveXObject)
{ajax_obj=new ActiveXObject("Microsoft.XMLHTTP");}
else
{alert("Your browser does not support XMLHTTP!");}
ajax_obj.onreadystatechange=function()
{if(ajax_obj.readyState==4)
{var is_redirect=ajax_obj.responseText.split('redirect:#');if(is_redirect.length==1)
document.getElementById(id).innerHTML=ajax_obj.responseText;else
document.location.href=is_redirect[1];}
if(ajax_obj.readyState!=4)
{document.getElementById(loader_div).innerHTML='<img src="images/loading.gif" alt="Loading...">';}}
ajax_obj.open("GET",url,true);ajax_obj.send(null);}
function cart_update_ajax_fun_loader(url,id,loader_div)
{var ajax_obj;if(window.XMLHttpRequest)
{ajax_obj=new XMLHttpRequest();}
else if(window.ActiveXObject)
{ajax_obj=new ActiveXObject("Microsoft.XMLHTTP");}
else
{alert("Your browser does not support XMLHTTP!");}
ajax_obj.onreadystatechange=function()
{if(ajax_obj.readyState==4)
{var is_redirect=ajax_obj.responseText.split('redirect:#');if(is_redirect.length==1)
{document.getElementById(loader_div).innerHTML='<img src="images/loading.gif" alt="Loading...">';var second_url=url+'&gift=1'
cart_update_ajax_fun_loader_again(second_url,id,loader_div);}
else
{document.location.href=is_redirect[1];}}
if(ajax_obj.readyState!=4)
{document.getElementById(loader_div).innerHTML='<img src="images/loading.gif" alt="Loading...">';}}
ajax_obj.open("GET",url,true);ajax_obj.send(null);}
function cart_update_ajax_fun_loader_again(url,id,loader_div)
{var ajax_obj;if(window.XMLHttpRequest)
{ajax_obj=new XMLHttpRequest();}
else if(window.ActiveXObject)
{ajax_obj=new ActiveXObject("Microsoft.XMLHTTP");}
else
{alert("Your browser does not support XMLHTTP!");}
ajax_obj.onreadystatechange=function()
{if(ajax_obj.readyState==4)
{var is_redirect=ajax_obj.responseText.split('redirect:#');if(is_redirect.length==1)
{document.getElementById(id).innerHTML=ajax_obj.responseText;}
else
{document.location.href=is_redirect[1];}}
if(ajax_obj.readyState!=4)
{document.getElementById(loader_div).innerHTML='<img src="images/loading.gif" alt="Loading...">';}}
ajax_obj.open("GET",url,true);ajax_obj.send(null);}
function ajax_fun_reset(url,id)
{var ajax_obj;if(window.XMLHttpRequest)
{ajax_obj=new XMLHttpRequest();}
else if(window.ActiveXObject)
{ajax_obj=new ActiveXObject("Microsoft.XMLHTTP");}
else
{alert("Your browser does not support XMLHTTP!");}
ajax_obj.onreadystatechange=function()
{if(ajax_obj.readyState==4)
{document.getElementById(id).innerHTML=ajax_obj.responseText;gvalidator.autoApplyFormValidation();}
if(ajax_obj.readyState!=4)
{document.getElementById(id).innerHTML='<img height="200px" src="images/loading.gif" alt="Loading...">';}}
ajax_obj.open("GET",url,true);ajax_obj.send(null);}
function ajax_fun_ret(url,id)
{var ajax_obj;if(window.XMLHttpRequest)
{ajax_obj=new XMLHttpRequest();}
else if(window.ActiveXObject)
{ajax_obj=new ActiveXObject("Microsoft.XMLHTTP");}
else
{alert("Your browser does not support XMLHTTP!");}
ajax_obj.onreadystatechange=function()
{if(ajax_obj.readyState==4)
{return ajax_obj.responseText;}
if(ajax_obj.readyState!=4)
{document.getElementById(id).innerHTML='<img height="200px" src="images/loading.gif" alt="Loading...">';}}
ajax_obj.open("GET",url,true);ajax_obj.send(null);}
function ajax_fun_fill(url,id)
{var ajax_obj;if(window.XMLHttpRequest)
{ajax_obj=new XMLHttpRequest();}
else if(window.ActiveXObject)
{ajax_obj=new ActiveXObject("Microsoft.XMLHTTP");}
else
{alert("Your browser does not support XMLHTTP!");}
ajax_obj.onreadystatechange=function()
{if(ajax_obj.readyState==4)
{if(ajax_obj.responseXML)
{var response=ajax_obj.responseXML;document.getElementById(id).innerHTML=response.getElementsByTagName("disp_value")[0].childNodes[0].nodeValue;if(response.getElementsByTagName("products_model")[0].childNodes[0])
document.getElementById("prod_model").value=response.getElementsByTagName("products_model")[0].childNodes[0].nodeValue;if(response.getElementsByTagName("products_price")[0].childNodes[0])
document.getElementById("prod_price").value=response.getElementsByTagName("products_price")[0].childNodes[0].nodeValue;if(response.getElementsByTagName("products_date_available")[0].childNodes[0])
document.getElementById("prod_date_available").value=response.getElementsByTagName("products_date_available")[0].childNodes[0].nodeValue;if(response.getElementsByTagName("products_model")[0].childNodes[0])
document.getElementById("prod_warranty_period").value=response.getElementsByTagName("products_model")[0].childNodes[0].nodeValue;if(response.getElementsByTagName("products_quantity_order_min")[0].childNodes[0])
document.getElementById("prod_min_stock_qty").value=response.getElementsByTagName("products_quantity_order_min")[0].childNodes[0].nodeValue;if(response.getElementsByTagName("products_description")[0].childNodes[0])
document.getElementById("prod_tech_spec").innerHTML=response.getElementsByTagName("products_description")[0].childNodes[0].nodeValue;if(response.getElementsByTagName("products_description")[0].childNodes[0])
document.getElementById("prod_desc").innerHTML=response.getElementsByTagName("products_description")[0].childNodes[0].nodeValue;}
else
{document.getElementById(id).innerHTML=ajax_obj.responseText;}}
if(ajax_obj.readyState!=4)
{document.getElementById(id).innerHTML='<img height="200px" src="images/loading.gif" alt="Loading...">';}}
ajax_obj.open("GET",url,true);ajax_obj.send(null);}
var divid;function ajax_fun_compare(url,id)
{divid=id;document.getElementById(id).innerHTML='<img src="images/ajax-loader.gif" alt="Adding...">';if(window.XMLHttpRequest)
{http=new XMLHttpRequest();}
else if(window.ActiveXObject)
{http=new ActiveXObject("Microsoft.XMLHTTP");}
else
{http=GetXmlHttpObject();}
http.open("GET",url,true);http.send(null);http.onreadystatechange=statechange_comp;}
function statechange_comp()
{if(http.readyState==4)
{arr=http.responseText.split("@@");document.getElementById(divid).innerHTML=arr[0];document.getElementById("addto_compare_div_count").innerHTML='('+arr[1]+')';document.getElementById("divcomparenow").style.display="";document.getElementById("divcomparenow").innerHTML='<a class="takkidicomparelinks" href="index.php?main_page=product_comparision&categories_id='+arr[2]+'">Compare Now</a>';}}
function ajax_fun_compare1(url,id)
{divid=id;document.getElementById(id).innerHTML='<img src="images/ajax-loader.gif" alt="Adding...">';if(window.XMLHttpRequest)
{http=new XMLHttpRequest();}
else if(window.ActiveXObject)
{http=new ActiveXObject("Microsoft.XMLHTTP");}
else
{http=GetXmlHttpObject();}
http.open("GET",url,true);http.send(null);http.onreadystatechange=statechange_comp1;}
function statechange_comp1()
{if(http.readyState==4)
{arr=http.responseText.split("@@");document.getElementById(divid).innerHTML=arr[0];document.getElementById("addto_compare_div_count").innerHTML='('+arr[1]+')';document.getElementById("divcomparenow1").style.display="";document.getElementById("divcomparenow1").innerHTML='<a class="takkidicomparelinks" href="index.php?main_page=product_comparision&categories_id='+arr[2]+'">Compare Now</a>';}}
function ajax_fun_addnew(url,id)
{divid=id;document.getElementById(id).innerHTML='<img src="images/ajax-loader.gif" alt="Adding...">';if(window.XMLHttpRequest)
{http=new XMLHttpRequest();}
else if(window.ActiveXObject)
{http=new ActiveXObject("Microsoft.XMLHTTP");}
else
{http=GetXmlHttpObject();}
http.open("GET",url,true);http.send(null);http.onreadystatechange=statechange_add;}
function statechange_add()
{if(http.readyState==4)
{arr=http.responseText.split("@@");document.getElementById(divid).innerHTML=arr[0];document.getElementById("addto_compare_div_count").innerHTML='('+arr[1]+')';document.getElementById("divcomparenow").style.display="";document.getElementById("divcomparenow").innerHTML='<a class="takkidicomparelinks" href="index.php?main_page=product_comparision&categories_id='+arr[2]+'">Compare Now</a>';}}
