// info@arrowebs.com - free script advice at www.delphi.com/dynamicdesign and www.htmlguru.com


// Lazy sniff
ns = (document.layers)? true: false
ie = (document.all)? true: false

// Status Text Manager
function mover(txt) {
	window.status = txt;
}

function mout() {
	window.status='';
}

// Enlarge Image
function picEnlarge(imname) {
   oPic = new Image();
   fname = '"' + imname + '"'
   oPic.onload = dispImg;
   oPic.src = (imname);
}

function dispImg() {
	picWidth = parseFloat(oPic.width);
	picHeight = parseFloat(oPic.height);
	features = "toolbar=no,status=no,menubar=no,directories=no,resizable=yes,width=" + picWidth + ",height=" + picHeight;
	if (window.picWin && !picWin.closed){
        picWin.window.resizeTo( picWidth, picHeight )
    } else {
		picWin = window.open("","", features);
    }
	picWin.document.open("text/html","replace");
	picWin.document.write('<HTML><HEAD><TITLE> - :: enlarged View :: </TITLE></HEAD><body bgcolor="#CCCCCC" topmargin="0" leftmargin="0">\n<div style="position:absolute;top:0;left:0;"><img src=' + fname + ' border="0" alt="[Enlarged View]"></div></BODY></HTML>');
	picWin.document.close();
	picWin.focus();
}

function frmValid(obj) {
	// check the checkboxes
	var i;
	var txtCheck = "";
	var isCheck = false;
	for(i=0; i < obj.length;i++) {
		if(obj.elements[i].type == "checkbox") {
			isCheck = true
			if(obj.elements[i].checked == true) {
				txtCheck += "t";
			} else {
				txtCheck += "f";
			}
		}
	}
	if( txtCheck.indexOf("t") == -1 && isCheck ) {
		alert("You have not chosen any product for enquiry!");
		return (false);
	}
	
	// check e-mail
	t = obj.email.value;
	if( t == "your@company.com" || t == "" || t.indexOf("@") == -1 || t.indexOf(".") == -1 || t.indexOf(" ")!=-1 || t.length < 6 || t.indexOf("xyz.com") > 0 || t.indexOf("abc.com") > 0 || t.indexOf("philemonindia.com") > 0 ) {
		alert("Your EMail seems to be invalid!");
		theForm.email.focus();
		return false;
	}

	// all's well ends well
	return (true);
}