/*********************pick browser and resize********************/
 function reztab(tot){
 var pics = document.getElementsByName('fropag');
 var browser=navigator.appName;


 if (stat=="d"||stat3=="d"){

               window.location = "http://www.kwcommunities.com/";//"http://www.kwilson.com/kwilsoncomm/index.php";//"http://www.kwcommunities.com/";

                }

                else{
        for(i=0;i<pics.length;i++){
        pics[i].ind=i;
                                        }//adjusts positioning by browser detection, loads default images every time page loads
        //alert(tot);
 if (tot==4){

            top[7][3] = 2;
            if (out.length==5){
                   swapp(2,7);
                            }//should be 5 digit or one, property code or page number selection
                            if (stat==4 && tal!="1" && stat3.length!=5){
                            tal = "1";
                           document.getElementById("tal").value = "1";
                           hombutclic(5,4);
                                }//reloads communities page due to images "sticking"
                        }
        for (v=0;v<7;v++){
                   top[v][3] = 0;
                         }
                         if (tot==80){
                         if (browser=="Microsoft Internet Explorer"){
                            document.getElementById("body5").style.width="90%";
                                                                    }
                         }//onload of index.php, primarily used for debugging..
                         if (tot!=80){
                         top[stat][3] = 2;
           document.fropag[tot].src=top[tot][top[tot][3]];
           }//not index.php


if (browser=="Microsoft Internet Explorer"){
                            document.getElementById("cowid").className = "Expl";
                            if(stat==4){
                                    document.getElementById("cowid").className = "Expl2";
                                                        }//when communities is clicked, do something..
                            if (out.length==5){
                               document.getElementById("cowid").className = "Expl";
                                }
                            if(stat==6){
                            document.getElementById("cowid").className = "Expl";
                            document.getElementById("body5").className='nospace2';
                            document.getElementById("inp0").style.width="200px";
                                        }
                                          }
                           //var browser=navigator.appName;
                           if (browser == "Netscape"){
                               document.getElementById("cowid").className = "Fire";
                       if (out==4){
                                        }//do something at the end of communities page load
                  }
                  }

                  }
/*********************pick browser and resize********************/

/**********************onmouseover buttons ******************/

    function hombut(br,fei){

              var gig = (br.ind==null || br.ind == "")? fei:br.ind;//.toString();
              br.src=top[gig][1];
              gig = "";
              }//switch image onmouseover br = element.object,fei = unused, but is set for secondary action on mouseover

    function hombuto(br,fei){
              var gig = (br.ind==null || br.ind == "")? fei:br.ind;//.toString();
              br.src=top[gig][top[gig][3]];
              gig = "";
              }//switch back, br = element.object, fei = unused, but is set for secondary action on//mouseout
/***********************************************************************/

/*******************nav bar buttons action**************************/
   function hombutclic(feld,sta){
   			//_uacct = "UA-2668212-1";
			//urchinTracker();
            document.saft.pag.value=feld;
            document.saft.stat.value=sta;
            document.saft.submit();
                         }//feld = selected page, pulls # ID from sql, sta = persistant state(mouseover) button #
/*****************************************************************/



/*********************switch photo gallery images***************/

function flip_pics(loc){
         var e_pic = document.getElementById("mainpic").src=loc;
                    }



/*********************switch photo gallery images***************/

/*********************personal info form submission ***************/


 function get_n_fo(frm){
 var recheck = 0;
 var nf = new Array();
 var prp = document.getElementsByName("inp");
 var prpo = document.getElementsByName("inp0");
 var redfont = document.getElementsByName("redfo");
 //alert(prpo[0].value);
 if (prpo[0]!= "null"){
 match_prop(prpo[0]);
 }

 for (eu=0;eu<redfont.length;eu++){
 redfont[eu].style.color = "#AC721D";
 }

 for (iu=0;iu<frm.inp.length;iu++){
 if ((iu == 0 && frm.inp[iu].value == "null") || (iu == 1 && frm.inp[iu].value == "") || (iu == 4 && frm.inp[iu].value == "")){
if (recheck == 0){
alert("Please fill in all fields highlighted in red. Thank You.");
}
 recheck = 1;
 if(iu == 0){redfont[0].style.color = "red";}
 if(iu == 1){redfont[1].style.color = "red";}
 if(iu == 4){redfont[2].style.color = "red";}

 }
 else{
      nf[iu] = (iu==0)? frm.inp[iu].value:("|"+frm.inp[iu].value);
      }
                              }
         nfo2 = nf.toString();
         frm.sehnd.value = nfo2;
         frm.procode.value = poi;
         //alert(nfo2);
         if (recheck == 0){
         document.inpuht.submit();
         }
                    }

/*********************personal info form submission ***************/

/*********************delete reviewed entries ***************/

function delntry(){
var nf = new Array();
var del = document.getElementsByName("del");
arr = document.getElementById("ahl");
var rid;
var i = 0;
for (iu=0;iu<del.length;iu++){
        if(del[iu].checked==false){
          continue;
            }
        if(del[iu].checked!=false){
            nf[i] = del[iu].id;
            }
             i++;
                              }
 rid = nf.toString();
 arr.value = rid;
 pagout = "delentry";
 subm();
 document.getElementById('swpfl').innerHTML="";
 pagout = 45;
 subm();
                    }

/*********************delete reviewed entries ***************/

/*********************Determine what property guest is interested in, used in get_n_fo***************/

function match_prop(prop){
//alert(prop.value);
if (prop.value == "null"){}
else{
        var onp = document.getElementsByName('inp');
        var props = new Array();
        props[0] = new Array("The Oaks at Schilling Farms","toasf");
        props[1] = new Array("The Oaks at Appling","toaap");
        props[2] = new Array("The Oaks at Woodchase","toawc");
        props[3] = new Array("The Oaks at Parkview","toapv");
        props[4] = new Array("The Village at Schilling Farms","tvasf");
        props[5] = new Array("The Villas at Great Plains Park","tvagp");
        props[6] = new Array("The Villas at Pleasant Valley","tvapv");
        props[7] = new Array("The Villas at Eastlake Reservoir","tvaer");
        poi = props[prop.value][1];
        document.inpuht.inp[0].value = props[prop.value][0];
        }
                        }

/*********************Determine what property guest is interested in, used in get_n_fo ***************/

/*********************Does exactly what it says ***************/

function reset_counter(){
var c = confirm("This will reset your site counter to 0. Are you sure you want to do this? OK = YES CANCEL = NO");
if (c==false){
alert("Delete aborted!");}
else{alert("Counter reset!");
       pagout = "reset_counter";
       subm();
            }
                }

/*********************Does exactly what it says ***************/

/*********************directs the user to internal site location from inside or out***************/

function guide(stat3){
//alert(stat3+"L"+stat3.length);//reztab(80);
            if (stat3.length==5 && stat2<1){
       stat2++;
       var type = stat3.charAt(4);
       //alert(isNaN(type));
       if(isNaN(type)== true){

       var cof = confirm("You were directed here by another site to see a specific page. If you would like to be directed to that page select 'OK' below. To browse for yourself select 'Cancel'. To return to your previous page, hit the 'Back' button twice in succession. Thank you, and enjoy your visit.")
            if(cof == true){
            document.getElementById("stat2").value = stat2;
          hombutclic(stat3,4);

          }
          }
          if(isNaN(type)== false){
          var cof = confirm("You were directed here by another site to see a specific page. If you would like to be directed to that page select 'OK' below. To browse for yourself select 'Cancel'. To return to your previous page, hit the 'Back' button twice in succession. Thank you, and enjoy your visit.")
            if(cof == true){
          document.getElementById("stat2").value = stat2;
          hombutclic(type,(type-1));
          }

          }
                                        }

                else{
                 document.getElementById("stat3").value = 0;
                reztab(80);
                    }
                }

/*********************directs the user to internal site location from inside or out ***************/








