// JavaScript Document
function addToWishList(mylink, windowname) {
  return popup(mylink, windowname);
}

function addToWishList_popup(mylink, windowname) {
  if (! window.focus) return true;
  var href;
  if (typeof(mylink) == 'string')
    href=mylink;
  else
   href=mylink.href;
  window_handle = window.open(href, windowname, 
  'width=350,height=450,scrollbars=yes,toolbar=no,titlebar=no,menubar=no,status=no,left=500,top=100');
  window_handle.focus();
  return false;
}

function Delete_WishList_popup(mylink, windowname) {
  if (! window.focus) return true;
  var href;
  if (typeof(mylink) == 'string')
    href=mylink;
  else
   href=mylink.href;
  window_handle = window.open(href, windowname, 
  'width=300,height=150,scrollbars=no,toolbar=no,titlebar=no,menubar=no,status=no,left=500,top=100');
  window_handle.focus();
  return false;
}

function update_mainWindow(mylink) {
  if (! window.focus) return true;
  var href;
  if (typeof(mylink) == 'string')
    href=mylink;
  else
   href=mylink.href;
   
  window.opener.location.href = href;
   
  if (window.opener.progressWindow) {
    window.opener.progressWindow.close()
  }
  window.close();
}

function refreshParent() {
  window.opener.location.href = window.opener.location.href;

  if (window.opener.progressWindow) {
    window.opener.progressWindow.close()
  }
  window.close();
}

function closeWindow_andChangeImg(imgId, newImgSrc) {
  if (! window.focus) return true;
  
  window.opener.document.getElementById(imgId).src = newImgSrc;
  window.opener.document.getElementById(imgId).style.width = "22px";
  window.opener.document.getElementById(imgId).style.height = "22px";
  
  
  if (window.opener.progressWindow) {
    window.opener.progressWindow.close()
  }
  window.close();
}

