//Document Level Settings

cdd__activate_onclick = false
cdd__showhide_delay = 100
cdd__url_target = "_self"
cdd__url_features = "resizable=1, scrollbars=1, titlebar=1, menubar=1, toolbar=1, location=1, status=1, directories=1, channelmode=0, fullscreen=0"
cdd__display_urls_in_status_bar = true
cdd__default_cursor = "hand"


cdd__codebase = ""

//NavStudio Code (Warning: Do Not Alter!)

if (window.showHelp){b_type = "ie"; if (!window.attachEvent) b_type += "mac";}if (document.createElementNS) b_type = "dom";if (navigator.userAgent.indexOf("afari")>-1) b_type = "safari";if (window.opera) b_type = "opera"; qmap1 = "\<\script language=\"JavaScript\" vqptag='loader_sub' src=\""; qmap2 = ".js\">\<\/script\>";;function iesf(){};;function vqp_error(val){alert(val)}
if (b_type){document.write(qmap1+cdd__codebase+"pbrowser_"+b_type+qmap2);document.close();}


// Dotaz na potvrzeni
function askConfirm(hlaska,url) {

	if (confirm(hlaska)) {
	return location.href=url;
	}
}


// prace s jednim check boxem
function setCheckbox(the_form, do_check, basename)
{

        if (typeof(document.forms[the_form].elements[basename]) != 'undefined') {
            document.forms[the_form].elements[basename].checked = do_check;
        }

    return true;
}


// posledni unchecked checkbox provede neco jinemu checkboxu
function lastCheckbox(the_form, basecheck, do_check, targetcheck)
{
	var ukazatel = 0;

/*
    var elts      = (typeof(document.forms[the_form].elements['selected_db[]']) != 'undefined')
                  ? document.forms[the_form].elements['selected_db[]']
                  : (typeof(document.forms[the_form].elements[basecheck]) != 'undefined')
          ? document.forms[the_form].elements[basecheck]
          : document.forms[the_form].elements['selected_fld[]'];
    var elts_cnt  = (typeof(elts.length) != 'undefined')
                  ? elts.length
                  : 0;
*/

    var elts      = document.forms[the_form].elements[basecheck];
    var elts_cnt  = (typeof(elts.length) != 'undefined')
                  ? elts.length
                  : 0;

    if (elts_cnt) 
	{
        for (var i = 0; i < elts_cnt; i++) 
		{
            if (elts[i].checked == true)
            {
				ukazatel = 1;
			}
        }
    }

	if (elts.checked == true)
	{
		ukazatel = 1;
	}

	if (ukazatel == 0) 
	{
		document.forms[the_form].elements[targetcheck].checked = do_check;
	}
    
	return true;
}


// vsechny check boxy v urcitem formulari
function setCheckboxes(the_form, do_check, basename)
{
    var elts      = (typeof(document.forms[the_form].elements['selected_db[]']) != 'undefined')
                  ? document.forms[the_form].elements['selected_db[]']
                  : (typeof(document.forms[the_form].elements[basename]) != 'undefined')
          ? document.forms[the_form].elements[basename]
          : document.forms[the_form].elements['selected_fld[]'];
    var elts_cnt  = (typeof(elts.length) != 'undefined')
                  ? elts.length
                  : 0;

    if (elts_cnt) {
        for (var i = 0; i < elts_cnt; i++) {
            elts[i].checked = do_check;
        } // end for
    } else {
        elts.checked        = do_check;
    } // end if... else

    return true;
}


// formular povoli pouze psani cisel
// pouziti: onkeypress="return onKeyPressBlockChars(event);"
// neni funkcni v Opere
function onKeyPressBlockChars(event)
{
	//verify for netscape/mozilla
	var isNS4 = (navigator.appName=="Netscape")?1:0;

	var unicode=event.keyCode? event.keyCode : event.charCode

	//alert(unicode)
	
	// povoleno zpetne lomitko, tabulator, enter
	if (unicode != 8 && unicode != 9 && unicode != 13)
	{
		if(!isNS4)
		{
			if(unicode < 48 || unicode > 57) event.returnValue = false;
		}
		else
		{
			if(unicode < 48 || unicode > 57) return false;
		}
	}
} 


// skryvani a zobrazeni polozek
var xr = new Array(0,0,0,0);
function bclick(c, r) {
        if (xr[c] != r) {
                deactivate(c, xr[c]);
                activate(c, r);
        }
}
function activate(c, r) {
        state = (document.getElementById('dc' + c + 'i' + r).style.display=='' ? 0 : 1);
        document.getElementById('dc' + c + 'i' + r).style.display = (state ? '' : 'none');
        xr[c] = r;
}
function deactivate(c, r) {
        state = (document.getElementById('dc' + c + 'i' + r).style.display=='' ? 0 : 1);
		document.getElementById('dc' + c + 'i' + r).style.display = (state ? '' : 'none');
}
  
// zmena obrazku na mouse over
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//////

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}


function cell_rollover(cell, classname) {
  if (document.all || document.getElementById) {
    cell.classBackup = cell.className;
    cell.className   = classname;
  }
}

function cell_rollout(cell)
{
  if (document.all || document.getElementById) {
    cell.className   = cell.classBackup;
  }
}

 
///// pouze zkusebni

function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
    var theCells = null;

    // 1. Pointer and mark feature are disabled or the browser can't get the
    //    row -> exits
    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }

    // 2. Gets the current row and exits if the browser can't get it
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    // 3. Gets the current color...
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
    // 3.1 ... with DOM compatible browsers except Opera that does not return
    //         valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        currentClassName = theCells[0].className;
        domDetect    = true;
    }
    // 3.2 ... with other browsers
    else {
        currentClassName = theCells[0].className;
        domDetect    = false;
    } // end 3

    // 4. Defines the new color
    // 4.1 Current color is the default one
    if (currentColor == ''
        || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor              = thePointerColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
        }
    }
    // 4.1.2 Current color is the pointer one
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()
             && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
        if (theAction == 'out') {
            newColor              = theDefaultColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
        }
    }
    // 4.1.3 Current color is the marker one
    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
        if (theAction == 'click') {
            newColor              = (thePointerColor != '')
                                  ? thePointerColor
                                  : theDefaultColor;
            marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
                                  ? true
                                  : null;
        }
    } // end 4

    // 5. Sets the new color...
    if (newColor) {
        var c = null;
        // 5.1 ... with DOM compatible browsers except Opera
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].ClassName = newColor;
            } // end for
        }
        // 5.2 ... with other browsers
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].ClassName = newColor;
            }
        }
    } // end 5

    return true;
} 


/*
============= minigalerie na strance detail vyrobku ==============
					Made by Honza
*/
function vymena(filename, popis) {
	obrazek = document.getElementById('produkt');
	name = obrazek.name;
	obrazek.src = 'shopFoto/2/'+filename;
	obrazek.name = filename;
	
	//aktualizace popisku pod obrazkem
	//alt2 = obrazek.alt
	//alert(alt2);
	popisek = document.getElementById('popisek');
	popisek.innerHTML = popis;
	//else popisek.innerHTML = '&nbsp;';
}

function ukazat() {
 	var rozmery = null
	rozmery = "HEIGHT=640,WIDTH=640";
	newWindow = window.open("","",rozmery)
	newWindow.moveTo("350","450");
	if (newWindow != null) {
		obrazek = document.getElementById('produkt');
		name = obrazek.name;
		var newContent = "<html><head><title>" + name + "</title></head>";
			newContent += '<script src="js/vymena.js" type="text/javascript" language="JavaScript1.5" charset="windows-1250"></script>';
			newContent += '<body LEFTMARGIN="0" TOPMARGIN="0" onload="resize();">';
			newContent += "<img src='shopFoto/1/" + name + "' onclick='self.close()' style=cursor:pointer name='foto'>";
			newContent += "</html>";
			newWindow.document.write(newContent)
			newWindow.document.close()
	}
}

function resize() {
	rx = document.foto.width+5;
	ry = document.foto.height+55;
	if ( rx > screen.width ) rx = screen.width;
	if ( ry > screen.height ) ry = screen.height;
	if ( rx < 200 ) rx = 200;
	if ( ry < 150 ) ry = 150;
	window.resizeTo(rx, ry); // resize window for specific image size
}


function zmenapozadi(id) {
	//alert(id);
	//return;
	div = document.getElementById(id);
	div.className = 'produkt_nahled_over';
}
function obnovapozadi(id) {
	//alert(id);
	//return;
	div = document.getElementById(id);
	div.className = 'produkt_nahled';
}


function blickover(id) {
	img = document.getElementById(id);
	img.src = 'pics/'+id+'_on.gif';
}
function blickout(id) {
	img = document.getElementById(id);
	img.src = 'pics/'+id+'_off.gif';
}

function clickOnNode(pass)	{
	var folder = document.getElementById('folder'+pass);
	var link = document.getElementById('link'+pass);
	var znamenko = document.getElementById('znamenko'+pass);
	
	if(folder.style.display == 'none') {	//radek byl skryt, bude se zobrazovat
		znamenko.src = 'pics/minus.gif';
		link.className = 'folder_open';
		if(folder!=null) folder.style.display = 'block';
	}
	else {	//radek je videt, bude se skryvat
		znamenko.src = 'pics/plus.gif';
		link.className = 'folder_close';
		if(folder!=null) folder.style.display = 'none';
	}
	return;
}

