﻿function loadClientID(){

var clntID = parent.document.getElementById('txtClientID').value ;

if (clntID.length > 0){
document.getElementById('inputClientID').value = clntID ;

}
}

function SetDivs(NewDiv) {
ClearAllDivs();

document.getElementById(NewDiv).style.display = 'block';
}
function ClearAllDivs() {
document.getElementById('divMap').style.display = 'none';
document.getElementById('divSearch').style.display = 'none';

}
function setupPage() {
var theCounty = '' ;
var theState = '' ;
theCounty = document.getElementById("cntySelect").options[document.getElementById("cntySelect").selectedIndex].value;
theState = 'ID';
var tmCustID = '';
tmCustID = document.getElementById("txtTMCustID").value;

 if (document.getElementById('searchFrame')){
  document.getElementById('searchFrame').src = 'PropSearch.aspx?State=' + theState + '&County=' + theCounty + '&TMCustID=' + tmCustID ;
  document.getElementById('mapFrame').src = 'Map.aspx?TMCustID=' + tmCustID ;
 }
}
  function divSetClass(ctrlNm, ctrlNm2, canScroll, fnOnCollapse, fnOnExpand){
    //** 08/22/07 - SDW - Original. Assumes only one classname exists in classname property.
    //** 10/12/07 - SDW - Added onCollapse and onExpand methods.
    var ctrl = document.getElementById(ctrlNm);
    var ctrl2 = document.getElementById(ctrlNm2);

    //var ctrlA = document.getElementById(ctrl.id.replace('div', 'a'));
    var ctrlA = document.getElementById(ctrl.id.replace('div', 'mbr'));
    
    var classNm = ctrl.className;
    var innerHTML = ctrlA.innerHTML;
    
    var height = '';
    var overflow = '';
    var title = '';
    var onCollapse; 
    var onExpand; 
   
    if (fnOnCollapse == undefined) {
      onCollapse = function doOnCollapse(){};
    } else {
      onCollapse = fnOnCollapse;
    }
    
    if (fnOnExpand == undefined) {
      onExpand = function doOnExpand(){};
    } else {
      onExpand = fnOnExpand;
    }

    if (classNm.indexOf('divDivCollapsed')==-1) {
   
      classNm += ' divDivCollapsed';
      innerHTML = innerHTML.replace('-', '+');
      title = 'Click here to Expand';
      height = '15px';
      overflow = 'hidden';
      ctrl2.style.display = 'none';
      onCollapse();

    } else {
  
      classNm = classNm.replace(' divDivCollapsed', '');
      innerHTML = innerHTML.replace('+', '-');
      title = 'Click here to Collapse';
      height = 'auto';
      if (canScroll==true) {
        overflow = 'auto';
      }
      ctrl2.style.display = 'block';
      if (ctrl.id == 'divMapLayers') {
        height = '450px';
      }
      onExpand();
    }
   
    ctrl.className = classNm;
    ctrl.style.height = height;
    ctrl.style.overflow = overflow;
    ctrlA.innerHTML = innerHTML;
    ctrlA.title = title;
  } 
  
   /******************************************************************************************/		
  function mbrOnMouseOver(obj) {
    //** 10/15/07 - SDW - Original
    obj.style.textDecoration = 'underline';
    document.body.style.cursor='hand';
  }
  /******************************************************************************************/		
  function mbrOnMouseLeave(obj) {
    //** 10/15/07 - SDW - Original
    obj.style.textDecoration = 'none';
    document.body.style.cursor='default';
  }
