function $(id)
{
	return document.getElementById(id);
}

function toggle(id)
{
	$(id).style.display = $(id).style.display=='none'?"block":"none";
}

function openWin( loc, width, height, bResize, sHandle, bLockOpen, bScrollbars )
{
	if( arguments.length < 1 ) return;
	if( arguments.length < 2 ) width = 800;
	if( arguments.length < 3 ) height = 600;
	if( arguments.length < 4 ) bResize = false;
	if( arguments.length < 5 ) sHandle = false;
	if( arguments.length < 6 ) bLockOpen = false;
	if( arguments.length < 7 ) bScrollbars = false;

	var sLeft=(screen.width-width)/2, sTop=(screen.height-height)/2;
	var params = "height=" + height + ", width=" + width + ", top=" + sTop + ", left=" + sLeft + ", scrollbars=" + (bScrollbars?"yes":"no")+ ", resizable=" + (bResize?"yes":"no");
	window.open( loc, sHandle, params );
}

function ensureint(othis){if((window.event.keyCode<=57)&&(window.event.keyCode>=48)){window.event.returnValue=true;}else{window.event.returnValue=false;}}

function openBigPicWin(page,productId)
{
	
	width = 300;
	height = 300;
	var x = ((screen.width/2)-(width/2));
	var y = ((screen.height/2)-(height/2));
	var theUrl="index.cfm?page="+page+"&productId="+productId+"&showBigPic=1";
	openWin( theUrl, width, height, false, "p"+productId, 0, 0 );
	return false;
}

function testEmail(src) {
     var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
     var regex = new RegExp(emailReg);
     return regex.test(src);
}
