<!--

function chkbrowser(theform){
	var myarg=0;
	//alert(navigator.appName);
	//if ((navigator.userAgent.indexOf("Opera 6")!=-1) ||(navigator.userAgent.indexOf("Opera/6")!=-1))

	if(theform=='sor' || theform=='swr'){
		if (navigator.appName != 'Microsoft Internet Explorer' || (navigator.userAgent.indexOf("Opera")!=-1) || (navigator.userAgent.indexOf("Opera")!=-1)){
          	 if(theform=='swr')
			 document.ysum.rts1.value='1';
			 document.ysum.action='yachtsummarynoie.php?myarg='+myarg;
		}
		else{
		    if(theform=='swr')
			 document.ysum.rts1.value='1';
		     document.ysum.action='yachtsummary.php?myarg='+myarg;	
		}
	}
 
	if(theform=='sbk'){
		   document.ysum.action='show_bookings.php';	
	}
	if(theform=='ssb'){
		   document.ysum.action='show_booksandsum.php';	
	}
	if(theform=='mui'){
		   document.ysum.action='multiple_enq.php';	
	}
 //alert(document.ysum.action);
  document.ysum.submit();
  return false;	
}

function chkbrowser2(theval,theform,iepath,noiepath){
   var myarg=0;
   if (navigator.appName != 'Microsoft Internet Explorer' || (navigator.userAgent.indexOf("Opera")!=-1) || (navigator.userAgent.indexOf("Opera")!=-1)){
		if(theval=='emenu'){
			   document.forms[theform].action=noiepath+'.php';
		}
		if(theval=='gcomm'){
			   document.forms[theform].action=noiepath+'.php';
		}
	}else{
		if(theval=='emenu'){
			   document.forms[theform].action=iepath+'.php';	
		}
		if(theval=='gcomm'){
			   document.forms[theform].action=iepath+'.php';	
		}
	
	}	
  document.forms[theform].submit();
  return false;	
}

function SetAllCheckBoxes(FormName, NumCheckBoxes, CheckValue)
{
		var FieldName='';
		var objCheckBoxes='';
		for(var i = 1; i <= NumCheckBoxes; i++){
			FieldName = 'chk'+i;
			document.forms[FormName].elements[FieldName].checked=CheckValue;
			//objCheckBoxes[i].checked = CheckValue;
		}	
}

function KillSeason() {
 document.sform.hardseason.disabled = false; 
 if(document.sform.startday.value !='0' || document.sform.startmonth.value !='0'  || document.sform.startyear.value !='0'  || document.sform.endday.value !='0'  || document.sform.endmonth.value !='0'  || document.sform.endyear.value !='0' ) { 
 	document.sform.hardseason.disabled = true;
	document.sform.hardseason.value="";
 }
	
}

function openDt(){
	if(document.ebForm.addnewdt.checked==true){
		document.ebForm.startyear.style.backgroundColor = '#FFFFFF';
		document.ebForm.startmonth.style.backgroundColor = '#FFFFFF';
		document.ebForm.startday.style.backgroundColor = '#FFFFFF';	
		 document.ebForm.startyear.disabled=false;
		 document.ebForm.startmonth.disabled=false;
		 document.ebForm.startday.disabled=false;
		 document.ebForm.newbut.disabled=true;
		 document.ebForm.newsdt.disabled=true;
		 document.ebForm.newsdt.selectedIndex = 0;
		 document.ebForm.newsdt.style.backgroundColor = '#CECECE';
		 //document.ebForm.newdate1.focus();
		//return false;
	}else{
		document.ebForm.startyear.style.backgroundColor = '#CECECE';
		document.ebForm.startmonth.style.backgroundColor = '#CECECE';
		document.ebForm.startday.style.backgroundColor = '#CECECE';		
		 document.ebForm.startyear.disabled=true;
		 document.ebForm.startmonth.disabled=true;
		 document.ebForm.startday.disabled=true;
		 document.ebForm.newbut.disabled=false;
		 document.ebForm.newsdt.disabled=false;
		 document.ebForm.newsdt.selectedIndex = 0;
		 document.ebForm.newsdt.style.backgroundColor = '#FFFFFF';		 
//		document.ebForm.newdate1.value=''; 
	}
}

function killCpl(){
	if(document.yachtForm.termstype.options[document.yachtForm.termstype.selectedIndex].value !='2'){
		document.yachtForm.cpermit.disabled=false;
		document.yachtForm.clicense.disabled=false;
		document.yachtForm.cpermit.style.backgroundColor = '#FFFFFF';
		document.yachtForm.clicense.style.backgroundColor = '#FFFFFF';
		document.yachtForm.cpermit.selectedIndex = 0;
		document.yachtForm.clicense.selectedIndex = 0;		
		//return false;
	}else{
		document.yachtForm.cpermit.disabled=true;
		document.yachtForm.clicense.disabled=true;
		document.yachtForm.cpermit.style.backgroundColor = '#CECECE';
		document.yachtForm.clicense.style.backgroundColor = '#CECECE';
		document.yachtForm.cpermit.selectedIndex = 2;
		document.yachtForm.clicense.selectedIndex = 2;
		document.yachtForm.cpermit.selectedIndex.value=2;
		document.yachtForm.clicense.selectedIndex.value = 2;		
		
	}

}

function popdt(dtin){
	if(dtin==3)
		return true;
	var f = 'sform';
	var mystr;
	var yy,mm,dd=''; //2005-05-05
	var p,arlength,sy,sm,sd,newText,newValue;
	//alert(dtin);
	if(dtin==1){
		mystr=document.sform.dt1.value;
		sy = 'startyear';
		sm = 'startmonth';
		sd = 'startday';
	}
		
	if(dtin==2){
		mystr=document.sform.dt2.value
		sy = 'endyear';
		sm = 'endmonth';
		sd = 'endday';
	}	

	yy = mystr.substring(0,4); 
	mm = mystr.substring(5,7); 
	dd = mystr.substring(8); 
	
	//month
		for(p=0;p<=12;p++){
			if(document.forms[f].elements[sm].options[p].value==mm){
				document.forms[f].elements[sm].selectedIndex = p;
				break;
			}	
		}
	
	// day
		for(p=0;p<=31;p++){
			if(document.forms[f].elements[sd].options[p].value==dd){
				// show opt selected
				document.forms[f].elements[sd].selectedIndex = p;
				break;
			}	
		}	

	// year info
	newText=yy;
	newValue=yy;
	arlength=document.forms[f].elements[sy].length;
		var valfound=false;
		var valpos=0;
		for(p=0;p<arlength;p++){
			if(document.forms[f].elements[sy].options[p].value==newValue){
				// show opt selected
				valfound=true;
				valpos=p;
				break;
			}	
		}

	if(valfound==true) { //show this option selected
			document.forms[f].elements[sy].selectedIndex = valpos;
			document.forms[f].elements[sy].options[4] = null;
	}else{ 
		if(arlength>4){ // position 5 already added, so update position 5
			document.forms[f].elements[sy].options[4].text = newValue;
			document.forms[f].elements[sy].options[4].value = newValue;
			document.forms[f].elements[sy].selectedIndex = 4;		
		}else{ // only 4 option in list so add new one and select it.
				var objSelect=document.forms[f].elements[sy];
				var objOption = document.createElement("option");
				objOption.text = newText
				objOption.value = newValue
				
				if(document.all && !window.opera)
				  {objSelect.add(objOption);}
				 else
				  {objSelect.add(objOption, null);};
				document.forms[f].elements[sy].selectedIndex = 4;
		}	
	}
}

function goto_URL(object,num) {
			window.location.href = "editnews.php?newsdt=" + document.ebForm.newsdt.options[document.ebForm.newsdt.selectedIndex].value+ 
			"&newstopic=" +		document.ebForm.newstopic.options[document.ebForm.newstopic.selectedIndex].value
	}

function confirmSubmit(valin1,valin2){
	var agree=confirm("You are about to delete this news item. Are you Sure ?");
	if (agree)
		location = "editnews.php?id="+valin1+"&deleteitem=1"
}
function showpic(){
	document.ebForm.myupim.src = document.ebForm.pic.value;
//	document.ebForm.myupim.width = 200;
}


//-->