function showElement(id) {
	var obj = document.getElementById(id);
	obj.style.display = "block";
}

function hideElement(id) {
	var obj = document.getElementById(id);
	obj.style.display = "none";
}

function showElementJQ(id, t) {
  $('#'+id).show(t);
}

function hideElementJQ(id, t) {
  $('#'+id).hide(t);
}

// function for showing and hiding default texts in inputs
function inputDefaultShowHide(inputId, defaultText, isBlurAction) {
	var obj = document.getElementById(inputId);

	if (isBlurAction) {
		if (obj.value == "")
			obj.value = defaultText;
	}
	else {
		if (obj.value == defaultText)
			obj.value = "";
	}
}

// loading advertisement movement functionality
jQuery(document).ready(function() {
	jQuery('#photoList').jcarousel();
	$('#slide1').cycle({
		fx: 'fade',
		speed: 2500,
		timeout: 5000
	});
});

function changeTab(activeId, deactiveId, activeTab)
{
	var active = document.getElementById(activeId);
	var deactive = document.getElementById(deactiveId);
	var tabs = document.getElementById("tabsList");
	var tabsCount = tabs.getElementsByTagName("a");

	active.style.display = "block";
	deactive.style.display = "none";

	for (var i = 0; i < tabsCount.length; i++)
	{
		if (i == activeTab)
			tabsCount[i].className = "active";
		else
			tabsCount[i].className = "";
	}
}

function AddFavorite(linkObj,addUrl,addTitle)
{
  if (document.all && !window.opera)
  {
    window.external.AddFavorite(addUrl,addTitle);
    return false;
  }
  else if (window.opera && window.print)
  {
    linkObj.title = addTitle;
    return true;
  }
  else if ((typeof window.sidebar == 'object') && (typeof window.sidebar.addPanel == 'function'))
  {
    if (window.confirm('Přidat oblíbenou stránku jako nový panel?'))
    {
      window.sidebar.addPanel(addTitle,addUrl,'');
      return false;
    }
  }
  window.alert('Po potvrzení stiskněte CTRL-D,\nstránka bude přidána k vašim oblíbeným odkazům.');
  return false;
}

function printAdvert()
{
	var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,"; 
	disp_setting+="scrollbars=yes,width=650, height=600, left=100, top=25"; 
	var content_value = document.getElementById("printArea").innerHTML; 
	
	var docprint=window.open("","",disp_setting); 
	docprint.document.open(); 
	docprint.document.write('<html><head><title>' + document.title + '</title>'); 
	docprint.document.write('<link rel="stylesheet" type="text/css" href="/styles/design.css" />');
	docprint.document.write('<link rel="stylesheet" type="text/css" href="/styles/content.css" />');
	docprint.document.write('</head><body onLoad="self.print()"><div id="printAdvert">');
	docprint.document.write(content_value);
	docprint.document.write('</div></body></html>'); 
	docprint.document.close(); 
	docprint.focus();
}

function setAdultEnter() {
  jQuery(document).ready(function() {
    var date = new Date();
    //date.setTime(date.getTime() + (12 * 3600));
    $.cookie('CONFIRM18', 'adult18', { path: '/', expires: 1 });
    window.location = '';
    return false;
  }); 
}
