function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

if(top.frames.length != 0) {
top.location = document.URL;
}

function openWindow(url, name) {
		popupWin = window.open(url, name, 'scrollbars,resizable,menubar=no,toolbar=no,location=no,width=620,height=550')
}

function AddEmail() 
{ 
popupWin = window.open('http://www.tonerworld.com/emailadd.asp', 'emailadd','location=no,scrollbars=yes,width=625,height=430'); 
window.name = 'opener'; 
} 

function TellFriend() 
{ 
popupWin = window.open('http://www.tonerworld.com/TellFriend.asp', 'TellFriend','location=no,scrollbars=yes,width=630,height=540'); window.name = 'opener'; 
} 

function recycle() 
{ 
popupWin = window.open('http://www.tonerworld.com/recycle_soon.asp', 'Recycle','location=no,scrollbars=yes,width=520,height=437'); 
window.name = 'opener'; 
} 

function RetTerms() 
{ 
popupWin = window.open('http://www.tonerworld.com/ReturnPolicyTerms.asp', 'CustList','location=no,scrollbars=yes,width=550,height=640'); window.name = 'opener'; 
} 

function verisign_display(url) {
popupWin = window.open('http://digitalid.verisign.com/as2/446a68c8c37f8554ff9d98a163b87fd1', 'VeriSign','location=no,scrollbars=yes,width=520,height=437'); 
window.name = 'opener';
} 

function Rcertify() 
{ 
popupWin = window.open('http://www.bbbonline.org/cks.asp?id=10012219463113744', 'Participant','location=no,scrollbars=yes,width=450,height=458'); 
window.name = 'opener'; 
} 

function CustList() 
{ 
popupWin = window.open('http://www.tonerworld.com/CustList.htm', 'CustList','location=no,scrollbars=yes,width=450,height=458'); 
window.name = 'opener'; 
} 

function ShipQues() 
{ 
popupWin = window.open('http://www.tonerworld.com/shippingquestions.asp', 'ShipQues','location=no,scrollbars=yes,width=450,height=358');
window.name = 'opener'; 
}

function PvtlblDet() 
{ 
popupWin =window.open('http://www.tonerworld.com/PvtLabelFaq.asp','SpecDet','location=no,scrollbars=yes,width=500,height=408'); 
window.name = 'opener'; 
} 

function Validator(SearchForm)
{

  if (SearchForm.MfgID.selectedIndex == 0)
  {
    alert("The first \"Select Manufacturer\" option is not a valid selection. Please select one of the other options.");
    SearchForm.MfgID.focus();
    return (false);
  }

//  if (SearchForm.Cat.selectedIndex == 0)
//  {
//    alert("The first \"Select Category\" option is not a valid selection. Please select one of the other options.");
//    SearchForm.Cat.focus();
//    return (false);
//  }

if (SearchForm.SCr.value == "")
  {
    alert("Please enter at least 3 characters in the \"search field\" so we can locate your product.");
    SearchForm.SCr.focus();
    return (false);
  }

if (SearchForm.SCr.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"search field\" so we can locate your product.");
    SearchForm.SCr.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-/ ";
  var checkStr = SearchForm.SCr.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("You have entered invalid characters in the search field Please double-check your search information.");
    SearchForm.SCr.focus();
    return (false);
  }

  return (true);
}

function validLogin(MemberLoginForm)
{
  if (MemberLoginForm.TWUsername.value.indexOf('@', 0) == -1)
  {
    alert("Please enter a valid E-mail address in the \"Login\" field.");
    MemberLoginForm.TWUsername.focus();
	return false;
  }

  if (MemberLoginForm.TWUsername.value == "")
  {
    alert("Please enter a valid E-mail address in the \"Login\" field.");
    MemberLoginForm.TWUsername.focus();
    return (false);
  }

  if (MemberLoginForm.TWUsername.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"Login\" field.");
    MemberLoginForm.TWUsername.focus();
    return (false);
  }

  if (MemberLoginForm.TWPassword.value == "")
  {
    alert("Please enter a value for the \"Password\" field.");
    MemberLoginForm.TWPassword.focus();
    return (false);
  }

  if (MemberLoginForm.TWPassword.value.length < 4)
  {
    alert("Please enter at least 4 characters in the \"Password\" field.");
    MemberLoginForm.TWPassword.focus();
    return (false);
  }

  return (true);
}

function confirmSubmit()
{
var agree=confirm("Are you certain you want to Log-Off from your Account?");
if (agree)
	return true ;
else
	return false ;
}

	function mailstopbc()
	{ 
	var bcuser = "bruce";
	var domain = "tonerworld.com";
	window.open('mailto:' + bcuser + '@' + domain,'Mail','width="0",height="0",resizable="no"'); 
	}

	function mailstoprh()
	{ 
	var rhuser = "ryan";
	var domain = "tonerworld.com";
	window.open('mailto:' + rhuser + '@' + domain,'Mail','width="0",height="0",resizable="no"'); 
	}

	function mailstopkb()
	{ 
	var kbuser = "kevin";
	var domain = "tonerworld.com";
	window.open('mailto:' + kbuser + '@' + domain,'Mail','width="0",height="0",resizable="no"'); 
	}

	function mailstopse()
	{ 
	var seuser = "sara";
	var domain = "tonerworld.com";
	window.open('mailto:' + seuser + '@' + domain,'Mail','width="0",height="0",resizable="no"'); 
	}

	function mailstopkl()
	{ 
	var kluser = "kristen";
	var domain = "tonerworld.com";
	window.open('mailto:' + kluser + '@' + domain,'Mail','width="0",height="0",resizable="no"'); 
	}

	function mailstopsc()
	{ 
	var scuser = "stephanie";
	var domain = "tonerworld.com";
	window.open('mailto:' + bcuser + '@' + domain,'Mail','width="0",height="0",resizable="no"'); 
	}

	function mailstoptwadmin()
	{ 
	var twadminuser = "admin";
	var domain = "tonerworld.com";
	window.open('mailto:' + twadminuser + '@' + domain,'Mail','width="0",height="0",resizable="no"'); 
	}

	function mailstoptwsales()
	{ 
	var twsalesuser = "sales";
	var domain = "tonerworld.com";
	window.open('mailto:' + twsalesuser + '@' + domain,'Mail','width="0",height="0",resizable="no"'); 
	}

	function mailstoptwreturns()
	{ 
	var twreturnsuser = "returns";
	var domain = "tonerworld.com";
	window.open('mailto:' + twreturnsuser + '@' + domain,'Mail','width="0",height="0",resizable="no"'); 
	}

	function mailstoptwacctg()
	{ 
	var twacctguser = "accounting";
	var domain = "tonerworld.com";
	window.open('mailto:' + twacctguser + '@' + domain,'Mail','width="0",height="0",resizable="no"'); 
	}

	function mailstoptwcustsvc()
	{ 
	var twcustsvc = "customerservice";
	var domain = "tonerworld.com";
	window.open('mailto:' + twcustsvc + '@' + domain,'Mail','width="0",height="0",resizable="no"'); 
	}

	function mailstoptwtrack()
	{ 
	var twtrack = "tracking";
	var domain = "tonerworld.com";
	window.open('mailto:' + twtrack + '@' + domain,'Mail','width="0",height="0",resizable="no"'); 
	}

	function mailstoptwprivacy()
	{ 
	var twpriv = "privacy";
	var domain = "tonerworld.com";
	window.open('mailto:' + twpriv + '@' + domain,'Mail','width="0",height="0",resizable="no"'); 
	}

	function mailstoptwhelp()
	{ 
	var twhelp = "help";
	var domain = "tonerworld.com";
	window.open('mailto:' + twhelp + '@' + domain,'Mail','width="0",height="0",resizable="no"'); 
	}

	function mailstoptwcancel()
	{ 
	var twcancel = "cancel";
	var domain = "tonerworld.com";
	window.open('mailto:' + twcancel + '@' + domain,'Mail','width="0",height="0",resizable="no"'); 
	}

	function mailstoptwcatalog()
	{ 
	var twcatreq = "catalogrequest";
	var domain = "tonerworld.com";
	window.open('mailto:' + twcatreq + '@' + domain,'Mail','width="0",height="0",resizable="no"'); 
	}

	function mailstoptwclubmem()
	{ 
	var twclubmem = "clubmember";
	var domain = "tonerworld.com";
	window.open('mailto:' + twclubmem + '@' + domain,'Mail','width="0",height="0",resizable="no"'); 
	}