/*var aktDiv = new Array();

function hideDiv(mainDiv,subDiv) {
    if (aktDiv[subDiv] == undefined || aktDiv[subDiv] == false) {
        document.getElementById(subDiv).style.display = 'block';
        mainDiv.getElementsByTagName('a')[0].style.background = ' url(../img/content/bgrMainContentType1AktivaciaSluzbyLinkUp.gif)  no-repeat 4px 5px';
        aktDiv[subDiv] = true;
    } else {
        document.getElementById(subDiv).style.display = 'none';
        mainDiv.getElementsByTagName('a')[0].style.background = ' url(../img/content/bgrMainContentType1AktivaciaSluzbyLinkDown.gif)  no-repeat 4px 5px';
        aktDiv[subDiv] = false;
    }
}
function homepageTextOver(element,image) {
   document.getElementById(element).getElementsByTagName('img')[0].src = "http://energo.beta.polardesign.com/templates/images/subtitleMainDivHomepage"+image+"O.gif";
   document.getElementById(element).getElementsByTagName('p')[0].style.color = '#072946';
   document.getElementById(element).getElementsByTagName('a')[0].style.color = '#B70404';
}
function homepageTextOut(element,image){
   document.getElementById(element).getElementsByTagName('img')[0].src = "http://energo.beta.polardesign.com/templates/images/subtitleMainDivHomepage"+image+".gif";
   document.getElementById(element).getElementsByTagName('p')[0].style.color = '#004179';
   document.getElementById(element).getElementsByTagName('a')[0].style.color = '#002F5E';
}*/

function showHomeDiv(div,defdiv) {
    document.getElementById(defdiv).style.display = 'none';
    document.getElementById(div).style.display = 'block';
}

function hideHomeDiv(div,defdiv) {
    document.getElementById(div).style.display = 'none';
    document.getElementById(defdiv).style.display = 'block';
}

function OpenWindow(co,sirka,vyska)
{
p="width="+sirka;
p=p+", height="+vyska;
p=p+",top="+eval(screen.height-vyska)/2;
p=p+", left="+eval(screen.width-sirka)/2+", resizable=1,scrollbars=1"

//------------OTVORENIE OKNA--------------------------------------
var okno=window.open(co,'',p);
}


// validacia form kontakt ------------------------------------------------------------------------


	function ExpodeStringToArray(string,separator)
	{
		if(string.length>0)
		{
				var pos = string.indexOf(separator);
				var ss = Array();
				ss[0] = string.substring(0,pos);
				ss[1] = string.substring(pos+1,string.length);
				return ss;
		
		}
	}
	
        function CheckOnlyNumber(co)
    {
	// onkeypress=" CheckOnlyNumber(this);" onkeyup=" CheckOnlyNumber(this);"//
            var hodnota = co.value
	var cisla = "0123456789$,.-+";
	
	for(x=0;x<hodnota.length;x++)
		{
			pismeno = hodnota.substring(x,x+1);
			if(cisla.indexOf(pismeno)<0 ){ 
					//return hodnota.substring(0,hodnota.length-1); 
					co.value = co.value.replace(pismeno,'');
					return false;
			}
		}
		
	return true;

}

	
	function checkForm()
	{
		
		
	       // POLOZKY NA VALIDACIU
	       // idField|Hlaska
	           var chFields = Array();
		chFields[0]='meno|Vyplnte  Vaše meno a priezvisko !';
		chFields[1]='telefon|Vyplnte  Váš telefonický kontakt !';
		chFields[2]='email|Vyplnte  Váš emailový  kontakt !';
		chFields[3]='produkt|Vyplnte  názov produktu o ktorý máte záujem !';
		
		
		
		
		// nazov formulara****
		var frm  = document.getElementById('kontaktForm');
		
		var regEmail = /^[\w-\.]+\@[\w\.-]+\.[a-z]{2,4}$/;
		//var regText = /^[\w\s\.\'\-\,\/\:\?\!\;\"\+\*\_\|\&\%\#\(\)\#\^\�\\\>\<\"\{\}\]\[]+$/;
		for(x=0;x<frm.elements.length;x++)
		{
			var p = ExpodeStringToArray(chFields[x],'|');
			// validacia email
			if(p[0]=='email')
			{
				if(frm.elements[x].value.length==0)
				{
						alert(p[1]);
						frm.elements[x].focus();
						return false;
				}
				else
				{
					if(!regEmail.test(frm.elements[x].value))
					{
						alert(p[1]);
						frm.elements[x].focus();
						return false;
					}
				}
			}
			// validacia ostante
			if(frm.elements[x].value.length==0)
			{
					alert(p[1]);
					frm.elements[x].focus();
					return false;
			}
		}
		return true;
	}
// end validacia kontakt form



function checkFieldTextSearch(co)
{
    if(co.value.length=='')
    {
        co.value='Zadajte výraz na vyhľadávanie';   
        return false;
    }
    else
    {
        return true;
    }
    
}
