
  

   var selectStatus="";
   
   
   function del(thisobj){
   	var agree="";
   	if(thisobj.id=="delr"){
   		agree = confirm("Are you sure you want to completeley remove this record from the database");   	
   	}
   	if(agree==true){
   		
   		document.forms["join"].delaction.value="deleteconfirmed";
   		document.forms["join"].submit();
   		return true;
   	}else{
   		return false;
   	}
   }
   
   function delpackage(thisobj){
      	var agree="";
      	if(thisobj.id=="delr"){
      		agree = confirm("Are you sure you want to completeley remove the package from the database - Please note that this will completely remove all courses in this package");   	
      	}
      	if(agree==true){
      		
      		document.forms["frm"].delaction.value="deleteconfirmed";
      		document.forms["frm"].submit();
      		return true;
      	}else{
      		return false;
      	}
   }
   

   function getTotalRows(thisobj){
      var tot = document.all['total'].value;
      return tot;
   }
   function getSelectedVal(thisobj){
      var selstat = "selectstatus" + thisobj.id;
		var selectStatus=document.all[selstat].value;
		return selectStatus;
   }
   function setSelectedVal(thisobj){
      var tot = getTotalRows(thisobj);
      var selstat = "";
      var x=0;
      for(x=0; x<tot; x++){
         selstat = "selectstatus" + x;
         if(x == thisobj.id){            
            document.all[selstat].value="selected";
            setSelectedColor(thisobj);
         }else{
            if(document.all[x].style.background == "#669"){
               alert(document.all[x].style.background);
               document.all[x].style.background = "#ffffcc";
               document.all[x].style.color = "#000000";
               //resetSelectedColor(x);               
            }
            document.all[selstat].value="";
         }
         //thisobj.id = x;
         resetSelectedColor(x);
         //alert(document.all[x].style.background);
         
      } 
   }
   function setSelectedColor(thisobj){
      thisobj.style.background = "#669";
      thisobj.style.color = "#FFFFFF";
   }
   function resetSelectedColor(val){
      document.all[val].style.background = "#FFFFFF";
      document.all[val].style.color = "#2859A6";
   }
   function setColorOver(thisobj){
      thisobj.style.background = "#E9EEF5";
      thisobj.style.color = "#2859A6";
   }
   function setColorOut(thisobj){
      thisobj.style.background = "#FFFFFF";
      thisobj.style.color = "#2859A6";
   }

   function mover(thisobj){  
		var selectStatus=getSelectedVal(thisobj);
		if(selectStatus != "selected"){
         setColorOver(thisobj);
		}
   }
   function mout(thisobj){
      var selectStatus=getSelectedVal(thisobj);
		if(selectStatus != "selected"){
      	setColorOut(thisobj);
		}
   }
   function selectRow(thisobj){
      var val = "list" + thisobj.id;
      //setSelectedVal(thisobj);
      window.open("left.php?clubid="+document.forms(val).clubid.value,"left");
      
      document.all[val].action = parent.frames("top").window.document.forms(0).page.value + ".php";
     document.all[val].submit();
      
   }
   function selectRegionRow(thisobj){
      var val = "list" + thisobj.id;
      //setSelectedVal(thisobj);
      //window.open("left.php?clubid="+document.forms(val).clubid.value,"left");
      
      //document.all[val].action = parent.frames("top").window.document.forms(0).page.value + ".php";
     document.all[val].submit();
      
   }
   
   function selectSocRow(thisobj){
      var val = "list" + thisobj.id;
      //setSelectedVal(thisobj);
      window.open("left.php?clubid="+document.forms(val).clubid.value,"left");
      document.all[val].submit();
      
   }

   function sendForm(thisobj,formid){
      document.all['sval'].value="save";
      //alert(document.all[formid].submitval.value);
      //document.all[formid].action = thisobj.id;
      document.all[formid].submit();
   }

   function sendDelForm(thisobj,formid){
      document.all['sval'].value="del";
      //alert(document.all[formid].submitval.value);
      //document.all[formid].action = thisobj.id;
      document.all[formid].submit();
   }

   
   function sendFormToPage(thisobj,formid){      
      document.all[formid].submit();
   }

   function dbclk(thisobj){
      window.open("https://clarahost.clara.net/www.maximus-uk.co.uk/printorderlist.php?sesid=" + thisobj.name + "&ostatus=<?echo $orderstatus;?>","newwin",'status=yes,width=550,height=695,top=1,left=150,scrollbars=yes,titlebar=no');

   }

   function getClubid(){
      alert(parent.frames['top'].document.all['cid'].value);
   }

   function submitAccomodation(thisobj){
      document.all['sval'].value="save";
      document.all['caccomodation'].submit();
   }
   function submitProfile(thisobj){
      document.all['sval'].value="save";
      document.all['cprofile'].submit();
      //alert("test");
   }

   function find(thisobj){      
      document.all['srchid'].value = document.all['cid'].value;
      document.all['srchname'].value = document.all['cname'].value;
      document.all['ls'].submit();
      
   }

   function getPage(page,clbid){
      if(clbid.length > 0){
         //alert("<?setURL();?>");
         window.open(page + ".php?clubid=" + clbid,"top");
      }else{
         if(page != "golfsoc"){
            alert("Select Club and try again");
         }else{
            window.open(page + ".php?clubid=" + clbid,"top");
         }
      }
   }

    function getSocPage(page,page2){      
       window.open(page + ".php","top");
       window.open(page2 + ".php","list");
      
   }
    function getRegionPage(page,page2){      
       window.open(page + ".php","top");
       window.open(page2 + ".php","list");
      
   }

   function submitMapForm(frmid){
      alert("test");
      document.all[frmid].submit();
   }

   function clearFields(thisobj){      
      document.all['cid'].value="";
      document.all['cname'].value="";
   }

   function clearFieldVals(frmid){      
      document.all[frmid].sname.value="";
      document.all[frmid].contact.value="";
      document.all[frmid].phone.value="";
      document.all[frmid].email.value="";
      document.all[frmid].website.value="";
      document.all[frmid].prizedraw.value="";
   }

   function deleteUpload(frmname){
      document.all['delflag'].value="delete";
      document.forms(frmname).submit();
   }

         
      
