function changeLimit(select) {
	document.location.href="./?limit="+select.value;
}

function changeOrder(select) {
	document.location.href="./?order="+select.value;
}

function setAvailability(availability) {
	var i = document.getElementById('availability');
	i.innerHTML = availability;
}
function setPrice2(index) {
	var i = document.getElementById('price2');
	var price = i.options.item(index-1).value;
	var i = document.getElementById('price');
	i.innerHTML = price;
	var i = document.getElementById('buy_price');
	i.value = price;
}

function setPrice(price) {
	var i = document.getElementById('price');
	i.innerHTML = price;
	var i = document.getElementById('buy_price');
	i.value = price;
}

function validateForm(velikost, barva) {
	if (velikost == false && barva == false) return true;
	if (velikost == true) {
		var i = document.getElementById('xVelikost');
		if (i.selectedIndex == 0) {
			alert('Prosíme vyberte požadovanou velikost!');
			return false;
		}
	}
	if (barva == true) {
		var i = document.getElementById('xBarva');
		if (i.selectedIndex == 0) {
			alert('Prosíme vyberte požadovanou barvu!');
			return false;
		}
	}
	return true;
}

function setDescription(description) {
	var i = document.getElementById('description');
	i.value = description;
	

	var i = document.getElementById('description2');
	i.innerHTML = description;
}

function show(div) {
	var element = document.getElementById(div);
    if (element.style.visibility != "visible"){
        clearTimeout(self.timer);
        element.style.visibility = "visible";
        element.style.width = "343px";
        element.style.height = "auto";
     }
     else {
        element.style.visibility = "hidden";
        element.style.width = "0px";
        element.style.height = "0px";
      }
}

function zmena(active) {
			var specifikace = document.getElementById('specifikace');
			var popis = document.getElementById('popis');

			var specifikacea = document.getElementById('specifikacea');
			var popisa = document.getElementById('popisa');

			var specifikaceli = document.getElementById('specifikaceli');
			var popisli = document.getElementById('popisli');

			if (active == 'popis') {
					specifikace.style.display = 'none';
					popis.style.display = 'block';

					popisa.className = 'active';
					specifikacea.className = '';
					popisli.className = 'active';
					specifikaceli.className = '';
			}
			else {
					specifikace.style.display = 'block';
					popis.style.display = 'none';

					popisa.className = '';
					specifikacea.className = 'active';
					popisli.className = '';
					specifikaceli.className = 'active';
			}

			return false;
}

function alertSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  window.alert( 'Width = ' + myWidth );
  window.alert( 'Height = ' + myHeight );
  window.alert(document.body.clientHeight);
}

function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  alert(scrOfX);
  alert(scrOfY);
}