
		function checkField(field){
			
			if (field.value.length >0){
				fieldContent = field.value.substring(field.value.lastIndexOf('.'),field.value.length);
			   	fieldContent = fieldContent.toLowerCase();
				i=fieldContent.indexOf("jpg");
			   	j=fieldContent.indexOf("jpeg");
			  	k=fieldContent.indexOf("gif");
			   if ((i>0) || (j>0) || (k>0)) {
			   		return true;
				}
			   else {
				    return false;
				}
			}
		}

    	function validEmail(email){
		invalidChars = " /:,;";
		
		if (email == "") {			// cannot be empty
			return false;
		}
		for (i=0; i<invalidChars.length; i++) {	// does it contain any invalid characters?
			badChar = invalidChars.charAt(i);
			if (email.indexOf(badChar,0) > -1) {
				return false;
			}
		}
		atPos = email.indexOf("@",1)			// there must be one "@" symbol
		if (atPos == -1) {
			return false;
		}
		if (email.indexOf("@",atPos+1) != -1) {	// and only one "@" symbol
			return false;
		}
		periodPos = email.indexOf(".",atPos)
		if (periodPos == -1) {					// and at least one "." after the "@"
			return false;
		}
		if (periodPos+3 > email.length)	{		// must be at least 2 characters after the "."
			return false;
		}
		return true;
	}
	
	
    	function noSpecChar(item){
		invalidChars2 = " |{}][ :,;@#$%^&*()+=><'?~`";
		
		if (item == "") {			// cannot be empty
			return false;
		}
		for (i=0; i<invalidChars2.length; i++) {	// does it contain any invalid characters?
			badChar = invalidChars2.charAt(i);
			if (item.indexOf(badChar,0) > -1) {
				return false;
			}
		}
		return true;
	}


/**
 * DHTML date validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */
// Declaring valid date character, minimum year and maximum year
var dtCh= "/";
var minYear=1900;
var maxYear=2100;

function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}

function isDate(dtStr){
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strMonth=dtStr.substring(0,pos1)
	var strDay=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		alert("The date format should be : mm/dd/yyyy")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert("Please enter a valid date")
		return false
	}
return true
}

function ValidateForm(){
	var dt=document.frmSample.txtDate
	if (isDate(dt.value)==false){
		dt.focus()
		return false
	}
    return true
 }



/*      FIND DOME         */
var isDHTML = 0;
var isID = 0;
var isAll = 0;
var isLayers = 0;

if (document.getElementById) {isID = 1; isDHTML = 1;}
else {
if (document.all) {isAll = 1; isDHTML = 1;}
else {
browserVersion = parseInt(navigator.appVersion);
if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {isLayers = 1; isDHTML = 1;}
}}

function findDOM(objectID,withStyle) {
	if (withStyle == 1) {
		if (isID) { return (document.getElementById(objectID).style) ; }
		else { 
			if (isAll) { return (document.all[objectID].style); }
		else {
			if (isLayers) { return (document.layers[objectID]); }
		};}
	}
	else {
		if (isID) { return (document.getElementById(objectID)) ; }
		else { 
			if (isAll) { return (document.all[objectID]); }
		else {
			if (isLayers) { return (document.layers[objectID]); }
		};}
	}
}


		function setClass(objectID, counter,styleID) {

			for (i=1; i<counter; i++)
			{
				var linkID = 'menuItem' + i;
				
				var dom = findDOM(linkID,0);
				if (i == objectID){
					dom.className = styleID + '2';
					}
				else
					dom.className = styleID;
			}
		}

/*
function hidediv(id) {

	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}
*/
function switchDisplay(id,style1, style2) {
	//safe function to show an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		if (document.getElementById(id).style.display == style2)
			document.getElementById(id).style.display = style1;
		else
			document.getElementById(id).style.display = style2;
	}
	else {
		if (document.layers) { // Netscape 4
			if (document.id.display == style2)
				document.id.display = style1;
			else
				document.id.display = style2;
		}
		else { // IE 4
			if (document.all.id.style.display == style2)
				document.all.id.style.display = style1;
			else
				document.all.id.style.display = style2;
		}
	}
}
// -------------- switches display for current item & the rest in the loop

	// switches one id
function closeDisplay(num, maxnum, styleid)  {
	//safe function to show an element with a specified id
	for (i=1; i<=maxnum; i++){
		if(i != num){
			var xid=styleid+i;

			if (document.getElementById)  // DOM3 = IE5, NS6
				document.getElementById(xid).style.display = 'none';
			else {
				if (document.layers)  // Netscape 4
					document.xid.display = 'none';
				else  // IE 4
					document.all.xid.style.display = 'none';
			}
		}
	}
}

   var photoWin = false;
   function displayPhoto(cfmfile,wide,high){
	if(photoWin){
		photoWin.close()
	}

		leftPos=0; 
		topPos=0;
		if(screen){
			leftPos=screen.width-wide-20;
		}
                
        photoWin=window.open('','Win','resizable=yes, scrollbars=yes, width='+wide+',height='+high+',left='+leftPos+',top='+topPos);
        photoWin.location = cfmfile;
        photoWin.focus();
        return;
    }
