function openWin(url, name, w, h, perc, scroll, resize) {
	var winX = (screen.availWidth - w)*perc*.01;
	var winY = (screen.availHeight - h)*perc*.01;
	popupWin = window.open(url, name,'width=' + w + ',height=' + h + ',left=' + winX + ',top=' + winY + ',scrollbars=' + scroll + ',resizable=' + resize);
}

function openGallery(url) {
	openWin('http://www.nsteel.com/gallery/'+url,'Gallery',620,500,15,1,0);
}

function isAlphaNumeric(p_strText)
{
	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 -_";

	for (i = 0;  i < p_strText.length;  i++)
	{
		if (checkOK.indexOf(p_strText.charAt(i)) == -1) return false;
	}
		return (true);
}

function IsValidEmail(p_strEmail)
{
	var regexp = /^\S+\@[a-zA-Z0-9\.-]+\.[a-zA-Z0-9]{2,4}$/;
	return regexp.test(p_strEmail);
}

function lockButtons (whichform) {
	//alert ('hi');
	ua = new String(navigator.userAgent);
	if (ua.match(/IE/g)) {
		for (i=1; i<whichform.elements.length; i++) {
			if ((whichform.elements[i].type == 'submit') || (whichform.elements[i].type == 'button')) {
				whichform.elements[i].disabled = true;
			}
		}
	}
	// whichform.submit();
	// use this function for onsubmit, not onclick, k?
}



//---------------------
//GABES FUNCTIONS BELOW
//---------------------

function notEmpty(elem){
	var str = elem.value;
	if(str.length == 0){
		elem.focus();
		alert("You must fill in all required fields (*)");
		return false;
	} else {
		return true;
	}
}


function designformvalidation(form) {

	if(notEmpty(form.USER_TYPE)){

	if(notEmpty(form.FIRST_NAME)){
	
	if(notEmpty(form.LAST_NAME)){
	
	if(notEmpty(form.PHONE)){
	
	if(notEmpty(form.EMAIL)){
	
	if(notEmpty(form.JOB_CITY)){
	
	if(notEmpty(form.JOB_STATE)){
	
	if(notEmpty(form.JOB_COUNTRY)){
	
	if(notEmpty(form.REFERENCE)){
	
	if(notEmpty(form.CODE_TYPE)){
	if(notEmpty(form.LIVE_LOAD)){
	if(notEmpty(form.SNOW_LOAD)){
	if(notEmpty(form.COLLATERAL_LOAD)){
	if(notEmpty(form.WIND_LOAD)){
		
	return true;
	
	}}}}}}}}}}}}}}
	
	return false;
	
}