function bookmark(bookmarkurl,bookmarktitle) {
	window.addFavorite(bookmarkurl,bookmarktitle);
}

function JumpTo(url) {
	var state_links_menu = window.document.state_links_menu;
	var menu = document.state_links_menu.links.selectedIndex;
	location = document.state_links_menu.links.options[menu].value;
}

function JumpToLink ()
{
    // Identify associative array for which to pop new window
    var newWinArr   =  new Array();
	//newWinArr["Louisiana"]   = 1;

	// Functionality
    var linkForm = this.document.state_links_menu;
	var selMenu  = linkForm.links;
	var selItem  = selMenu.options[selMenu.selectedIndex];
	
	if ( newWinArr[selItem.text] > 0 )	    
		 window.open(selItem.value, 'PropertyWindow'+selMenu.selectedIndex, "");
	else
		  window.location.href = selItem.value;
}

function JumpToGallery(url) {
	var gallery_menu = window.document.gallery_menu;
	var menu = document.gallery_menu.links.selectedIndex;
	location = document.gallery_menu.links.options[menu].value;
}

function CheckZipSearch(url) {
	var SearchForm = document.zip_search;
	var SearchField = SearchForm.ping;
	if (SearchField.value == '') { 
		window.location.href(url);
		location = url;
		//alert('Please enter a zip code or city!');
		//SearchField.focus;
	}
	else SearchForm.submit();
}

function CheckZipSearch2(url) {
	var SearchForm = document.zip_search2;
	var SearchField = SearchForm.ping;
	if (SearchField.value == '') { 
		window.location.href(url);
		location = url;
		//alert('Please enter a zip code or city!');
		//SearchField.focus;
	}
	else SearchForm.submit();
}

function ZipSearchOnClick() {
	SearchField = zip_search.ping;
	if (SearchField.value == ' Zip Search') {
		SearchField.value = '';
	}
}

function ZipSearchOnBlur() {
	SearchField = zip_search.ping;
	if (SearchField.value == '') {
		SearchField.value=' Zip Search';
	}
}

function CSCZipSearchOnClick(formname) {
	var fname = eval('this.document.' + formname);
	var SearchField = fname.ping;
	if (SearchField.value == ' Zip or City, State') {
		SearchField.value = '';
	}
}

function CSCZipSearchOnBlur(formname) {
	var fname = eval('this.document.' + formname);
	var SearchField = fname.ping;
	if (SearchField.value == '') {
		SearchField.value=' Zip or City, State';
	}
}

function CheckSubscribe() {
	var form = window.document.subscribe;
	var Required = new Object;

		// Define required fields object
		Required['contact_name'] = 'Your Name';
		Required['contact_email'] = 'Your Email Address';

		// Check required fields
		for (i = 0 ; i < form.length ; i++) {
			var FormField = form.elements[i];

		// Check generic required field
		if (Required[FormField.name] && FormField.value == '') {
			Warning = Required[FormField.name]+' is a required field!';
			alert(Warning);
			FormField.focus();
			return
		}

		// Check email address format
		else if (FormField.name  == 'contact_email' &&
				 FormField.value.match(/[\w.-]+@[\w-]+(\.[\w-]+){1,}/) == null) {
			Warning = 'Invalid Email address format!';
			alert(Warning);
			FormField.focus();
			return
		}
	}
	form.submit()
}

function CheckTellAFriend() {
	var form = window.document.tell_a_friend;
	var Required = new Object;

		// Define required fields object
		Required['contact_from_email'] = 'Your Email Address';
		Required['contact_to_email'] = 'Your Friend\'s Email Address Name';

		// Check required fields
		for (i = 0 ; i < form.length ; i++) {
			var FormField = form.elements[i];

		// Check generic required field
		if (Required[FormField.name] && FormField.value == '') {
			Warning = Required[FormField.name]+' is a required field!';
			alert(Warning);
			FormField.focus();
			return
		}

		// Check email address format
		else if (FormField.name  == 'contact_to_email' &&
				 FormField.value.match(/[\w.-]+@[\w-]+(\.[\w-]+){1,}/) == null) {
			Warning = 'Invalid Email address format!';
			alert(Warning);
			FormField.focus();
			return
		}
	}
	form.submit()
}

function CheckContactUs() {
	var form = window.document.contact_us;
	var Required = new Object;

		// Define required fields object
		Required['contact_greeting'] = 'How we should address you';
		Required['contact_email'] = 'Your Email Address';		

		// Check required fields
		for (i = 0 ; i < form.length ; i++) {
			var FormField = form.elements[i];

		// Check generic required field
		if (Required[FormField.name] && FormField.value == '') {
			Warning = Required[FormField.name]+' is a required field!';
			alert(Warning);
			FormField.focus();
			return
		}

		// Check email address format
		else if (FormField.name  == 'contact_email' &&
				 FormField.value.match(/[\w.-]+@[\w-]+(\.[\w-]+){1,}/) == null) {
			Warning = 'Invalid Email address format!';
			alert(Warning);
			FormField.focus();
			return
		}
	}
	form.submit()
}

function CheckSubscribe() {
	var form = window.document.subscribe;
	var Required = new Object;

		// Define required fields object
		Required['contact_email'] = 'Your Email Address';		

		// Check required fields
		for (i = 0 ; i < form.length ; i++) {
			var FormField = form.elements[i];

		// Check generic required field
		if (Required[FormField.name] && FormField.value == '') {
			Warning = Required[FormField.name]+' is a required field!';
			alert(Warning);
			FormField.focus();
			return
		}

		// Check email address format
		else if (FormField.name  == 'contact_email' &&
				 FormField.value.match(/[\w.-]+@[\w-]+(\.[\w-]+){1,}/) == null) {
			Warning = 'Invalid Email address format!';
			alert(Warning);
			FormField.focus();
			return
		}
	}
	form.submit()
}

function CheckForm () {
	var FeedbackForm = document.SubscribeForm;
	var EmailField = FeedbackForm.contact_email;
	var FormOk = true;

	var w = screen.availWidth;
	var h = screen.availHeight;
	var popW = '650'; 
	var popH = '350';
	var topPos = (h-popH)/2; 
	var leftPos = (w-popW)/2;

	if (EmailField.value == '' ||
		EmailField.value.match(/^[\w.-]+@[\w-]+(\.[\w-]+){1,}$/) == null) {
		var Warning     = 'Invalid E-mail address format!';
		alert(Warning);
		EmailField.focus()
		EmailField.select()
		FormOk = false;
	}
	else {
		window.open('http://boudin.vab.com/cgi-bin/subscribe.cgi','myWindow', 'width='+popW+',height='+popH+',top='+topPos+',left='+leftPos+',status=no,scrollbars=no,resizable=no,menubar=no');
	}
	return FormOk;
}

function newWin(rand){
              var confirmWin = window.open('cgi-gal/touch.cgi?id=' + rand,'','width=400,height=525,scrollbars=yes,status=yes,left=380,top=0');
                                    if(confirmWin.opener==null)
                                      {confirmWin.opener = self;}
                                                     }
function doClock(){ // By Paul Davis - www.kaosweaver.com
  var t=new Date(),a=doClock.arguments,str="",i,a1,lang="1";
  var month=new Array('January','Jan', 'February','Feb', 'March','Mar', 'April','Apr', 'May','May', 'June','Jun', 'July','Jul', 'August','Aug', 'September','Sep', 'October','Oct', 'November','Nov', 'December','Dec');
  var tday= new Array('Sunday','Sun','Monday','Mon', 'Tuesday','Tue', 'Wednesday','Wed','Thursday','Thr','Friday','Fri','Saturday','Sat');
  for(i=0;i<a.length;i++) {a1=a[i].charAt(1);switch (a[i].charAt(0)) {
  case "M":if  ((Number(a1)==3) && ((t.getMonth()+1)<10)) str+="0";
  str+=(Number(a1)>1)?t.getMonth()+1:month[t.getMonth()*2+Number(a1)];break;
  case "D": if ((Number(a1)==1) && (t.getDate()<10)) str+="0";str+=t.getDate();break;
  case "Y": str+=(a1=='0')?t.getFullYear():t.getFullYear().toString().substring(2);break;
  case "W":str+=tday[t.getDay()*2+Number(a1)];break; default: str+=unescape(a[i]);}}return str;
}

  var bmsdays=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
  var bmsmonths=["January","February","March","April","May","June","July","August","September","October","November","December"];

function bmsgettoday(){
               var today=new Date();
               var y=today.getYear();
                 if (y < 1000) y+=1900;
               var day=today.getDay();
               var month=today.getMonth();
               var day_of_month=today.getDate();
                 if (day_of_month<10) day_of_month="0"+day_of_month;
               var h=today.getHours();var m=today.getMinutes();var s=today.getSeconds();
               var ampm="AM";if (h>=12) ampm="PM";if (h>12) h-=12;if (h==0) h=12;
                 if (m<=9) m="0"+m;
                 if (s<=9) s="0"+s;
               var str=" "+bmsdays[day]+", "+bmsmonths[month]+" "+day_of_month+", "+y+" "+h+":"+m+":"+s+" "+ampm;
                 if (document.all) document.all.bmsliveclock.innerHTML=str  
                   else if (document.getElementById) document.getElementById("bmsliveclock").innerHTML=str  
                     else document.write(str);}
                       if (!document.all&&!document.getElementById) bmsgettoday();

            function bmsdisplayliveclock(){
               if (document.all||document.getElementById) setInterval("bmsgettoday()",1000);}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function AlertBox(){ 
alert("The Newsletter will be available soon.") 
} 

function makeArray(n) {
this.length = n
return this
}
monthNames = new makeArray(12)
monthNames[1] = "January"
monthNames[2] = "February"
monthNames[3] = "March"
monthNames[4] = "April"
monthNames[5] = "May"
monthNames[6] = "June"
monthNames[7] = "July"
monthNames[8] = "August"
monthNames[9] = "September"
monthNames[10] = "October"
monthNames[11] = "November"
monthNames[12] = "December"
function dateString(oneDate) {
var theMonth = monthNames[oneDate.getMonth() + 1]
var theYear = oneDate.getFullYear()
return theMonth + " " + oneDate.getDate() + ", " + theYear
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
