PreloadImages();function PreloadImages(){var a;a=new Image();a.setAttribute("src","/images/cards/add_"+fav_string+"_off2.gif");a.setAttribute("src","/images/cards/add_"+fav_string+"_on2.gif");a.setAttribute("src","/images/cards/add_favourite_load.gif");a.setAttribute("src","/images/cards/not_interested_on2.gif");a.setAttribute("src","/images/cards/not_interested_off2.gif");a.setAttribute("src","/images/cards/not_interested_load.gif");a=null}function AJAX(a,b){var c;Initialize();if(blnSupportsXMLHTTP){c=AddValueToURL(a.getAttribute("href"),"ajax=1");return SendXMLHTTP(c,b)}else{return true}}function FavouriteRemoved(a){var b=function(){if(document.getElementById("fav_link_"+a)){document.getElementById("fav_link_"+a).setAttribute("href","/addfavourite.aspx?m="+a+"&amp;url="+escape(document.location.href));document.getElementById("fav_img_"+a).setAttribute("src","/images/cards/add_"+fav_string+"_off2.gif");document.getElementById("fav_img_"+a).setAttribute("alt","Add to "+fav_string+"s")}};setTimeout(b,500)}function FavouriteAdded(a){NotInterestedUnset(a);var b=function(){if(document.getElementById("fav_link_"+a)){document.getElementById("fav_link_"+a).setAttribute("href","/removefavourite.aspx?m="+a+"&amp;url="+escape(document.location.href));document.getElementById("fav_img_"+a).setAttribute("src","/images/cards/add_"+fav_string+"_on2.gif");document.getElementById("fav_img_"+a).setAttribute("alt","Remove from "+fav_string+"s")}};setTimeout(b,500)}function FavouriteLoading(a){if(document.getElementById("fav_link_"+a)){document.getElementById("fav_link_"+a).setAttribute("href","");document.getElementById("fav_img_"+a).setAttribute("src","/images/cards/add_favourite_load.gif");document.getElementById("fav_img_"+a).setAttribute("alt","Saving")}}function FavouriteToggle(c,b,f){var a,e,d;e=document.getElementById("fav_img_"+b).getAttribute("src");if(e.indexOf("add_favourite_load")>0){return false}if(e.indexOf("add_"+fav_string+"_off")>0){d="FavouriteRemoved( "+b+" );"}else{d="FavouriteAdded( "+b+" );"}a=AJAX(c,d);if(!a){FavouriteLoading(b)}return a}function NotInterestedSet(a){FavouriteRemoved(a);var b=function(){if(document.getElementById("int_link_"+a)){document.getElementById("int_link_"+a).setAttribute("href","/restorematch.aspx?m="+a+"&amp;url="+escape(document.location.href));document.getElementById("int_img_"+a).setAttribute("src","/images/cards/not_interested_on2.gif");document.getElementById("int_img_"+a).setAttribute("alt","Restore to matches")}};setTimeout(b,500)}function NotInterestedUnset(a){var b=function(){if(document.getElementById("int_link_"+a)){document.getElementById("int_link_"+a).setAttribute("href","/removematch.aspx?m="+a+"&amp;url="+escape(document.location.href));document.getElementById("int_img_"+a).setAttribute("src","/images/cards/not_interested_off2.gif");document.getElementById("int_img_"+a).setAttribute("alt","Not interested")}};setTimeout(b,500)}function NotInterestedLoading(a){if(document.getElementById("int_link_"+a)){document.getElementById("int_link_"+a).setAttribute("href","");document.getElementById("int_img_"+a).setAttribute("src","/images/cards/not_interested_load.gif");document.getElementById("int_img_"+a).setAttribute("alt","Saving")}}function NotInterestedToggle(c,b,f){var a,e,d;e=document.getElementById("int_img_"+b).getAttribute("src");if(e.indexOf("not_interested_load")>0){return false}if(e.indexOf("not_interested_off")>0){d="NotInterestedUnset( "+b+" );"}else{d="NotInterestedSet( "+b+" );"}a=AJAX(c,d);if(!a){NotInterestedLoading(b)}return a}function RemoveProfile(b,a){if(document.getElementById("rem_txt_"+a)&&document.getElementById("rem_txt_"+a).innerHTML&&document.getElementById("rem_txt_"+a).style){b.setAttribute("href",AddValueToURL(b.getAttribute("href"),"txt=1"));return AJAX(b)}else{return true}return false}function RemoveProfileReturn(a){document.getElementById("rem_txt_"+a).innerHTML="Removed";document.getElementById("rem_txt_"+a).style.fontSize="0.9em"}function AddValueToURL(a,b){a=String(a);if(a.indexOf("?",0)<0){a=a+"?"}if(a.charAt(a.length-1)!="&"&&a.charAt(a.length-1)!="?"){a=a+"&"}a=a+b;return a};
