/*
 * $Author: dbibbens $
 * $Revision: 1.6 $
 * $Date: 2007/06/07 05:58:31 $ 
 * $Source: /home/cvs/nationalcarinsurancesite.com/local/lib/functions.js,v $
 */

var selected = false;

function change_state(aid, subid)
{
  var select = document.getElementById('state');
  if(select && select.selectedIndex > 0) {
    var state = select.options[select.selectedIndex].value;
    if(subid && subid != '') {
      document.location = 'results.xsl?state=' + state + '&aid=' + aid + '&subid=' + subid;
    } else {
      document.location = 'results.xsl?state=' + state + '&aid=' + aid;
    }
  } 
}

function openWin(url, width, height) 
{
  var features = "toolbar=yes,location=yes,directories=no,status=yes," + 
    "menubar=yes,marginwidth=0,marginheight=0,resizable=yes,scrollbars=" +
    "yes,width=" + width + ",height=" + height;
  
  if(!selected) {
    popup_win(url, 'results', features);
  }
}

function popup_win(url, name, features) 
{
  window.open(url, name, 'screenX=0,screenY=0,left=0top=0,' + 
			  features);
}
