<!--
var ns4 = document.layers;
var op5 = (navigator.userAgent.indexOf("Opera 5")!=-1)||(navigator.userAgent.indexOf("Opera/5")!=-1);
var op6 = (navigator.userAgent.indexOf("Opera 6")!=-1)||(navigator.userAgent.indexOf("Opera/6")!=-1);
var agt=navigator.userAgent.toLowerCase();
var mac = (agt.indexOf("mac")!=-1);
var ie = (agt.indexOf("msie") != -1);
var mac_ie = mac && ie;

function PopUp(url, header, width, height)
{
  myWindow = window.open(url, header, "width="+width+",height="+height+",resizable=yes");
  window.myWindow.focus();
}

function PopUp1(url, name, height, width)
{
  var w=window.open(url, name,"width="+width+",height="+height+",resizable=1,toolbar=0,location=0,status=0,menubar=0,directories=0,scrollbars=yes,top=0,left=0");
  w.focus();
}

function resizeWindow(width, height)
{
  window.resizeTo(width, height);
}

function setShipping(obj)
{
  if(obj.shippingMode.checked == true)
    {
      obj.shippingFirstName.value         = obj.billingFirstName.value;
      obj.shippingLastName.value          = obj.billingLastName.value;
      obj.shippingCompanyName.value       = obj.billingCompanyName.value;

      obj.shippingCountryId.selectedIndex = obj.billingCountryId.selectedIndex;

      obj.shippingAddress1.value          = obj.billingAddress1.value;
      obj.shippingAddress2.value          = obj.billingAddress2.value;
      obj.shippingCity.value              = obj.billingCity.value;


      obj.shippingStateId.selectedIndex   = obj.billingStateId.selectedIndex;
      obj.shippingZip.value               = obj.billingZip.value;
      obj.shippingPhone.value             = obj.billingPhone.value;
      obj.shippingFax.value               = obj.billingFax.value;
      xajax_getStates('selectShippingStateId', obj.shippingCountryId.value, obj.billingStateId.value, 'shippingStateId');
    }
  else
    {
      obj.shippingFirstName.value         = '';
      obj.shippingLastName.value          = '';
      obj.shippingCompanyName.value       = '';
      obj.shippingCountryId.selectedIndex = '';
      obj.shippingAddress1.value          = '';
      obj.shippingAddress2.value          = '';
      obj.shippingCity.value              = '';

      obj.shippingStateId.selectedIndex   = '';
      obj.shippingZip.value               = '';
      obj.shippingPhone.value             = '';
      obj.shippingFax.value               = '';
      xajax_getStates('selectShippingStateId', obj.shippingCountryId.value, '', 'shippingStateId');
    }
}

function getElementHeight(Elem)
{
	 if (ns4)
	 {
		  var elem = getObjNN4(document, Elem);
		  return elem.clip.height;
	 }
	 else
	 {
		  if(document.getElementById)
			   var elem = document.getElementById(Elem);
		  else if (document.all)
			   var elem = document.all[Elem];

			 if (op5)
			   xPos = elem.style.pixelHeight;
		  else
			   xPos = elem.offsetHeight;

		  return xPos;
	 }
}

function getElementWidth(Elem)
{
	 if (ns4)
	 {
		  var elem = getObjNN4(document, Elem);
		  return elem.clip.width;
	 }
	 else
	 {
		  if(document.getElementById)
			   var elem = document.getElementById(Elem);
		  else if (document.all)
			   var elem = document.all[Elem];

		  if (op5)
		    xPos = elem.style.pixelWidth;
		  else
		    xPos = elem.offsetWidth;

		  return xPos;
	 }
}

function showPleaseWait(flag, element)
{
  var divWait = document.getElementById('pleaseWait');
  var divContent = document.getElementById(element);
  var tableWait = document.getElementById('pleaseWaitTable');

  if(flag==true)
  {
    tableWait.style.height = getElementHeight(element) + "px";
    divWait.style.display = "block";
    divContent.style.display = "none";
  }
  else
  {
    divWait.style.display = "none";
    divContent.style.display = "block";
  }
}

function f(tdName) {
  var td = document.getElementById(tdName);
  td.style.backgroundImage='url(images/menuOverBg.gif)';
  td.style.backgroundRepeat='repeat-x';
  td.style.backgroundPosition='bottom';
}

function fo(tdName) {
  var td = document.getElementById(tdName);
  td.style.background='transparent';
}

function getBrowser(objectName)
{
  if (document.all) {
    if (window.ActiveXObject) document.getElementById(objectName).style.marginLeft='0px';
    else document.getElementById(objectName).style.marginLeft='50%';
  } else {
    document.getElementById(objectName).style.marginLeft='50%';
  }
}

function fullInfoView(id, id1)
{
  var trFullInfo = document.getElementById(id);
  var tdFullInfo = document.getElementById(id1);

  if (trFullInfo.style.display == "none")
  {
    tdFullInfo.innerHTML = "<a href='#' onClick=\"fullInfoView('"+id+"', '"+id1+"'); return false;\" style=\"font-size: 16px; text-decoration: none;\" title=\"View Details\"><img src=\"images/minus.gif\" alt=\"\" /></a>";
    if (ie)
      trFullInfo.style.display = "inline";

    else
      trFullInfo.style.display = "table-row";
  }
  else
  {
    tdFullInfo.innerHTML = "<a href=\"#\" onClick=\"fullInfoView('"+id+"', '"+id1+"'); return false;\" style=\"font-size: 16px; text-decoration: none;\" title=\"View Details\"><img src=\"images/plus.gif\" alt=\"\" /></a>";
    trFullInfo.style.display = "none";
  }
}

function mail(id, section)
{
  PopUp('mail.php?section='+section+'&id='+id, 'email', 330, 700);
}


function checkInfoBoxes (num)
{
  var checkbox = document.getElementById('ch'+num);
  document.getElementById('chId'+num).checked    = checkbox.checked;
  document.getElementById('chName'+num).checked = checkbox.checked;
  document.getElementById('chPrice'+num).checked = checkbox.checked;
  document.getElementById('chDesc'+num).checked  = checkbox.checked;
  document.getElementById('chImg'+num).checked  = checkbox.checked;
}

function offers(itemSection, itemId, stockNoName, totalPriceName, description, img)
{
  PopUp('offer.php?task=add&itemSection=' +itemSection+ '&id=' +itemId+ '&name=' +stockNoName+ '&price=' +totalPriceName+ '&description=' +description+ '&img=' +img, 'Offers', 800, 700);
}
//-->
