// JavaScript Document

function zobrazskry(idecko){
er=document.getElementById(idecko).style;
er.display=(er.display == 'none')?'table-cell':'none';
createCookie("ShowHide",er.display,365);
}

function setActiveStyleSheet(title) {

	createCookie("ColorCSS", title, 365);
	window.location.reload();
	return;
}

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function setScreenType(screentype){
	document.getElementById('ahoj').style.width = screentype;
	createCookie("ScreenType", screentype, 365);
}
function velkosttxt(){
	zaciatok = document.cookie.indexOf("FontSize=");
	if (zaciatok != -1) {zaciatok += 'FontSize='.length};
	koniec = document.cookie.indexOf(";",zaciatok);
	if (koniec == -1) { koniec = document.cookie.length; };
	return velkost = parseInt(unescape(document.cookie.substring(zaciatok,koniec)));
}
var currentFontSize = velkosttxt();
if(currentFontSize=="")
	var currentFontSize = 11;

function changeFontSize(sizeDifference){
	//get css font size
	if(sizeDifference==0){
			document.getElementById('stred').style.fontSize = 11+"pt";
			document.getElementById('lista_text').style.fontSize = 13+"px";
			createCookie("FontSize", 11, 365);
			currentFontSize=11;
	}
	else{
		currentFontSize = currentFontSize + sizeDifference;
		if (currentFontSize<=15 && currentFontSize>=9){
			document.getElementById('stred').style.fontSize = currentFontSize+"pt";
			document.getElementById('lista_text').style.fontSize = (currentFontSize+2)+"px";
			createCookie("FontSize", currentFontSize, 365);
		}
		else if(currentFontSize>15)
			currentFontSize=15;
		else if(currentFontSize<9)
			currentFontSize=9;
		else
		return;
	}
};



function changeToolHilite(oldtool, newtool) {
	if (oldtool != newtool) {
		if (oldtool) {
			oldtool.src = oldtool.src.replace(/_s.gif$/,'.gif');
		}
		newtool.src = newtool.src.replace(/.gif$/,'_s.gif');
	}
}

function setFav()
{
	url=window.location;
	title="Aspira centrum - masážne štúdio zamerané na zdravie, krásu a relax.";
	try {
		window.external.AddFavorite(url, title);
	}
	catch (e) {
		if (window.sidebar) {
			window.sidebar.addPanel(title, url, '');
		}
		else {
			window.alert("Pre pridanie stránky medzi obľúbené, stlačte CTRL+D.");
		}
	}
	return false;
}
