function swapImg(img,over)
{
	if (over) var new_file = img.src.substr(0,img.src.length-5)+"2.png";
	else var new_file = img.src.substr(0,img.src.length-5)+"1.png";
	img.src = new_file;
}

function process_compare()
{
  dim = "";
  c1 = document.forms['compare'].country1.value;
  c2 = document.forms['compare'].country2.value;

  if (document.forms['compare'].dim) dim = document.forms['compare'].dim.value;
  document.location = "http://www.anovasofie.net/vl/countries/compare.php?country1="+c1+"&country2="+c2+"&dimension="+dim;
}



old_c1 = 0;
old_c2 = 1;

function update_dropdowns()
{
  var c1 = document.forms['compare'].country1.selectedIndex;
  var c2 = document.forms['compare'].country2.selectedIndex;

  if (c1 == c2)
  {
    document.forms['compare'].country1.selectedIndex = old_c1;
    document.forms['compare'].country2.selectedIndex = old_c2;
    alert("Can not compare a country to itself!\nPlease select a different country!");		
  }
	
  old_c1 = document.forms['compare'].country1.selectedIndex;
  old_c2 = document.forms['compare'].country2.selectedIndex;
}


function isIE()
{
  if (navigator.appName.toUpperCase() == 'MICROSOFT INTERNET EXPLORER') return true;
  else return false;
}


function print_iframe(name)
{
  if (isIE())
  {
    document[name].focus();
    document[name].print();
  }     
  else
  {
    window.frames[name].focus();
    window.frames[name].print();
  }
}

function open_2_win(url1,url2)
{
  var win1 = window.open(url1,"win1","");
  var win2 = window.open(url2,"win2","");

}