// JavaScript Document
function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

function goLocation(){
  location.href="clients-by-location.php?lid=" + document.lform.locationDD.value;
}

function goClient(){
  location.href="http://www.lawyersinprivatepractice.com/includes/fetch-client-results.php?cl_id=" + document.cform.clientsDD.value;
}

function goKWClients(){
 var whichClient = document.form1.directClient.value;
 location.href="includes/fetch-keyword-results-clients.php?clid=" + whichClient;
}

function goNQClients(){
 var whichClient = document.form1.directClient.value;
 location.href="includes/fetch-nq-results-clients.php?clid=" + whichClient;
}

function goDetailedClients(){
 var whichClient = document.form1.directClient.value;
 location.href="includes/fetch-detailed-results-clients.php?clid=" + whichClient;
}

function setProT(){
// Get the Professional Titles
  len = document.dbform.protitlesL.length;
  i = 0;
  ptchosen = "";
  for (i = 0; i < len; i++) {
  if (document.dbform.protitlesL[i].selected) {
    ptchosen = ptchosen + document.dbform.protitlesL[i].value + ',';
    }
  }
  ptchosen = ptchosen.substring(0,(ptchosen.length - 1));
  pw = ptchosen.indexOf('%');
  if (pw == 0){
    ptchosen = 'all';
  }
  if (document.dbform.protitlesL.value == 8){
    document.dbform.areasofL.disabled = true;
    document.dbform.pqeDD.disabled = true;	
  }
  else {
    document.dbform.areasofL.disabled = false;
    document.dbform.pqeDD.disabled = false;	
  }
	  
  document.dbform.Professional_Title.value = ptchosen;
// End of Professional Titles
}

function setArea(){
// Get the Areas of Practice
  len = document.dbform.areasofL.length;
  i = 0;
  apchosen = "";
  for (i = 0; i < len; i++) {
  if (document.dbform.areasofL[i].selected) {
    apchosen = apchosen + document.dbform.areasofL[i].value + ',';
    }
  }
  apchosen = apchosen.substring(0,(apchosen.length - 1));
  pw = apchosen.indexOf('%');
  if (pw == 0){
    apchosen = 'all';
  }
  document.dbform.Area_of_Practice.value = apchosen;
// End of Areas of Practice
}

function setLocation(){
// Get the Locations
  len = document.dbform.locationL.length;
  i = 0;
  lochosen = "";
  for (i = 0; i < len; i++) {
  if (document.dbform.locationL[i].selected) {
    lochosen = lochosen + document.dbform.locationL[i].value + ',';
    }
  }
  lochosen = lochosen.substring(0,(lochosen.length - 1));
  pw = lochosen.indexOf('%');
  if (pw == 0){
    lochosen = 'all';
  }
  document.dbform.Location.value = lochosen;
// End of Locations
}

function changeAlt(elem_id,inClient){
  var target_element = document.getElementById(elem_id);
  target_element.alt = "latest law jobs from " + inClient;
  target_element.title = "latest law jobs from " + inClient;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}