// AIR CONDITIONING SCRIPTS

var arrCountry = [
	"russia",
	"netherlands",
	"spain",
	"france",
	"portugal",
	"uk",
	"ireland",
	"belgium",
	"italy",
	"germany",
	"croatia",
	"greece",
	"poland",
	"sweden",
	"norway",
	"estonia",
	"latvia",
	"lithuania",
	"belarus",
	"ukraine",
	"bulgaria",
	"turkey",
	"cyprus",
	"bosnia",
	"macedonia",
	"albania",
	"hungary",
	"slovenia",
	"denmark",
	"finland",
	"czech"
];


function showCountry(divId, countryName) {
		show_country(divId);
		//show_country_name(divId,countryName)
}

function hideCountry(divId) {
	//alert("hide=" + divId);
	hide_country();
	show_country_name(divId, '');
}

// This function shows the country name when the mouse is navigated over the map
function show_country_name(GetDivID,CountryName)
{
	//alert("showCountryName = " + GetDivID + ", " + CountryName);
	DivID=document.getElementById(GetDivID);
	DivID.innerHTML=CountryName;
	setOpacity(DivID, 0);
	DivID.style.visibility = 'visible';	
	fadeIn(GetDivID,0);
}


function show_country(GetDivID)
{
	
	DivID=document.getElementById(GetDivID);
	DivID.style.visibility='visible';
	DivID.style.display = "block";
	//alert("show country=" + GetDivID);
}

function hide_country()
{

		for (var i = 0; i < arrCountry.length; i++) {
			if (document.getElementById(arrCountry[i]))
				document.getElementById(arrCountry[i]).style.visibility='hidden';
		}
}

function show_contact_information(GetDivID,CountryName)
{
	//DivID=document.getElementById(GetDivID);
	//DivID.style.visibility='visible';
	
	document.getElementById('intro_content').style.visibility='hidden';
	document.getElementById('air_conditioning_intro_img').style.visibility='hidden';
	
	document.getElementById(CountryName + '_contact_information').style.visibility='visible';
	
	for (var i = 0; i < arrCountry.length; i++) {
		if (CountryName != arrCountry[i]) {
			var obj = document.getElementById(arrCountry[i] + '_contact_information');
			if (obj) obj.style.visibility='hidden';	
		}
	}
		
}

// The following functions are used for Fading Effects
function onload_fadein(GetDivId)
{
	Div = document.getElementById(GetDivId);
	setOpacity(Div, 0);
	Div.style.visibility = 'visible';	
	fadeIn(GetDivId,0);
}

function setOpacity(obj, opacity)
{
	opacity = (opacity == 100)?99.999:opacity;
  	obj.style.filter = "alpha(opacity:"+opacity+")";
	obj.style.KHTMLOpacity = opacity/100;
	obj.style.MozOpacity = opacity/100;
	obj.style.opacity = opacity/100;
}

function fadeIn(objId,opacity)
{
  if (document.getElementById)
  {
    obj = document.getElementById(objId);
    if (opacity <= 100)
	{
      setOpacity(obj, opacity);
      opacity += 10;
      window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 50);
    }
  }
}


function change_bg_img(ClassName)
{
	document.getElementById('air_conditioning_subnavigation_bg').className=ClassName;
}