/* =============================================================================JavaScript library - (c) 2003-2004 Luigi Cocconcelli <luigi@italmedia.net>AUTHOR:		Luigi Cocconcelli <luigi@italmedia.net>MODIFIED:	2004 jun 19DESCRIPTION:	Central place for all the client-side functions definition============================================================================= *///self.resizeTo(780,500);	//	absolute front window positioningvar is,d = document,CANCLICK = false,WSP = " \t\n\r",DGTS = "0123456789",SADR = "info",SDOM = "sarasotanet",STLD = "biz";function bwTest() {	var b = navigator.appName;	if (b == "Netscape") this.b = "ns";	else if (b =="Microsoft Internet Explorer") this.b = "ie";	else this.b = b;	this.v = parseInt(navigator.appVersion);	this.ns = ((this.b == "ns") && (this.v >= 4));	this.ns4 = ((this.b == "ns") && (this.v == 4));	this.ns5 = ((this.b == "ns") && (this.v == 5));	this.ie = ((this.b == "ie") && (this.v >= 4));	this.ie4 = (navigator.userAgent.indexOf('MSIE 4') > 0);	this.ie5 = (navigator.userAgent.indexOf('MSIE 5') > 0);	if (this.ie5) this.v = 5;	this.min = (this.ns || this.ie); }is = new bwTest();if (is.ns4) {	d.alinkColor="#6699cc";		//	css <a:hover>	d.vlinkColor="#336699"; }	//	css <a:visited>function canSubmit(F) {	// DON'T PUT F.submit() OR FORMS WENT SUBMITTED 2 TIMES	if (CANCLICK) { F.reset(); return false }	CANCLICK = true; return true }function selectFld(f) { f.select(); f.focus(); return true }function warn(s) { return alert(unescape(s)) }function isEmpty(v) { return ((v == null) || (v.length < 1)) }function isWrong(f,s) { f.select(); warn(s); f.focus(); return false }function isBlank(flv) {	var i,c; 	if (isEmpty(flv)) return true;	for (i = 0; i < flv.length; i++) {		c = flv.charAt(i); if (WSP.indexOf(c) == -1) return false }	return true }function isInteger(s) {	var i,c; 	if (isEmpty(s)) return (isInteger.arguments[1] == true);	for (i = 0; i < s.length; i++) {		c = s.charAt(i); if (DGTS.indexOf(c) < 0) return false }	return true }function isSelected(f,s,n) {	if (isEmpty(n)) n = 1;	var o = f.options.selectedIndex;	if (o < n) {		if (! isEmpty(f.options[o].value)) return true;		return isWrong(f,s) }	return true }function tString(f,s) {	if (isEmpty(f.value)) return isWrong(f,s);	if (isBlank(f.value)) return isWrong(f,s);	return true }function tEmail(fld,s) {	var flv = fld.value;	var lst = flv.length - 1,ati = flv.indexOf("@");	var atl = flv.lastIndexOf("@"),dot = flv.lastIndexOf(".");	for (i = 0; i < WSP.length; i++) {		var c = WSP.charAt(i);		if (flv.indexOf(c) > -1) return isWrong(fld,s01) }	if ((ati < 1) || (ati != atl) || (dot - ati < 3) || (lst - dot>4) ||		(lst - dot < 2) || (lst < 6)) return isWrong(fld,s);	return true }function tSCBox(f,s) { // test single CheckBox	if (f.checked) return true;	warn(s); return false }function tMCBox(f,s) { // test multi CheckBox	for (var i = 0; i < f.length; i++) {		if (f[i].checked == true) return true }	warn(s); return false }function sTxt(s) {	if (isEmpty(s)) self.status = "";	else self.status = unescape(s);	return true }function pathName() {		var l = location;	return (l.protocol + "\/\/" + l.host + l.pathname) }function baseHref() {	var o="",i=0,s=pathName().split("/");	while(i<(s.length-1)){o+=s[i]+"/";i++}return o }function goTo(u) { location.href = u }function goHash(n) { self.location.hash = n; return false }function skipRecs(fcn,arg,nsk) { /*	possible values for nsk (next skip value):		nsk = empty -> form submit		nsk = 1:    -> next		nsk = 0:    -> prev		*/	var cva = d.I.N.value;	fcn = (fcn < 1) ? 0 : fcn - 1;	cva = (cva < 1) ? 0 : ((cva > fcn) ? fcn : cva - 1);	nsk = (nsk == null) ? cva : ((nsk < 1) ? 0 : ((nsk > fcn) ? fcn : nsk));	nsk = (nsk > 0) ? ((arg == "") ? "?ks=" : arg + "&ks=") + nsk : arg;	goTo(pathName() + nsk);	return false }function addr_write(addr,turl) { var _e;	if (isEmpty(addr)) { addr = SADR }	_e = unescape(addr + "%40" + SDOM + "." + STLD);	if (isEmpty(turl)) {		d.write("<a href=\"ma"+"ilto:"+_e+"\">"+_e+"<\/a>") }	else d.write("<a href=\""+turl+"\">"+_e+"<\/a>") }function addr(t,d,u,l) {	document.write("<a href=\"ma"+"ilto:"+u+unescape("%40")+d+"."+t+"\">")	if (isEmpty(l)) { document.write(u+unescape("%40")+d+"."+t) }	else { document.write(l) }	document.write("<\/a>") }function openWin(winUrl,winHgt,winWdt) {	window.open(winUrl,'winTitle','height=' + winHgt + ',width=' +		winWdt + ',scrollbars,resizable,left=100,top=100').focus() }function flipCase(obj,flag) {	if (flag) obj.value = obj.value.toUpperCase();	else obj.value = obj.value.toLowerCase();	return true }function setLang(obj) {	var o = obj.options,i;	if (o.selectedIndex > 1) {		for (var i = 2; i < obj.length; i++) {			if ( o[i].selected ) goTo(o[i].value) }}	return false }function sCol(obj) {	var _i = "gif.welcome?t";	for (i = 1; i < obj.length; i++) {		if (obj.options[i].selected) _i = eval(obj.options[i].value + ".src") };	d["colore"].src = _i; return true }function tLogin(F) {	if (tEmail(F.usr,s02) && tString(F.pwd,s04)) return canSubmit(F);	return false }function tContacts(F) {	if (tString(F.nam,s05) &&		tEmail(F.ema,s02) &&		tString(F.msg,s06) &&		tSCBox(F.ack,s16)		) return canSubmit(F);	return false }function tRecPw(F) {	if (tEmail(F.ema,s02)		) return canSubmit();	return false }function tSignup(F) {	if (tEmail(F.ema,s02) &&		tString(F.pwd,s04) &&		tString(F.nmf,s05) &&		tString(F.nml,s17) &&		tString(F.fir,s25) &&		tString(F.piv,s26) &&		tString(F.pho,s18) &&		tString(F.adr,s19) &&		tString(F.zip,s20) &&		tString(F.cit,s21) &&		tString(F.sta,s22) &&		isSelected(F.rgn,s24,2) &&		tString(F.cnt,s23) &&		tSCBox(F.ack,s16)		) return canSubmit(F);	return false }function tProfile(F) {	if (tEmail(F.ema,s02) &&		tString(F.pwd,s04) &&		tString(F.nmf,s05) &&		tString(F.nml,s17) &&		tString(F.fir,s25) &&		tString(F.piv,s26) &&		tString(F.pho,s18) &&		tString(F.adr,s19) &&		tString(F.zip,s20) &&		tString(F.cit,s21) &&		tString(F.sta,s22) &&		isSelected(F.rgn,s24,2) &&		tString(F.cnt,s23)		) return canSubmit(F);	return false }function tQty(F,q) {	var _q = parseInt(F.qty.value,10);	if (_q != q) {		if (isNaN(_q) || (_q < 1)) { F.qty.value = 0 }		return canSubmit(F) }	return false }function edCart(F,v) {	if (canSubmit(F)) { F.ka.value = v; F.submit() } return false }function buyMe(F,v) {	var _q = parseInt(F.qty.value,10),_v = ((v) ? v : 21);	if (isNaN(_q) || (_q < 1)) { F.qty.value = 0; return isWrong(F.qty,s08) }	return edCart(F,_v) }//	must live after functions	defaultStatus = d.title;
