// JavaScript Document
	var deli='&';
	hs.graphicsDir = 'http://'+location.host+'/includes/highslide/graphics/';
	hs.align = 'center';
	hs.transitions = ['expand', 'crossfade'];
	//hs.numberPosition = 'heading';
	hs.outlineType = 'rounded-white';
	hs.fadeInOut = true;
	hs.addSlideshow=false;
	hs.showCredits = false;
	hs.cacheAjax = false;
	hs.preserveContent = false;
	hs.enableKeyListener = false;


	if (hs.addSlideshow) hs.addSlideshow({
		//slideshowGroup: 'group1',
		interval: 5000,
		repeat: false,
		useControls: true,
		fixedControls: false,
		overlayOptions: {
			opacity: 1,
			position: 'top right',
			hideOnMouseOut: false
		}
	});

function getAmount(id)
{
	alert(id);
	hs.src='http://'+location.host+'/pages/shop_buy.php?id='+id;
	hs.htmlExpand(null,{ objectType: 'ajax', slideshowGroup: 'shop'+id});
	return false;
}

function former(ele)
{
	$("resarea").innerHTML = '';
	if ( $F("getamount")==='') { $("resarea").innerHTML = 'Chybně specifikované množství !!!'; return false;}
	if (!IsNumeric($F("getamount"))){ $("resarea").innerHTML = 'Chybně specifikované množství !!!'; return false;}
	if ( $F("getamount")=='0') { $("resarea").innerHTML = 'Chybně specifikované množství !!!'; return false;}
	//if (parseFloat($F("getamount")) > parseFloat($F("max"))){ $("resarea").innerHTML = 'Vámi požadované množství není na skladě !!!'; return false;}
	var ajax = new bAjax();
	var url='http://'+location.host+'/pages/shop_ajax.php';
 	ajax.sendData='id='+$F('id')+deli+'amount='+$F('getamount')+deli+'section=buygoods';
 	ajax.Request(url, function(str) {
		ajax.sendData='section=sumcart';
		ajax.Request(url, function(str) {
			$("carttotal").innerHTML=str;
		});
	});
	hs.close(ele);
	return false;
}

function IsNumeric(sText)

{
   var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;

   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   };
   
function addone(id)
{
	var ajax = new bAjax();
	var url='http://'+location.host+'/pages/shop_ajax.php';
 	ajax.sendData='id='+id+deli+'section=addone';
 	ajax.Request(url, function(str) {
		document.location='http://'+location.host+'/kosik/';
	});
	return false;
}

function delone(id)
{
	var ajax = new bAjax();
	var url='http://'+location.host+'/pages/shop_ajax.php';
 	ajax.sendData='id='+id+deli+'section=delone';
 	ajax.Request(url, function(str) {
		document.location='http://'+location.host+'/kosik/';
	});
	return false;
}

function delall(id)
{
	var ajax = new bAjax();
	var url='http://'+location.host+'/pages/shop_ajax.php';
 	ajax.sendData='id='+id+deli+'section=delall';
 	ajax.Request(url, function(str) {
		document.location='http://'+location.host+'/kosik/';
	});
	return false;
}

function clearcart()
{
	if (confirm('Opravdu si přejete smazat všechny položky ?'))
	{
		var ajax = new bAjax();
		var url='http://'+location.host+'/pages/shop_ajax.php';
		ajax.sendData='section=clearcart';
		ajax.Request(url, function(str) {
			document.location='http://'+location.host+'/kosik/';
		});
	}
	return false;
}

function sendorder()
{
	if (confirm('Opravdu si přejete odeslat objednávku ?'))
	{
		var ajax = new bAjax();
		var url='http://'+location.host+'/pages/shop_ajax.php';
		ajax.sendData='note='+$F("getpozn")+deli+'section=sendorder';
		ajax.Request(url, function(str) {
			alert('Vaše objednávka byla odeslána. Děkujeme.');
			document.location='http://'+location.host+'/kosik/';
		});
	}
	return false;
}
