function getXmlHttpRequestObject(){if(window.XMLHttpRequest){return new XMLHttpRequest()}else{if(window.ActiveXObject){return new ActiveXObject("Microsoft.XMLHTTP")}}}var searchReq=getXmlHttpRequestObject();function statInsFav(a){if(searchReq.readyState==4||searchReq.readyState==0){searchReq.open("GET","act_ins_fav.php?ID="+a,true);searchReq.send(null)}}function statInsOFav(a){if(searchReq.readyState==4||searchReq.readyState==0){searchReq.open("GET","act_ins_ofav.php?ID="+a,true);searchReq.send(null)}}function AddFav(a){DelCookie(a);var b=new Date();b.setTime(b.getTime()+31104000000);FavID="";if(document.cookie.indexOf("FavID=")!=-1){p=document.cookie.indexOf(" FavID=")+1;p1=document.cookie.indexOf(";",p+5);if(p1==-1){p1=document.cookie.length}FavID=document.cookie.substring(p+6,p1)}if(FavID==""){FavID=a}else{FavID=FavID+","+a}document.cookie="FavID="+FavID+";expires="+b.toGMTString()+";path=/";statInsFav(a);alert("Listing was added to your favorites");return false}function AddOFav(a){DelOCookie(a);var b=new Date();b.setTime(b.getTime()+31104000000);OFavID="";if(document.cookie.indexOf("OFavID=")!=-1){p=document.cookie.indexOf(" OFavID=")+1;p1=document.cookie.indexOf(";",p+6);if(p1==-1){p1=document.cookie.length}OFavID=document.cookie.substring(p+7,p1)}if(OFavID==""){OFavID=a}else{OFavID=OFavID+","+a}document.cookie="OFavID="+OFavID+";expires="+b.toGMTString()+";path=/";statInsOFav(a);alert("Listing was added to your favorites");return false}function DelFav(a){DelCookie(a);location.reload();return false}function DelOFav(a){DelOCookie(a);location.reload();return false}function DelCookie(a){var b=new Date();b.setTime(b.getTime()+31104000000);FavID="";if(document.cookie.indexOf("FavID=")!=-1){p=document.cookie.indexOf(" FavID=")+1;p1=document.cookie.indexOf(";",p+5);if(p1==-1){p1=document.cookie.length}FavID=document.cookie.substring(p+6,p1)}if(FavID==""){FavID=""}else{p=FavID.indexOf(","+a+",");if(p!=-1){FavID=FavID.substring(0,p)+FavID.substring(p+a.length+1,FavID.length)}else{if(FavID.substring(0,a.length+1)==a+","){FavID=FavID.substring(a.length+1,FavID.length)}else{if(FavID.substring(FavID.length-a.length-1,FavID.length)==","+a){FavID=FavID.substring(0,FavID.length-a.length-1)}else{if(FavID==a){FavID=""}}}}}document.cookie="FavID="+FavID+";expires="+b.toGMTString()+";path=/"}function DelOCookie(a){var b=new Date();b.setTime(b.getTime()+31104000000);OFavID="";if(document.cookie.indexOf("OFavID=")!=-1){p=document.cookie.indexOf(" OFavID=")+1;p1=document.cookie.indexOf(";",p+6);if(p1==-1){p1=document.cookie.length}OFavID=document.cookie.substring(p+7,p1)}if(OFavID==""){OFavID=""}else{p=OFavID.indexOf(","+a+",");if(p!=-1){OFavID=OFavID.substring(0,p)+OFavID.substring(p+a.length+1,OFavID.length)}else{if(OFavID.substring(0,a.length+1)==a+","){OFavID=OFavID.substring(a.length+1,OFavID.length)}else{if(OFavID.substring(OFavID.length-a.length-1,OFavID.length)==","+a){OFavID=OFavID.substring(0,OFavID.length-a.length-1)}else{if(OFavID==a){OFavID=""}}}}}document.cookie="OFavID="+OFavID+";expires="+b.toGMTString()+";path=/"}function openPopup(a){window.open(a,"vrpopup","resizable=yes,scrollbars=yes,width=500,height=500");return false}function openPopup2(a){window.open(a,"vrpopup","resizable=yes,scrollbars=yes,width=630,height=630");return false};