
   var selectStatus="";
   //var membertype="<?echo $_SESSION["role"];?>";

   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 = "#1f3343";
      thisobj.style.color = "#ffffff";
   }
   function resetSelectedColor(val){
      document.all[val].style.background = "#ffffcc";
      document.all[val].style.color = "#000000";
   }
   function setColorOver(thisobj){
      thisobj.style.background = "#521b37";
      thisobj.style.color = "#ffffff";
   }
   function setColorOut(thisobj){
      thisobj.style.background = "000000";
      thisobj.style.color = "#ffffff";
   }
    function setColorOver2(thisobj){
      thisobj.style.background = "#521b37";
      thisobj.style.color = "#ffffff";
   }
   function setColorOut2(thisobj){
      thisobj.style.background = "#280d28";
      thisobj.style.color = "#ffffff";
   }
   
   
   function setColorOver3(thisobj){
      thisobj.style.background = "#1f3343";
      thisobj.style.color = "#ffffff";
   }
   function setColorOut3(thisobj){
      thisobj.style.background = "000000";
      thisobj.style.color = "#ffffff";
   }
    function setColorOver4(thisobj){
      thisobj.style.background = "#1f3343";
      thisobj.style.color = "#ffffff";
   }
   function setColorOut4(thisobj){
      thisobj.style.background = " #172531";
      thisobj.style.color = "#ffffff";
   } 
  

   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){
      
      if(thisobj.id == "InActive"){
         alert("Please note that you have to be a Paid member to access personal information on members");
      }else{  
         window.document.forms[formid].submit();
      }
   }
   function sendFormToMailPage(thisobj,formid){
      
      if(thisobj.id == "InActive"){
         alert("Please note that you have to be a Paid member to access personal information on members");
      }else{  
         window.document.forms[formid].submit();
      }
   }

   function viewmail(thisobj,formid){
      
      window.open("compose.php?messageid=" + thisobj.link + "&memberid=" + thisobj.id,"viewmail",'width=800,height=600');
   }

   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="";
   }

         
      
