/*
 * $Author: dbibbens $
 * $Revision: 1.6 $
 * $Date: 2008/08/07 22:57:42 $ 
 * $Source: /home/cvs/bestratecarinsurance.com/local/lib/functions.js,v $
 */

var selected = false;

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

function adj_change_state(select, aid) 
{
  var state = select.options[select.selectedIndex].value;
  if(state) {
    window.moveTo(0,0);
    window.resizeTo(screen.width,screen.height);
    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);
}

