

var tcdacmd="dt";
var ANS_customer_id="e9681d3e-eead-4276-805a-74d2888d2419";
function popupWindow(url){window.open(url, 'popupWindow', 'toolbar = no, location = no, directories = no, status = no, menubar = no, scrollbars = yes, resizable = yes, copyhistory = no, width = 400, height = 400, screenX = 150, screenY = 150, top = 150, left = 150');}
function popupWindowExtra(url){window.open(url, 'popupWindow', 'toolbar = no, location = no, directories = no, status = no, menubar = no, scrollbars = yes, resizable = yes, copyhistory = no, width = 400, height = 400, screenX = 150, screenY = 150, top = 150, left = 150');}
function toggle(element){var id = document.getElementById(element);if(id.style.display == 'none'){id.style.display = '';}else{id.style.display = 'none';}}
function disable(element){document.getElementById(element).style.display = 'none';}
function enable(element){document.getElementById(element).style.display = '';}
function setBookmark(){if (document.all)window.external.AddFavorite(location.href, document.title);else alert('Click \'OK\' then Press CTRL and D to add a bookmark to:\n"' + document.title);} 
function phpOnlinePopupWindow() 
{
  var url = "http://thepartyworks.com/livechat/client.php";
  window.open(url,'popupWindow2','toolbar=yes,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=550,height=400,screenX=150,screenY=150,top=150,left=150');
}

function getElementsByClassName(strClass, strTag, objContElm) {
  strTag = strTag || "*";
  objContElm = objContElm || document;
  var objColl = objContElm.getElementsByTagName(strTag);
  if (!objColl.length &&  strTag == "*" &&  objContElm.all) objColl = objContElm.all;
  var arr = new Array();
  var delim = strClass.indexOf('|') != -1  ? '|' : ' ';
  var arrClass = strClass.split(delim);
  for (var i = 0, j = objColl.length; i < j; i++) {
    var arrObjClass = objColl[i].className.split(' ');
    if (delim == ' ' && arrClass.length > arrObjClass.length) continue;
    var c = 0;
    comparisonLoop:
    for (var k = 0, l = arrObjClass.length; k < l; k++) {
      for (var m = 0, n = arrClass.length; m < n; m++) {
        if (arrClass[m] == arrObjClass[k]) c++;
        if (( delim == '|' && c == 1) || (delim == ' ' && c == arrClass.length)) {
          arr.push(objColl[i]);
          break comparisonLoop;
        }
      }
    }
  }
  return arr;
}

// To cover IE 5.0's lack of the push method
Array.prototype.push = function(value) {
  this[this.length] = value;
}
function disableProducts()
{
  var products = getElementsByClassName('quickView');

  for (i = 0; i < products.length; i++)
  {
    products[i].style.display = 'none';
  }
}

function disableTab(element)
{
  var id = document.getElementById(element);

  id.style.background="#eee";
  id.style.borderBottom="";
  id.style.color="#444"
}

function enableTab(element)
{
  var id = document.getElementById(element);

  id.style.background="#fff";
  id.style.borderBottom="2px solid #fff";
  id.style.color="#000"
}

function getScrollXY() 
{
  var scrOfX = 0, scrOfY = 0;

  if( typeof( window.pageYOffset ) == 'number' ) 
  {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } 
  else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) 
  {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } 
  else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) 
  {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return scrOfY;
}

function getScrollXY() 
{
  var scrOfX = 0, scrOfY = 0;

  if( typeof( window.pageYOffset ) == 'number' ) 
  {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } 
  else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) 
  {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } 
  else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) 
  {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return scrOfY;
}

function quickviewButtonOnclick(productID)
{
  var product    = "product_" + productID;
  var vertical   = getScrollXY() + 20 + "px"; 
  var horizontal = screen.width / 2; 

  document.getElementById(product).style.top  = vertical; 
  document.getElementById(product).style.left = horizontal + "px"; 

  disableProducts(); 
  enable(product); 
//  xajax_getProductInfo(productID);
}