// display decision alert box
// State lists
var states = new Array();

states['226'] = new Array("Alabama", "Alaska", "Arizona", "Arkansas", "American Samoa", "California", "Colorado", "Connecticut", "D.C.", "Delaware", "Florida", "Micronesia", "Georgia", "Guam", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts", "Marshall Islands", "Michigan", "Minnesota", "Mississippi", "Missouri", "Marianas", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Puerto Rico", "Palau", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Virgin Islands", "Washington", "West Virginia", "Wisconsin", "Wyoming", "Military Americas", "Military Europe/ME/Canada", "Military Pacific");

states['38'] = new Array("Alberta", "Manitoba", "Alberta", "British Columbia", "Manitoba", "New Brunswick", "Newfoundland and Labrador", "Nova Scotia", "Northwest Territories", "Nunavut", "Ontario", "Prince Edward Island", "Quebec", "Saskatchewan", "Yukon Territory");

states['13'] = new Array("Australian Antarctic Territory", "Australian Capital Territory", "Northern Territory", "New South Wales", "Queensland", "South Australia", "Tasmania", "Victoria", "Western Australia");
states['Brazil'] = new Array("Acre", "Alagoas", "Amazonas", "Amapa", "Baia", "Ceara", "Distrito Federal", "Espirito Santo", "Fernando de Noronha", "Goias", "Maranhao", "Minas Gerais", "Mato Grosso do Sul", "Mato Grosso", "Para", "Paraiba", "Pernambuco", "Piaui", "Parana", "Rio de Janeiro", "Rio Grande do Norte", "Rondonia", "Roraima", "Rio Grande do Sul", "Santa Catarina", "Sergipe", "Sao Paulo", "Tocatins");

states['150'] = new Array("Drente", "Flevoland", "Friesland", "Gelderland", "Groningen", "Limburg", "Noord Brabant", "Noord Holland", "Overijssel", "Utrecht", "Zuid Holland", "Zeeland");

states['225'] = new Array("Avon", "Bedfordshire", "Berkshire", "Buckinghamshire", "Cambridgeshire", "Cheshire", "Cleveland", "Cornwall", "Cumbria", "Derbyshire", "Devon", "Dorset", "Durham", "Essex", "Gloucestershire", "Greater London", "Greater Manchester", "Hampshire", "Hereford & Worcestershire", "Hertfordshire", "Humberside", "Isle of Man", "Isle of Wight", "Kent", "Lancashire", "Leicestershire", "Lincolnshire", "Merseyside", "Norfolk", "Northamptonshire", "Northumberland", "Nottinghamshire", "Oxfordshire", "Shropshire", "Somerset", "Staffordshire", "Suffolk", "Surrey", "Sussex", "Warwickshire", "West Midlands", "Wiltshire", "Yorkshire");

states['103'] = new Array("County Antrim", "County Armagh", "County Down", "County Fermanagh", "County Londonderry", "County Tyrone", "County Cavan", "County Donegal", "County Monaghan", "County Dublin", "County Carlow", "County Kildare", "County Kilkenny", "County Laois", "County Longford", "County Louth", "County Meath", "County Offaly", "County Westmeath", "County Wexford", "County Wicklow", "County Galway", "County Mayo", "County Leitrim", "County Roscommon", "County Sligo", "County Clare", "County Cork", "County Kerry", "County Limerick", "County Tipperary", "County Waterford");

states['empty'] = new Array("Empty");



function setStates(){

  cntrySel = document.getElementById('country');
  
  if(states[cntrySel.value]) {
	  stateList = states[cntrySel.value];
	  changeSelect('county', stateList, stateList);
  }
  else {
	  stateList = states['empty'];
	  changeSelect('county', stateList, stateList);
  }
  
}


function changeSelect(fieldID, newOptions, newValues) {

  selectField = document.getElementById(fieldID);
  selectField.options.length = 0;

  for (i=0; i<newOptions.length; i++) {
    selectField.options[selectField.length] = new Option(newOptions[i], newValues[i]);
  }
}

function decision(message, url){

	if(confirm(message)) location.href = url;

}



// open browser window

function openPopUp(url, windowName, w, h, scrollbar) {



           var winl = (screen.width - w) / 2;

           var wint = (screen.height - h) / 2;

           winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scrollbar ;

		   win = window.open(url, windowName, winprops);

           if (parseInt(navigator.appVersion) >= 4) { 

              	win.window.focus(); 

           } 

}

function open_popup_tc()
{
	window.open("termsconds.php", "Terms & Conditions", "width=500, height=500" );
}

function getImage(imageName)

{

		document.getElementById('img').src = imageName;

}

function jumpMenu(target,object,restore){ 

  eval(target+".location='"+object.options[object.selectedIndex].value+"'");

  if (restore) object.selectedIndex=0;

}



function findObj(n, d) {

  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=findObj(n,d.layers[i].document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}



function submitDoc(formName) { 

  var obj;

 

	if (obj=findObj(formName)!=null) 

	{

		findObj(formName).submit(); 

	}

	else 

	{

		alert('The form you are attempting to submit called \'' + formName + '\' couldn\'t be found. Please make sure the submitDoc function has the correct id and name.');

	}



}