///***** JavaScript: Image Preload *****///
if (window.document.images) {
    function doPreload() {
      var the_images = new Array('../images/home1.jpg','../images/home2.jpg','../images/home3.jpg','../images/sub_about.jpg','../images/sub_contact.jpg','../images/sub_directions.jpg','../images/sub_middle.jpg','../images/sub_press.jpg','../images/nav_bottom.jpg','../images/n11.jpg','../images/n12.jpg','../images/n21.jpg','../images/n22.jpg','../images/n31.jpg','../images/n32.jpg','../images/n41.jpg','../images/n42.jpg','../images/n51.jpg','../images/n52.jpg','../images/n61.jpg','../images/n62.jpg','../images/n71.jpg','../images/n72.jpg','../images/n7_blank.jpg');
      preloadImages(the_images);
      }
    function preloadImages(the_images_array) {
    for(loop = 0; loop < the_images_array.length; loop++) {
      var an_image = new Image();
      an_image.src = the_images_array[loop];
      }
     }
    }


//	Pop-Up Window
//	*********************
	function popUP(this_pg) {
	var the_window = window.open(this_pg,'the_window','width=380,height=440,toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes,screenX=50pixels,screenY=50pixels');
	}

//	Email Friend Window
//	*********************
	function emailFrnd(this_pg) {
	var the_window = window.open(this_pg,'the_window','width=432,height=495,toolbar=no,location=no,status=no,scrollbars=no,resizable=yes,screenX=50pixels,screenY=50pixels');
	}

//	Self Close
//	*********************
	function closeNow() {
	window.close()
	}
    
//	Invitation Form (at revivedwire.com)
//	*********************
	function showAjaxFormRecommender(event) {
	    Event.stop(event);
	      Lightview.show({
	        href: 'popup.php',
	        rel: 'iframe',
	        options: {
	          topclose: true,
			  width: 305,
			  height: 430,
	          ajax: {
	            onComplete: function(){
	            $('ajaxForm').observe('submit', submitAjaxFormRecommender);
	          }
	        }
	      }
	    });
	  }

	function submitAjaxFormRecommender(event) {
	    Event.stop(event);
	    var text = $('ajaxForm').down('input').value.strip();
	    if (!text) return;
	      Lightview.show({
	      href: 'popup.php',
	      rel: 'iframe',
	      options: {
	        title: 'results',
	        menubar: false,
	        topclose: true,
	        autosize: true,
	        ajax: {
	          parameters: Form.serialize('ajaxForm')
	        }
	      }
	    });
	  }