/*
** $Id: include.js,v 1.2 2003/09/14 19:44:34 damonp Exp $
**
** Copyright (C) 2002 siliconsys.com <dev@siliconsys.com>
** See LICENSE file in root directory of this installation for
** licensing information.
*/

	var Ver4 = parseInt(navigator.appVersion) >= 4
	var Nav4 = ((navigator.appName == "Netscape") && Ver4)
	var IE4 = ((navigator.userAgent.indexOf("MSIE") != -1) && Ver4)

	function pop_win(url, win, ht, wd) {
  		popwin = document.open(url,win,"width="+wd+",height="+ht+",toolbar=no,resizable=yes,scrollbars=yes");
 	}

	function confirm_action(url, action) {
		var is_confirmed = confirm("Are you sure you want to " + action + "?");
		if(is_confirmed) {
			window.location.href = url;
		}
	}

	function confirm_submit(form_name, action, id) {
		var is_confirmed = confirm("Are you sure you want to " + action + "?");
		if(is_confirmed) {
			document[form_name].id.value = id;
			document[form_name].submit();
		}
	}

	function submit_cat()	{
		if(document.cat_form.sel_category.options.selectedIndex != '0' &&
					document.cat_form.sel_category.options.selectedIndex != '')	{
			document.cat_form.submit();
			return true;
		}	else return false;
	}

	function highlight(row, new_color) {
	    if (typeof(row.style) == 'undefined' || typeof(row.cells) == 'undefined') {
	        return false;
	    }
	    var num_rows = row.cells.length;
	    for (var c = 0; c < num_rows; c++) {
	        row.cells[c].bgColor = new_color;
	    }
	    return true;
	}
	
	function DisplayImage(picURL,picWidth,picHeight){
					 newWindow=window.open(picURL,'newWin','toolbar=no,width='+picWidth+',height='+picHeight)
					 newWindow.document.write('<html><head><\/head><body background="'+picURL+'"><\/body><\/html>')
					 newWindow.resizeBy(picWidth-newWindow.document.body.clientWidth,picHeight-newWindow.document.body.clientHeight)
					 newWindow.focus()
  }
	

	function MM_openBrWindow(theURL,winName,features) { //v2.0
  				 window.open(theURL,winName,features);
	}

	function checkCheckBox(f){
	if (f.validation.checked == false)
	{
	 	 			 alert('Please check box to validate your form. Thank you.');
					 return false;
					 }else
					 return true;
	}
	
	function doClick(){
	var str;
	str = 'sd_tg_sleep:'+document.getElementById('sd_tg_sleep').value;
	str += ';sd_cruising_ground:'      +document.getElementById('sd_cruising_ground').value;
	str += ';sd_yachttype:'      +document.getElementById('sd_yachttype').value;
	document.location = 'sd_index.php?fn=list&query='+str;	
}