
var postLocation="/catalog/scripts/php/pgbar.php";
var re = /^(\.php)|(\.sh)/;  // disallow shell scripts and php
var dofilter=false;
function check_types() {
	if(dofilter==false) return true;
	with(document.forms[0]){
		/*
		 * with who uses with?
		 * i do, i am an ancient. ok?
		 */
		
		for(i=0 ; i < elements.length ; i++) {
			if(elements[i].value.match(re)){
				alert('Sorry ' + elements[i].value + ' is not allowed');
				return false;
			}
		}
	}
	return true;
}

function popUP(mypage, myname, w, h, scroll, titlebar) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) {
		win.window.focus();
	}
}



function postIt(theForm) {
	baseUrl = postLocation;
	sid = theForm.sessionid.value;
	iTotal = escape("-1");
	baseUrl += "?iTotal=" + iTotal;
	baseUrl += "&iRead=0";
	baseUrl += "&iStatus=1";
	baseUrl += "&sessionid=" + sid;
//	var testsqft = document.product_info.sqft.value; 
	var uploadedfile = theForm.number_of_uploads.value;
	var upload = document.product_info.fileupload.value;
//	var checkboxchecked = document.product_info.checkbox4.checked;
	var doupload = false;
/*	if (testsqft == 0) {
		alert("You must enter your product's Width and Length, then click the \"Calculate\" button.");
		return false;
	} */

//	if (checkboxchecked == false) {
//		if (uploadedfile > 0) {
//			if (upload == "") {
//				alert("You must browse for a file to upload. If you cannot upload an image, please check the \"I will send a CD\" checkbox.");
//				return false;
//			} else {
//				doupload = true;
//			}
//		}
//	} else {
	if ((uploadedfile > 0) && (upload != "")) {
		popUP(baseUrl,"Uploader",470,200,false,false);  
	}
//	}
	
//	if(check_types() == false) {
//		return false;
//	}
}

function rowOverEffect(object) {if (object.className == 'moduleRow') object.className = 'moduleRowOver';}
function rowOutEffect(object) {if (object.className == 'moduleRowOver') object.className = 'moduleRow';}
function popupWindow(url) {window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150');}
function checkBox(object) {document.account_newsletter.elements[object].checked = !document.account_newsletter.elements[object].checked;}




