function Hide(pcode)
{
alert('load_box_'+pcode);
//document.getElementById("ucode").fade({duration: 0.5});
$('load_box_'+pcode).fade({duration: 0.5});
}
function Show(pcode)
{
alert('load_box_'+pcode);
//document.getElementById("ucode").appear({ duration: 0.5 });
$('load_box_'+pcode).appear({ duration: 0.5 });
} 
function ShowBox(pcode)
{
Show(pcode); 
setTimeout("Hide(pcode)", 2000);
}

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1; 
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return document.cookie.substring(c_start,c_end);
    } 
  }
return "";
}

function WishList(ucode,pcode,addr){
var now = new Date();
now.setTime(now.getTime() + 1000 * 60 * 60 * 24 * 365);
var check = getCookie("favorites");
if (check!="" && check!=null){
var cook_chunk = check.split(":");
abc=0;
for (i = 0; i < cook_chunk.length; i++){
if(cook_chunk[i]==ucode){
alert(addr+" is alredy in your favorites list.");	
abc=1;
}
}
if(abc==0){
//ShowBox(pcode);
document.cookie = "favorites=" +check+":"+escape(ucode)+";path=/;domain=.bergerrealty.com;expires=" + now;
alert(addr+" is added into your favorites list.");
}
}
else{
//start new cookie
//ShowBox(pcode);
document.cookie = "favorites=" + escape(ucode)+";path=/;domain=.bergerrealty.com;expires=" + now;
alert(addr+" is added into your favorites list.");
}
}//ends function

