﻿
var imgs = new Array('bn_urz_W600URZ.jpg','bn_urz_W400Plus_B25.jpg','bn_prs_W1200CityBox.jpg','bn_prs_W1100PlusMax.jpg','bn_dop_armagas_BAP.jpg', 'bn_dop_armagas_VAP.jpg', 'bn_dop_elgas_ELCOR-94.jpg', 'bn_dop_kovina_KV3010.jpg', 'bn_dop_kovina_KV3010M.jpg', 'bn_dop_kovina_KV3011.jpg', 'bn_dop_kovina_KV3011M.jpg', 'bn_dop_manotest_APT-6.jpg', 'bn_dop_polix_KPC-K25.jpg', 'bn_dop_polix_KPG-K25.jpg', 'bn_dop_premagas_mem_MKM_G4.jpg', 'bn_dop_premagas_rot_DGZ_G16.jpg', 'bn_dop_premagas_tur_RPT_3E_G160.jpg', 'bn_dop_prematlak_eln_PTPD.jpg', 'bn_dop_prematlak_tepl_TM_5201.jpg', 'bn_dop_prematlak_tlak_03_312-S.jpg', 'bn_dop_sigeval_FL3MN-N.jpg', 'bn_drz_AJ1000NS.jpg', 'bn_drz_AJ1000Plus.jpg', 'bn_drz_AJ500N.jpg', 'bn_drz_AJ600Midi.jpg', 'bn_drz_AJ600U.jpg', 'bn_drz_W300Plus.jpg', 'bn_drz_W400N.jpg', 'bn_drz_W400U.jpg', 'bn_drz_W500NS.jpg', 'bn_drz_wizard_AJ400N.jpg', 'bn_fag_10001.jpg', 'bn_fag_10201.jpg', 'bn_fag_10203F.jpg', 'bn_fag_10601.jpg', 'bn_fag_10603F.jpg', 'bn_fag_30051.jpg', 'bn_fag_30154F.jpg', 'bn_fag_31051.jpg', 'bn_fag_31156F.jpg', 'bn_fag_4001.jpg', 'bn_fag_4007.jpg', 'bn_fag_50102.jpg', 'bn_fag_50102F.jpg', 'bn_fag_7100.jpg', 'bn_fag_7110.jpg', 'bn_fag_7115.jpg', 'bn_fag_7120T.jpg', 'bn_fag_7120U.jpg', 'bn_fag_7201.jpg', 'bn_fiorentini_10001.jpg', 'bn_fiorentini_10201.jpg', 'bn_fiorentini_10203F.jpg', 'bn_fiorentini_10601.jpg', 'bn_fiorentini_10603F.jpg', 'bn_fiorentini_30051.jpg', 'bn_fiorentini_30154F.jpg', 'bn_fiorentini_31051.jpg', 'bn_fiorentini_31156F.jpg', 'bn_fiorentini_4001.jpg', 'bn_fiorentini_4007.jpg', 'bn_fiorentini_50102.jpg', 'bn_fiorentini_50102F.jpg', 'bn_fiorentini_7100.jpg', 'bn_fiorentini_7110.jpg', 'bn_fiorentini_7115.jpg', 'bn_fiorentini_7120T.jpg', 'bn_fiorentini_7120U.jpg', 'bn_fiorentini_7201.jpg', 'bn_flamerite_alto.jpg', 'bn_flamerite_atlanta.jpg', 'bn_flamerite_atomic.jpg', 'bn_flamerite_austen.jpg', 'bn_flamerite_cappella.jpg', 'bn_flamerite_corello.jpg', 'bn_flamerite_izara.jpg', 'bn_flamerite_luminoso.jpg', 'bn_flamerite_manhattan.jpg', 'bn_flamerite_newark.jpg', 'bn_flamerite_omni.jpg', 'bn_flamerite_passion.jpg', 'bn_flamerite_quarenta.jpg', 'bn_flamerite_sabatini.jpg', 'bn_flamerite_sento.jpg', 'bn_flamerite_senza.jpg', 'bn_flamerite_spiro.jpg', 'bn_flamerite_taiko.jpg', 'bn_flamerite_tennyson.jpg', 'bn_heat-n-go_corner.jpg', 'bn_heat-n-go_dakota.jpg', 'bn_heat-n-go_pier.jpg', 'bn_heat-n-go_sl350.jpg', 'bn_heat-n-go_sl6000.jpg', 'bn_heat-n-go_soho.jpg', 'bn_heat-n-go_st.jpg', 'bn_heat-n-go_vertikal.jpg', 'bn_prs_CityBox1200.jpg', 'bn_prs_W1600CityBox2xIP.jpg', 'bn_prs_W2500CityBox.jpg', 'bn_stf_APR25.jpg', 'bn_stf_APR25-B.jpg', 'bn_stf_DKR50.jpg', 'bn_stf_DSR6.jpg', 'bn_stf_FC-1L.jpg', 'bn_stf_FC-1S.jpg', 'bn_stf_FC-L1.jpg', 'bn_stf_FC-S1.jpg', 'bn_stf_IPR75-BP.jpg', 'bn_stf_IPR-B300-BP.jpg', 'bn_stf_IPR-B75-BP.jpg', 'bn_stf_IPR-X300-BP.jpg', 'bn_stf_IPR-XB300-BP.jpg', 'bn_stf_RMI065.jpg', 'bn_stf_TPR025.jpg', 'bn_stf_VSP-301-BP.jpg', 'bn_tart_A149.jpg', 'bn_tart_B242.jpg', 'bn_tart_BFL.jpg', 'bn_tart_BM5_OS80X-BP.jpg', 'bn_tart_MBN.jpg', 'bn_tart_MFL-BP.jpg', 'bn_tart_R25.jpg', 'bn_tart_R72.jpg', 'bn_tart_RP022.jpg', 'bn_tart_V60.jpg', 'bn_tart_VFA-MR.jpg', 'bn_urz_AJ400Plus-GasgepKHS1.jpg', 'bn_urz_W600PlusExtraA1500.jpg', 'bn_urz_W600URZ2xB40.jpg', 'bn_zrz_W04.jpg', 'bn_zrz_W04-B10.jpg');

/* Google analytics begin */
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-10544534-2']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

/* Google analytics end */

/*function ChangeBanner(){
	do {
		k=Math.floor(Math.random()*imgs.length);
		for (m=1; m<4; m++){
			if (document.images["bn_img" + m].src.indexOf(imgs[k]) != -1)
				k=1000;
		}
	} while (k==1000);
	var id="bn_img" + (Math.floor(Math.random()*3)+1);
	document.images[id].src="images/" + imgs[k];
	window.setTimeout("ChangeBanner()",10000);
}
*/
function ChangeBanner(){
	for(var cnt=1; cnt<4; cnt++){
		do {
			k=Math.floor(Math.random()*imgs.length);
			for (m=1; m<4; m++){
				if (document.images["bn_img" + m].src.indexOf(imgs[k]) != -1)
					k=1000;
			}
		} while (k==1000);
		var id = "bn_img" + cnt;
		document.images[id].src="images/" + imgs[k];
/*		var element = document.getElementById('bn' + cnt);
		//alert(document.getElementById(id).height));
		var y = ((133 - document.getElementById(id).height)/2 - 19);
		if (y >= 10)
			y = 0;
		//alert(element);
		//alert(element.style.top);
		element.style.top = y + 'px';
		//alert(y);
		//alert(element.style.top);
*/
	}
	window.setTimeout("ChangeBanner()",10000);
}

function InitPage(){
	setHeight();
	ChangeBanner();
	
}

function setHeight(){
	if (document.getElementById('cellCapMiddle').clientHeight != document.getElementById('contentBody').clientHeight)
		document.getElementById('cellCapMiddle').style.height = document.getElementById('contentBody').clientHeight + 'px';
	if (document.getElementById('cellCapMiddle').clientHeight < document.getElementById('navBar').clientHeight)
		document.getElementById('cellCapMiddle').style.height = document.getElementById('navBar').clientHeight + 'px';
}

/*
function CheckForm(){
	if	(document.Cenniky_formular.meno.value == "")
		alert("Musíte zadať svoje meno !");
	else if (document.Cenniky_formular.email.value == "")
		alert("Musíte zadať svoju emailovú adresu !");
	else if	(document.Cenniky_formular.email.value.indexOf("@")<1)
		alert("Musíte zadať svoju emailovú adresu správne !");
	else
		return(true); //vsetko je OK

	return(false); //vyskytla sa chyba, preto zamedzime odoslaniu formulara
	
}
*/

function DisplaySubmenu(elementIDname, elementID, submenusCount)
{
	var id;
//	alert(elementIDname);
//	alert(elementID);
//	alert(submenusCount);
	submenusCount--;
	for (var i=0; i<=submenusCount; i++){
    	//id = "relatedSubLinks" + i;
		id = elementIDname + i;
	    //document.all.item(id).style.display = "none";
		document.getElementById(id).style.display = "none";
	}
	id = elementIDname + elementID;
	//id = "relatedSubLinks" + elementID;
	document.getElementById(id).style.display = "block";
}


////////////////////////////////////////////////
// Function to open new window                //
////////////////////////////////////////////////
function openWindow() {
window.open("banner.html","Racioenergia","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=376,height=200,top=100,left=" + (screen.availWidth - 500) + ", alwaysRaised=1");
}

function openWindowforTemplate() {
window.open("","Solution",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=700,height=800,top=0,left=0');
}
