var jsDOM0 = (document.all);
var jsDOM1 = (document.getElementById);
var jsDOM = jsDOM0 || jsDOM1;
var jsDebug = 0;

function getObj (name)
{
    if (typeof name == "object") return name;
    if (jsDOM1) return document.getElementById(name);
    if (jsDOM0) return eval('document.all.'+name);
    else return null;
}
/*
function ShowHide()
{
	chBox = getObj('f_sameaddress');
	divko = getObj('deliv_addr');
	if(chBox.checked == true)
	{
		//alert('none');
		divko.style.display = 'none';
	}
	else
	{
		//alert('block');
        divko.style.display = 'block';
	}
}
*/
function posta(meno,dom) {
	if (!dom) {dom='bellamente.sk';}
	document.write ('<a href="" onClick="sendMail(this,\''+meno+'\',\''+dom+'\')">'+meno+'@'+dom+'</a>');
}

function sendMail(oTag,meno,dom)
{
	oTag.href = "mailto:"+meno+"@"+dom;
}

function ShowHideMenu(objct)
{
	mdivko = getObj(objct);
	if(mdivko.style.display == 'block')
	{
        mdivko.style.display = 'none';
	}
	else
	{
        mdivka = getObj('div_1');
        mdivka.style.display = 'none';
        mdivka = getObj('div_2');
        mdivka.style.display = 'none';
        mdivka = getObj('div_3');
        mdivka.style.display = 'none';
        mdivka = getObj('div_4');
        mdivka.style.display = 'none';
        mdivka = getObj('div_5');
        mdivka.style.display = 'none';

        mdivko.style.display = 'block';
	}
}

function Show(o1,o2)
{
	if(getObj(o1) != null) 
	{
		mtext = getObj(o1);
		mtext.style.display = 'none';
	}
	mdivko = getObj(o2);
	mdivko.style.display = 'block';
}

function Kontrola()
{
	//alert(document.formular.name.value);
	if (document.formular.name.value == "")
	{
		document.formular.name.focus();
		alert ("Uveďte vaše meno");
		return false;
	}
	if (window.RegExp) 
	{ 
		znaky=new RegExp("^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,4}$"); 
		if (!znaky.test(document.formular.mail_1.value)) 
		{ 
			window.alert("Nesprávne zadaný váš e-mail"); 
			document.formular.mail_1.focus(); 
			return false; 
		} 
		if (!znaky.test(document.formular.mail_2.value)) 
		{ 
			window.alert("Nesprávne zadaný e-mail vášho priateľa"); 
			document.formular.mail_2.focus(); 
			return false; 
		} 
	} 
}


function PrevFoto(count,model)
{
	//if(typeof(modelInd) == 'undefined') {modelInd = 1;}
	//alert(modelInd);
	fotoDetail = getObj('detail');
	modelInd --;
	fotoDetail.src = 'photos/'+model+'-'+modelInd+'.jpg';
	nBtn = getObj('nextbtn');
	pBtn = getObj('prevbtn');
	nBtn.style.visibility = 'visible';
	if(modelInd == 1) {pBtn.style.visibility = 'hidden';}
}
function NextFoto(count,model)
{
	if(typeof(modelInd) == 'undefined') {modelInd = 1;}
	//alert(modelInd);
	modelInd ++;
	fotoDetail = getObj('detail');
	fotoDetail.src = 'photos/'+model+'-'+modelInd+'.jpg';
	pBtn = getObj('prevbtn');
	nBtn = getObj('nextbtn');
	pBtn.style.visibility = 'visible';
	if(modelInd == count) {nBtn.style.visibility = 'hidden';}
}


function PrevFoto2(count,model)
{
	//if(typeof(modelInd) == 'undefined') {modelInd = 1;}
	//alert(modelInd);
	fotoDetail = getObj('detail');
	modelInd --;
	fotoDetail.src = 'photos/'+model+'-'+modelInd+'.jpg';
	nBtn = getObj('nextbtn');
	pBtn = getObj('prevbtn');
	nBtn.style.visibility = 'visible';
	if(modelInd == 1) {pBtn.style.visibility = 'hidden';}
}
function NextFoto2(count,model)
{
	if(typeof(modelInd) == 'undefined') {modelInd = 1;}
	//alert(modelInd);
	modelInd ++;
	fotoDetail = getObj('detail');
	fotoDetail.src = 'photos/'+model+'-'+modelInd+'.jpg';
	pBtn = getObj('prevbtn');
	nBtn = getObj('nextbtn');
	pBtn.style.visibility = 'visible';
	if(modelInd == count) {nBtn.style.visibility = 'hidden';}
}


function PrevFoto3(count,model)
{
	//if(typeof(modelInd) == 'undefined') {modelInd = 1;}
	//alert(modelInd);
	fotoDetail = getObj('detail_udalost');
	modelInd --;
	fotoDetail.src = 'photos/'+model+'-'+modelInd+'.jpg';
	nBtn = getObj('nextbtn');
	pBtn = getObj('prevbtn');
	nBtn.style.visibility = 'visible';
	if(modelInd == 1) {pBtn.style.visibility = 'hidden';}
}
function NextFoto3(count,model)
{
	if(typeof(modelInd) == 'undefined') {modelInd = 1;}
	//alert(modelInd);
	modelInd ++;
	fotoDetail = getObj('detail_udalost');
	fotoDetail.src = 'photos/'+model+'-'+modelInd+'.jpg';
	pBtn = getObj('prevbtn');
	nBtn = getObj('nextbtn');
	pBtn.style.visibility = 'visible';
	if(modelInd == count) {nBtn.style.visibility = 'hidden';}
}


