//////////////////////////////////////////////////////////
// AUTHOR:	VAPOR					//
// VERSION:	1.05					//
// TIME:	11.36					//
// DATE:	20.12.07				//
// UPDATES:	1.04	 ADD FORM TEXT			//
// 		1.05	 ADD LINK HIGHLIGHTER		//
//////////////////////////////////////////////////////////


//UNDEFINED
if (typeof mobile_homes_page == 'undefined') {
  document.write('<INPUT TYPE="HIDDEN" NAME="mobile_homes_page" VALUE="mobile_homes_top">');
}


//POPUP
function popUp(URL,w,h,t,l,s) {
  day = new Date();
  id = day.getTime();
  eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars='+s+',location=0,statusbar=0,menubar=0,resizable=1,width='+w+',height='+h+',top='+t+',left='+l+'');");
}


//NOT TOP
if (mobile_homes_page.value=="mobile_homes_not_top") {
  if (self == top)
    top.location.replace('index.htm');
}


//TOP
if (mobile_homes_page.value=="mobile_homes_top") {
  if (self != top)
    top.location.replace('index.htm');
}


//CLEARTEXT
function clearText(thefield) {
  if (thefield.defaultValue==thefield.value)
  thefield.value = ""
}


//FILENAME
function filename(longname) {
  fnF = longname.substring(longname.lastIndexOf('/')+1);  
  fnA = fnF.split('.');
  fnL = fnA[0];
  fnR = fnA[1];
  return fnL.replace(/[0-9]/g, "");
}


//HIGHLIGHTLINK
function highlightlink(){
  for (i = 0; i < document.links.length; i++) {
    var a = document.links[i];
    function setA() {
      a.setAttribute("class","highlight");
      a.setAttribute("className","highlight");
    }
    if (filename(a.href) == filename(location.href) && a.id == "sitelink") {
      setA();
    }
    if (a.href == location.href && a.id == "sitelinkl") {
      setA();
    }
  }
}