var overOff = false;
function navSwap(imgName){
	if(overOff == false){
		document.getElementById(imgName.id).src = String("/images/nav/nav_"+imgName.id+"1.jpg");
		overOff = true;
	}
	else{
		document.getElementById(imgName.id).src = String("/images/nav/nav_"+imgName.id+"0.jpg");
		overOff = false;
	}
}

function nShow(){
	document.getElementById('note').style.left = (eval(document.body.clientWidth / 2) - 200);
	document.getElementById('note').style.visibility = 'visible';
	window.location = '#toc';
}
function nHide(){
	document.getElementById('note').style.visibility = 'hidden';
}

function qtyAdd() {
	document.forms(0).qty.value = parseFloat(document.forms(0).qty.value)+1;
}
function qtyDel() {
	document.forms(0).qty.value = parseFloat(document.forms(0).qty.value)-1;
}

//NetSell: IsNumeric Function
function IsNumeric(number) {
	Numeric = true;
	VarLen = number.length;

	for (i = 0; i <= VarLen-1; i++) {
		if (number.charAt(i) < "0" || number.charAt(i) > "9") {
			Numeric = false;
		}
	}
	return(Numeric);
}

//NetSell: Increment Qty Value Function		
function IncrementQty(number) {
	if (IsNumeric(number))
	{
		number = eval(number) + 1;
		if (number >= 999)
		{
			number = 999;
		}
		return(number);
	} else {
		return(1);
	}
}

//NetSell: Decrement Qty Value Function
function DecrementQty(number) {
	if (IsNumeric(number))
	{
		number = eval(number) - 1;
		if (number <= 0)
		{
			number = 0;
		}
		return(number);
	} else {
		return(0);
	}
}


function enlargeImg(fname, xsize, ysize){
	var wsize = parseInt(xsize) + 20;
	var hsize = parseInt(ysize) + 114;
	countum += 1;
	
	var newWindow = window.open("", ""+countum+"", "width="+wsize+",height="+hsize+",scrollbars=no,resizable=no,toolbar=no");
	newWindow.document.write(
			'<html>' +
			'<head>' +
				'<title>'+fname+'</title>' +
				'<link rel="stylesheet" type="text/css" href="ext/style.css">' +
			'</head>' +
			'<body>' +
				'<table cellspacing="0" cellpadding="0" border="0" width="100%" height="100%">' +
					'<tr height="'+eval(parseInt(ysize)+20)+'">' +
						'<td align="center" valign="middle"><img src="'+fname+'" width="'+xsize+'" height="'+ysize+'" style="border: 2px solid #666;"></td>' +
					'</tr>' +
					'<tr height="29">' +
						'<td valign="bottom" bgcolor="#666666" align="right"><a href="javascript: window.close();"><img src="images/close_0.gif" onmouseover="this.src=\'images/close_1.gif\';" onmouseout="this.src=\'images/close_0.gif\';" border="0"></a>&nbsp; &nbsp;</td>' +
					'</tr>' +
				'</table>' +
			'</body>' +
			'</html>'
	);
}

function helpBox(w,h,b,t,d) {
	var newWindow = window.open("", "HelpBox", "width="+w+",height="+h+",scrollbars=no,resizable=no,toolbar=no");
	newWindow.document.write(
		'<html>'+
		'<head>'+
			'<title>HelpBox</title>'+
			'<link rel="stylesheet" type="text/css" href="/ext/style.css">'+
		'</head>'+
		'<body>'+
		'<table cellspacing="0" cellpadding="6" width="100%" height="'+h+'px" border="0">'+
		'<tr height="18px"><td style="border-bottom: 1px solid #999; background: #ccc;"><h3 style="font-size:12px;">'+t+'</td><td style="border-bottom: 1px solid #999; background: #ccc; text-align: right;"><a href="javascript:window.close();"><img border="0" src="/images/close0.gif" alt="Click to close this window" onmouseover="this.src=\'/images/close1.gif\';" onmouseout="this.src=\'/images/close0.gif\';"></a>&nbsp;</td></tr>'+
		'<tr><td colspan="2"><table cellspacing="'+b+'" cellpadding="0" border="0" width="100%"><tr>' +
		'<td>'+d+'</td>' +
		'</tr></table></td></tr>'+
		'</table>'+
		'</body></html>'
	);
	
}

function LaunchWindow(winname,winurl,winwidth,winheight) {
	var newWindow = window.open(winurl, winname, "width="+winwidth+",height="+winheight+",scrollbars=1,resizable=0,toolbar=0");
}
