<!--script language="JavaScript" type="text/javascript"-->
<!--

function linkto(urlvar)
{ 
	//window.open(urlvar,'_self');
	//window.navigator(urlvar);
	window.location.href = urlvar;
}

$(function()
{
	$('#jScrolledTextWide, #jScrolledTextNarrow').jScrollPane({scrollbarWidth: 9});
});

$(document).ready(function()
{
	try
	{
		$(".header").click(function ()
		{
		    $('.holder').hide();
			$(this).children('.holder').toggle(); //$(".holder").toggle();
			$('#jScrolledTextWide, #jScrolledTextNarrow').jScrollPane({scrollbarWidth: 9});
			//$('#jScrolledTextWide')[0].scrollTo(this);
		});
	}
	catch(exception){}
	try	{$(".holder").click(function (){null;});}catch(exception){}
	try	{$('.#trans').supersleight();}	catch(exception){}
	try {$('#s3slider').s3Slider({ timeOut: 4000 }); } catch(exception){}
	
});

function SetSlide(imagelink)
{
    $('#targetphoto').attr("src",imagelink);
}


function markCurrent()
{
try{goUp(  document.getElementById('LT1'));} catch(exception){}
try{goDown(document.getElementById('LT1'));} catch(exception){}
try{goUp(  document.getElementById('LT2'));} catch(exception){}
try{goDown(document.getElementById('LT2'));} catch(exception){}
try{goUp(  document.getElementById('LT3'));} catch(exception){}
try{goDown(document.getElementById('LT3'));} catch(exception){}
try{goUp(  document.getElementById('LT4'));} catch(exception){}
try{goDown(document.getElementById('LT4'));} catch(exception){}
try{goUp(  document.getElementById('LT5'));} catch(exception){}
try{goDown(document.getElementById('LT5'));} catch(exception){}
}

function markCurrentRed()
{
try{goUpRed(  document.getElementById('LT1R'));} catch(exception){}
try{goDownRed(document.getElementById('LT1R')); } catch(exception){}
try{goUpRed(  document.getElementById('LT2R'));} catch(exception){}
try{goDownRed(document.getElementById('LT2R')); } catch(exception){}
try{goUpRed(  document.getElementById('LT3R'));} catch(exception){}
try{goDownRed(document.getElementById('LT3R')); } catch(exception){}
try{goUpRed(  document.getElementById('LT4R'));} catch(exception){}
try{goDownRed(document.getElementById('LT4R')); } catch(exception){}
try{goUpRed(  document.getElementById('LT5R'));} catch(exception){}
try{goDownRed(document.getElementById('LT5R')); } catch(exception){}
}


function goUp(tbl)
{ 
	tbl.style.backgroundImage="url(../img/LinkW.png)";
}


function goDown(tbl)
{ 
	filename=getFilename().toUpperCase();
	if (filename.length==0)
	    filename="INDEX.HTML";
	if (tbl.onclick.toString().toUpperCase().indexOf(filename,3) > 0)
	{
		return;	
	}
	else
	{
		tbl.style.backgroundImage="url(../img/LinkY.png)";
	}
}

function goDownTop(tbl)
{ 
	tbl.style.backgroundImage="url(../img/LinkTW.png)";
}


function goUpTop(tbl)
{ 
	filename=getFilename().toUpperCase();
		if (filename.length==0)
	    filename="INDEX.HTML";
	if (tbl.onclick.toString().toUpperCase().indexOf(filename,3) > 0)
	{
		return;	
	}
	else
	{
		tbl.style.backgroundImage="url(../img/LinkTY.png)";
	}
}

function goUpRed(tbl)
{ 
	tbl.style.backgroundImage="url(../img/LinkW.png)";
}


function goDownRed(tbl)
{ 
	filename=getFilename().toUpperCase();
	if (tbl.onclick.toString().toUpperCase().indexOf(filename,3) > 0)
	{
		return;	
	}
	else
	{
	    tbl.style.backgroundImage="url(../img/LinkR.png)";
	 //  $(this).('a').css('color','#aeaeae');
	   //             $('a').css('color','#aeaeae');
    }
}


function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1 ;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length
    return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
return ""
}

function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : "; expires="+exdate.toGMTString());
}

function checkCookieEXAMPLE()
{
username=getCookie('username');
if (username!=null && username!="")
  {
  alert('Welcome again '+username+'!');
  }
else 
  {
  username=prompt('Please enter your name:',"");
  if (username!=null && username!="")
    {
    setCookie('username',username,365);
    }
  }
}

function getFilename()
{
	var sPath = window.location.pathname;
	//var sPage = sPath.substring(sPath.lastIndexOf('\\') + 1);
	var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
	//alert(sPage);
	return sPage;
}


// *********** WEB SHOP ******** //
// *********** WEB SHOP ******** //
// *********** WEB SHOP ******** //
var basketValue = 0.0;  

function validateB()
{
	recalculate(); 
	if (basketValue<200)
	{
		alert('Basket must be filled with goods valued at a minimum 200kn.');
		return false;
	}
	if (document.getElementById('ime').value.length<=3 
		|| document.getElementById('adresa').value.length<=3  
		|| document.getElementById('telefon').value.length<=3)
	{
		alert('Please fill all the data fields.');
		return false;
	} 
	return window.confirm('Your basket if filled with products valued at ' 
							+ document.getElementById('BasketValue').value 
							+ 'kn.\r\n\r\nDo You want to send the order?');
} 

function plus(item)
{
document.getElementById(item).value = parseFloat('0' + document.getElementById(item).value) +1;
recalculate();
}
function minus(item)
{
document.getElementById(item).value = parseFloat('0' + document.getElementById(item).value) -1;
if(document.getElementById(item).value < 1)
    {
        document.getElementById(item).value = "";
    }
recalculate();
}
 
function recalculate()
{
	//alert(document.getElementById('PR101').value); 
	basketValue = ( 
	//(parseFloat('0' + document.getElementById('PR101').value) * 91)      + //kare ?
	//(parseFloat('0' + document.getElementById('PR102').value) * 91)      + //vrat ?
	(parseFloat('0' + document.getElementById('PR103').value) * 55)      + //kobasica
	(parseFloat('0' + document.getElementById('PR104').value) * 100)     + //kulenova seka
	(parseFloat('0' + document.getElementById('PR105').value) * 250)     + //kulen
	(parseFloat('0' + document.getElementById('PR106').value) * 10)      + //pasteta d
	(parseFloat('0' + document.getElementById('PR107').value) * 10)      + //pasteta p
	//(parseFloat('0' + document.getElementById('PR109').value) * 5*80)    + //slanina
	(parseFloat('0' + document.getElementById('PR110').value) * 0.5*100) + //cvarci
	(parseFloat('0' + document.getElementById('PR111').value) * 20)      + //mast
	(parseFloat('0' + document.getElementById('PR112').value) * 0.7*80)  + //sir edamac
	(parseFloat('0' + document.getElementById('PR113').value) * 80)      + //sir gauda
	(parseFloat('0' + document.getElementById('PR114').value) * 550)     + //sunka
	(parseFloat('0' + document.getElementById('PR115').value) * 70)      + //sir trapist
	0); 
	document.getElementById('BasketValue1').innerHTML 
		= document.getElementById('BasketValue2').innerHTML 
		= document.getElementById('BasketValue').value 
		= basketValue.formatMoney();
}
// *********** WEB SHOP ******** //
// *********** WEB SHOP ******** //
// *********** WEB SHOP ******** //


function StartSlideShow() {}



/************************************************/


//+ Jonas Raoni Soares Silva
//@ http://jsfromhell.com/number/fmt-money [rev. #2]

Number.prototype.formatMoney = function(c, d, t){
    var n = this, c = isNaN(c = Math.abs(c)) ? 2 : c, d = d == undefined ? "," : d, t = t == undefined ? "." : t, s = n < 0 ? "-" : "",
    i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0;
    return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t)
    + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
};

//Number.formatMoney([floatPoint: Integer = 2], [decimalSep: String = ","], [thousandsSep: String = "."]): String
//Returns the number into the monetary format.
//floatPoint
//amount of decimal places
//decimalSep
//string that will be used as decimal separator
//thousandsSep
//string that will be used as thousands separator


// -->
<!--/script-->
// JavaScript Document
