function popaccentsub() {
  var s, page, width, height;
  
  width = 535;
  height = 525;
  
  s = document.location.href;
  s = escape(s);
  
  page = '/seeninprint/subscribe.htm';
  
  remote = window.open('','r','width=' + width + ',height=' + height + ',toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0');
  if (remote != null) {
    if (remote.opener == null)
      remote.opener = self;        
    remote.location.href = page;
  }
  setTimeout("remote.focus()",200);
  return false;
}

function popcontact() {
  var s, page, width, height;
  
  width = 530;
  height = 550;
  
  s = document.location.href;
  s = escape(s);
  
  page = '/contact-popup.htm?url=' + s;
  
  remote = window.open('','r','width=' + width + ',height=' + height + ',toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0');
  if (remote != null) {
    if (remote.opener == null)
      remote.opener = self;        
    remote.location.href = page;
  }
  setTimeout("remote.focus()",200);
  return false;
}

if (document.images) 
{
  var enabled = 1;
}

function rollOn(imageName, imageSrc) {
		if (enabled) {
			document[imageName].src = "images/"+imageSrc+".gif";
		}
}

function rollOnInterior(imageName, imageSrc) {
		if (enabled) {
			document[imageName].src = "../images/"+imageSrc+".gif";
		}
}

function rollOff(imageName, imageSrc) {
		if (enabled) {
			document[imageName].src = "images/"+imageSrc+".gif";
		}
}

function rollOffInterior(imageName, imageSrc) {
		if (enabled) {
			document[imageName].src = "../images/"+imageSrc+".gif";
		}
}

function winOpen(pageName)
{
  window.open(pageName,"","width=600,height=375,toolbar=no,location=no,scrollbars=no,status=no,resizable=no")
}

function winOpen2(pageName)
{
  window.open(pageName,"","width=600,height=487,toolbar=no,location=no,scrollbars=yes,status=no,resizable=no")
}

function winOpen3(pageName)
{
  window.open(pageName,"","width=600,height=535,toolbar=no,location=no,scrollbars=yes,status=no,resizable=no")
}

function winOpen4(pageName)
{
  window.open(pageName,"","width=547,height=535,toolbar=no,location=no,scrollbars=yes,status=no,resizable=no")
}


function winOpenGeneric(theURL, winName, width, height, otherfeatures)
{
	if (document.all || document.layers)
	{
		w = screen.availWidth;
		h = screen.availHeight;
	}

	var popW;
	var popH;

	//Establish the width of the window
	if(width == 0)
		popW = w - 200;
	else
		popW = width;
	
	//Establish the height of the window
	if(height == 0)
		popH = h - 150;
	else
		popH = height


	var leftPos = (w-popW)/2;
	var topPos = (h-popH)/2;

	if(otherfeatures=='')
		features=''
	else
		features="," + otherfeatures

	window.open(theURL,winName,'width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos + features);
}


function addToCart(url, inStock, sku) {
	if (inStock == 0) {
		winOpen3('../misc/out_of_stock_popup.htm?sku=' + sku)			
	}
	else {
		location.href = url
	}
}				


function selectAll()
{
	for(i=0;i<document.formMain.elements.length;i++)
	{
		if(document.formMain.elements[i].type=='checkbox')
			if(document.formMain.SelectAll.checked==true)
				document.formMain.elements[i].checked=true
			else
				document.formMain.elements[i].checked=false
	}
}

function chkSelected()
{
	var bSelected = 0;
	for(i=0;i<document.formMain.elements.length;i++)
	{
		if(document.formMain.elements[i].type=='checkbox')
			if(document.formMain.elements[i].checked==true)
			{
				bSelected = 1;
				break;
			}
	}
	return bSelected;
}



