
/*** ICOMMERCE ***/

function init(page)
{
	switch (page)
	{
		case	"iContact":
		case	"memberCheck":
		{
			getVerificationImage('');
			break;
		}
	}
}


function verifyQuantity(theField)
{
	var theValue	= theField.value;
	
	if (theValue.length < 1)	theField.value = "1";
	if (isNaN(theValue))		theField.value = "1";
	theValue					= theValue - 0;
	if (theValue < 1)   		theField.value = "1";
}
function verifyPrice(theField)
{
	var theValue				= theField.value;

	if (theValue.length < 1)	theField.value  = "0.00";
	if (isNaN(theValue))		theField.value  = "0.00";
	theValue					= theValue - 0;
	if (theValue < 1) 			theField.value	= "0.00";
}
/*** GENERAL FORM CHECKING TOOLS ***/

function isFieldEmpty(theField)
{
	return (theField.value.length < 1) ? true : false;
}
function isFieldBadEmail(theField)
{
	theEmail = theField.value;
	if (theEmail.indexOf('@')==-1 || theEmail.indexOf('.')==-1 || theEmail.length<6) return true;
	return false;
}
function clearQuotes(theForm)
{
	for (i = 0; i < theForm.elements.length; i++)
	{
		if (theForm.elements[i].value) theForm.elements[i].value = theForm.elements[i].value.replace(/'/gi,"`");
	}
}

function showPicture(theImage,width,height)
{
	if (width > 800)	width = 800;
	if (height > 600)   height = 600;
	
	showPictureWindow = window.open ("http://"+self.location.host+"/"+"story/showPicture.php?id=" + theImage, 
		'showPicture', 'toolbar=0,location=0,directories=0=0,menubar=0,scrollbars=1,resizable=1,height='+height+',width='+width);
	showPictureWindow.focus();
}

function PopUp(thisURL) {
	var thePopWindow = window.open(thisURL,"thePopWindow","width=522,height=600,resizable,scrollbars");
}