<!--
var preloadFlag=false;var g_bIsNav4=false;if(window.navigator.appName.toLowerCase().indexOf("netscape")>-1)
{g_bIsNav4=true;}
function newImage(arg){if(document.images){rslt=new Image();rslt.src=arg;return rslt;}}
function changeNavImages(){if(document.images){for(var i=0;i<changeNavImages.arguments.length;i+=2){document[changeNavImages.arguments[i]].src=changeNavImages.arguments[i+1];}}}
function changeImages(imgName,imgSource){if(document.images){document.images[imgName].src=imgSource;}}
/*function preloadImages(root){
	if(document.images&&(preloadFlag==false)){
	fnav_acct_o=newImage(root+"/images/nav/fudgenav-acct-o.gif");
	fnav_cart_o=newImage(root+"/images/nav/fudgenav-cart-o.gif");
	fnav_help_o=newImage(root+"/images/nav/fudgenav-help-o.gif");
	fnav_lbox_o=newImage(root+"/images/nav/fudgenav-lbox-o.gif");
	fnav_srch_o=newImage(root+"/images/nav/fudgenav-srch-o.gif");

	preloadFlag=true;
	}
}*/
function openalert(windowname){msgWindow=window.open(windowname,"alertWindow","toolbar=no,menubar=no,resizable=no,scrollbars=no,width=400,height=300");}
function openhelp(windowname){msgWindow=window.open(windowname,"helpWindow","toolbar=no,menubar=no,resizable=no,scrollbars=yes,width=450,height=470");}
function openhelpshuttleboard(windowname){msgWindow=window.open(windowname,"helpWindow","toolbar=no,menubar=no,resizable=no,scrollbars=yes,width=450,height=560");}
function opencontent(windowname){msgWindow=window.open(windowname,"contentWindow","toolbar=yes,menubar=no,resizable=yes,scrollbars=yes,width=600,height=600");}
function CalcPrice(url)
{window.open(url,"calcprice","resizable=yes,scrollbars=yes,directories=no,toolbar=no,menubar=no,height=700,width=730,top=10,left=10");}
function toggle(targetId){if(document.getElementById){target=document.getElementById(targetId);if(target){if(target.style.display=="none"){target.style.display="block";}else{target.style.display="none";}}}}
function isIE5mac(){return(navigator.platform.substring(0,3)=="Mac"&&navigator.appName=="Microsoft Internet Explorer");}
function zoomToggle(targetId){if(document.getElementById){target=document.getElementById(targetId);if(target){if(isIE5mac()){if(target.style.display=="none"){target.style.display="block";}else{target.style.display="none";}}else{target.style.display="block";}}}}
function toggleVisibility(targetId){if(document.getElementById){target=document.getElementById(targetId);if(target){if(target.style.visibility=="hidden"){target.style.visibility="visible";}else{target.style.visibility="hidden";}}}}
function FindElement(controlId)
{if(document.getElementById){var el1=document.getElementById(controlId);if(el1!=null)
{return el1;}}
if(document.all)
{var el2=document.all[controlId];if(el2!=null)
{return el2;}}
var frm=document.forms[0];var el3=frm.controlId;if(el3!=null)
{return el3;}
for(var i=0;i<frm.elements.length;i++){if(frm.elements[i].name.indexOf(el3)!=-1){return frm.elements[i];}}
return null;}
var g_BlockSubmit=false;function checkBlockedSubmit()
{if(g_BlockSubmit)
{g_BlockSubmit=false;return false;}
return true;}
function trapEnterKey(evt,btnName)
{if(!enterKeyPressed(evt))
{return true;}
else
{__doPostBack(btnName,'');evt.cancelBubble=true;return false;}}
function enterKeyPressed(evt)
{if(g_bIsNav4)
{if(evt.which!=13&&evt.which!=3)
{return false;}
else
{return true;}}
else
{if(event.keyCode!=13&&event.keyCode!=3)
{event.returnValue=event.keyCode;return false;}
event.returnValue=false;return true;}}
function keywordJump(keywordControl,resultsPage)
{var keyword=keywordControl.options[keywordControl.selectedIndex].value;if(keyword.length>0)
{var resultsUrl=resultsPage+keyword;window.location=resultsUrl;}}
function NonCDSearchToggle(cdCheckbox)
{FindElement(cdCheckbox).checked=false;}
function CDSearchToggle(rmCheckbox,rfCheckbox)
{FindElement(rmCheckbox).checked=false;FindElement(rfCheckbox).checked=false;}


// --------------------------

function ShowTab(sTabLayers,sTabs,iIndex)
{
var aTabLayers = sTabLayers.split(",");
var aTabs = sTabs.split(",");
var i = 0;

for(i=0;i<aTabLayers.length;i++)
{
	//turn off all tab sections
	document.getElementById(aTabLayers[i]).style.display = "none";
}
for(i=0;i<aTabs.length;i++)
{
	document.getElementById("smalltab_"+aTabs[i]).className = "unactive";
}

//display the correct tab section and tab image (according to the arguments passed in to this function)
var sSectionDivId = aTabLayers[iIndex];
var sTabImageId = aTabs[iIndex];
document.getElementById(sSectionDivId).style.display = "block";
document.getElementById("smalltab_"+iIndex).className = "active";
}

function ShowTabAll(sTabLayers,sTabs,iIndex)
{
	var aTabLayers = sTabLayers.split(",");
	var aTabs = sTabs.split(",");
	var i = 0;

	for(i=0;i<aTabLayers.length;i++)
	{
		//turn off all tab sections
		document.getElementById(aTabLayers[i]).style.display = "block";
		
		document.getElementById("smalltab_"+aTabs[i]).className = "unactive";
	}

	//display the correct tab section and tab image (according to the arguments passed in to this function)
	var sSectionDivId = aTabLayers[iIndex];
	var sTabImageId = aTabs[iIndex];
	//document.getElementById(sSectionDivId).style.display = "block";
	document.getElementById("smalltab_"+iIndex).className = "active";
}



function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=838,height=628');");
}


function openPopup(url, name) {
				popupWin = window.open(url, name, 'scrollbars,resizable,width=480,height=320');
				window.self.name = 'cnetParent';
}

function price(id,num){
	if (document.getElementById) {
		obj = document.getElementById(id+"_"+num);
	} else if (document.all) {
		obj = document.all[id+"_"+num];
	} 
	
	price_num = document.getElementById(id+"_"+num).value;
	if (!parseInt(price_num,10) || price_num<0) 
		document.getElementById(id+"_"+num).value="0"; 
	else 
		document.getElementById(id+"_"+num).value=parseInt(price_num,10);
	
	return (parseInt(document.getElementById(id+"_"+num).value,10))*(parseInt(document.getElementById(id+"_"+num+"_price").value,10));
}
/* funkce pro zobrazeni navoleneho poctu zbozi*/
function count(id,num){
	if (document.getElementById) {
		obj = document.getElementById(id+"_"+num);
	} else if (document.all) {
		obj = document.all[id+"_"+num];
	} 
	
	price_num = document.getElementById(id+"_"+num).value;
	if (!parseInt(price_num,10) || price_num<0) 
		document.getElementById(id+"_"+num).value="0"; 
	else 
		document.getElementById(id+"_"+num).value=parseInt(price_num,10);
	
	/*return (parseInt(document.getElementById(id+"_"+num).value,10))*(parseInt(document.getElementById(id+"_"+num+"_count").value,10));*/
	return (parseInt(document.getElementById(id+"_"+num+"_count").value,10));
}


function active_row(current,id)
{
	if (document.getElementById) {
		row = document.getElementById("row"+id);
	} else if (document.all) {
		row = document.all["row"+id];
	} 
	price_value = price(id,"0") + price(id,"1") + price(id,"2") + price(id,"3");
	if (price_value != parseInt(document.getElementById(id+"_4").innerHTML)){
		if (price_value > 0){
		if ((parseInt(document.getElementById(id+"_4").innerHTML)>0) && (price_value < parseInt(document.getElementById(id+"_4").innerHTML))){
		price_total = parseInt(document.getElementById("productTableSubtotalSum").innerHTML) - (parseInt(document.getElementById(id+"_4").innerHTML)-price_value);
		//popup(price_total);
		}else {
		price_total = parseInt(document.getElementById("productTableSubtotalSum").innerHTML) + price_value - parseInt(document.getElementById(id+"_4").innerHTML);
		}
		//price_value=price_value-parseInt(document.getElementById(id+"_4").innerHTML);
		document.getElementById(id+"_4").innerHTML = price_value;
		row.setAttribute("classname",'rownotnull',0);
		row.className = 'rownotnull';
		
		}else
		{
		price_total = parseInt(document.getElementById("productTableSubtotalSum").innerHTML) - parseInt(document.getElementById(id+"_4").innerHTML);
		document.getElementById(id+"_4").innerHTML = "0";
		row.setAttribute("classname",'rownull',0);
		row.className = 'rownull';
		//document.getElementById(id+"_4").innerHTML = "";
		//price_total = 0;
		}	
	
	
	//document.getElementById("productTableSubtotalSum").innerHTML=price_total!=0?(price_total+" Kč"):"0 Kč";
	document.getElementById("productTableSubtotalSum").innerHTML=price_total!=0?(price_total):"0";
	}
	
	/*
	var price_total=0, price_str="";
	var ael=document.all?document.all:document.getElementsByTagName('span'); 
	for(i=0,j=0;i<ael.length;i++){ 
		if((ael[i].className=="totalprice")){ 
			price_total += ael[i].innerHTML?parseInt(ael[i].innerHTML,10):0;
			j++; 
		}
	} 
	*/
	//price_total = parseInt(document.getElementById("productTableSubtotalSum").innerHTML) - parseInt(document.getElementById(id+"_4").innerHTML);
		return true;
}

// specialni verze funkce pro nestandardní tabulky (objednávka obalů)
function active_row_spec(current,id,opt_id,table_id)
{
	if (document.getElementById) {
		row = document.getElementById("row"+id);
	} else if (document.all) {
		row = document.all["row"+id];
	} 

/*	id tabulky, v ktere jsou korky!!!!NE, pripocitava se k pozadovanym kusum pocet sklenicek */
	konst_table_corks = "1"; 
	
/*	normalni vypocet kusu pro jednotlive tabulky*/
	current_count = parseInt(document.getElementById(id+"_"+opt_id).value,10);
	/*	pokud se zadany pocet lisi od ulozeneho */
	if (current_count != parseInt(document.getElementById(id+"_"+opt_id+"_count").value)){
		/*	pokud je zadany pocet vyssi nez 0	*/
		if(current_count > 0){
			/*	pokud je zadany pocet mensi nez puvodni hodnota ve skytem poli (odecitani hodnoty)			*/
			if ((parseInt(document.getElementById(id+"_"+opt_id+"_count").value)>0) && (current_count < parseInt(document.getElementById(id+"_"+opt_id+"_count").value))){
				count_total = parseInt(document.getElementById("missing"+"_"+opt_id+"_"+table_id).innerHTML) - (parseInt(document.getElementById(id+"_"+opt_id+"_count").value)-current_count);
				/* korky */ if (table_id == konst_table_corks){				count_corks = parseInt(document.getElementById("corks"+"_"+opt_id+"_"+"2").innerHTML) - (parseInt(document.getElementById(id+"_"+opt_id+"_count").value)-current_count);}
			/*	pokud je zadany pocet vetsi nez puvodni hodnota ve skytem poli (přičítání hodnoty)			*/
			}else {
				count_total = parseInt(document.getElementById("missing"+"_"+opt_id+"_"+table_id).innerHTML) + current_count - parseInt(document.getElementById(id+"_"+opt_id+"_count").value);
				/* korky */ if (table_id == konst_table_corks){	count_corks = parseInt(document.getElementById("corks"+"_"+opt_id+"_"+"2").innerHTML) + current_count - parseInt(document.getElementById(id+"_"+opt_id+"_count").value);}
			}
			/* zapíše novou hodnotu do skrytého pole		*/
			document.getElementById(id+"_"+opt_id+"_count").value = current_count;
		}else	{
			/*	pokud je zadano cislo <=0, pak ho vymaz a prepocitej cenu	*/
			count_total = parseInt(document.getElementById("missing"+"_"+opt_id+"_"+table_id).innerHTML) - parseInt(document.getElementById(id+"_"+opt_id+"_count").value);
			/* korky */ if (table_id == konst_table_corks){ count_corks = parseInt(document.getElementById("corks"+"_"+opt_id+"_"+"2").innerHTML) - parseInt(document.getElementById(id+"_"+opt_id+"_count").value);}
			document.getElementById(id+"_"+opt_id+"_count").value = "0";
		}	

	document.getElementById("missing"+"_"+opt_id+"_"+table_id).innerHTML=count_total!=0?(count_total):"0";
	if (table_id == konst_table_corks){ document.getElementById("corks"+"_"+opt_id+"_"+"2").innerHTML=count_corks!=0?(count_corks):"0";	}
	}

	/*	pokud chybí k objednání, zvýrazni červeně */
	if(parseInt(document.getElementById("corks"+"_"+opt_id+"_"+"2").innerHTML) > parseInt(document.getElementById("missing"+"_"+opt_id+"_"+"2").innerHTML)){
		document.getElementById("corks"+"_"+opt_id+"_"+"2").className = 'red';
	}else{
		document.getElementById("corks"+"_"+opt_id+"_"+"2").className = '';
	}

/*	
	========= CENY ==================================================
*/
	price_value = price(id,"10") + price(id,"11");
	if (price_value != parseInt(document.getElementById(id+"_4").innerHTML)){
		if (price_value > 0){
			if ((parseInt(document.getElementById(id+"_4").innerHTML)>0) && (price_value < parseInt(document.getElementById(id+"_4").innerHTML))){
				price_total = parseInt(document.getElementById("productTableSubtotalSum").innerHTML) - (parseInt(document.getElementById(id+"_4").innerHTML)-price_value);
				//popup(price_total);
			}else {
				price_total = parseInt(document.getElementById("productTableSubtotalSum").innerHTML) + price_value - parseInt(document.getElementById(id+"_4").innerHTML);
			}
			document.getElementById(id+"_4").innerHTML = price_value;
			row.setAttribute("classname",'rownotnull',0);
			row.className = 'rownotnull';
		
		}else	{
			price_total = parseInt(document.getElementById("productTableSubtotalSum").innerHTML) - parseInt(document.getElementById(id+"_4").innerHTML);
			document.getElementById(id+"_4").innerHTML = "0";
			row.setAttribute("classname",'rownull',0);
			row.className = 'rownull';
		}	
	
	document.getElementById("productTableSubtotalSum").innerHTML=price_total!=0?(price_total):"0";
	}
		return true;
}

var imgWin;

var poll_star = -1;
var actual_star = -1;
var poll_star_round;

star_over = new Image(16,16);
star_over.src="templates/default/img/star_over.gif";
star_on = new Image(16,16);
star_on.src="templates/default/img/star_on.gif";
star_off = new Image(16,16);
star_off.src="templates/default/img/star_off.gif";


function pollClick(id) {
		poll_star = id.substr(4);
		document.forms['poll'].elements['poll'].value = poll_star;
	pollSubmit();

//    document.forms['smll'].elements['poll'].value = poll_star;

//    document.images['okL'].src = document.images['okL'].src.replace(/nook/, 'ok');
	 // document.images['okR'].src = document.images['okR'].src.replace(/nook/, 'but_send');
}

function pollOut(id, poll_star_round) {
		
		if ((poll_star != -1)){
				pollOver('poll' + poll_star);        
		}else{
			 pollOver('poll' + poll_star_round,'round');
		}
		
}

function pollOver(id,type) {
		actual_star = id.substr(4);
		var img = document.images;
		
		if (type=='round') repl = star_on.src; else repl = star_over.src;
		
		var i;
		for (i = 1; i <=5; i++)
				if (i <= actual_star){
								img['poll'+i].src = repl;
				 }else{
							img['poll'+i].src = star_off.src;
				 }
}

function pollSubmit() {
		if (poll_star != 'n' && (poll_star < 0 || poll_star > 5))
				return false;
		document.forms['poll'].submit();
}

function chImg(el, s, d) {
		s = eval(s);
		if (!el.disabled) 
				el.src = el.src.replace(s, d);
}


function open_detail(url)
{window.open(url,"detail_photo","resizable=yes,scrollbars=yes,directories=no,toolbar=no,menubar=no,height=800,width=600,top=10,left=10");}





