function disableForm(theform) {
if (document.all || document.getElementById) {
for (i = 0; i < theform.length; i++) {
var tempobj = theform.elements[i];
if (tempobj.type.toLowerCase() == "submit" || tempobj.type.toLowerCase() == "reset")
tempobj.disabled = true;
}
return true;
}
else {
return false;
   }
}
var state = 'none'; 

function showhide(layer_ref) { 

if (state == 'block') { 
state = 'none'; 
} 
else { 
state = 'block'; 
} 
if (document.all) { //IS IE 4 or 5 (or 6 beta) 
eval( "document.all." + layer_ref + ".style.display = state"); 
} 
if (document.layers) { //IS NETSCAPE 4 or below 
document.layers[layer_ref].display = state; 
} 
if (document.getElementById &&!document.all) { 
hza = document.getElementById(layer_ref); 
hza.style.display = state; 
} 
} 
    var lastopen = '';
    function showhide2(id) {
        if (lastopen != '' && lastopen != id) {
            document.getElementById(lastopen).style.display = 'none';
            lastopen = '';
        }
        if (document.getElementById(id).style.display == 'none') {
            document.getElementById(id).style.display = 'block';
            lastopen = id;
        } else {
            document.getElementById(id).style.display = 'none';
            lastopen = '';
        }
    }
function replaceContent() {
 
     document.getElementById("3419").innerHTML = '';
 

}
function popitup(url) {

	newwindow=window.open(url,'popup1','height=160,width=500,miniwin,toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,location=1');
	if (window.focus) {newwindow.focus()}
	return false;
}
function form8() { 
 document.getElementById('textname').disabled = !document.getElementById('anders').checked; 
 }; 
function changeText(){
	document.getElementById('flashplay_').innerHTML = 'started';
}

function PopupCenter(pageURL, title,w,h) {
var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
} 


/* vyskakovaci */


$(document).ready(function(){

						   		   

	//When you click on a link with class of poplight and the href starts with a # 

	$('a.poplight[href^=#]').click(function() {

		var popID = $(this).attr('rel'); //Get Popup Name

		var popURL = $(this).attr('href'); //Get Popup href to define size

				

		//Pull Query & Variables from href URL

		var query= popURL.split('?');

		var dim= query[1].split('&');

		var popWidth = dim[0].split('=')[1]; //Gets the first query string value



		//Fade in the Popup and add close button

		$('#' + popID).fadeIn().css({ 'width': Number( popWidth ) }).prepend('<a href="#" class="close"><img src="http://musictrance.cz/close_pop.png" class="btn_close" title="Ukončit přehrávání" alt="Ukončit přehrávání" /></a>');

		

		//Define margin for center alignment (vertical + horizontal) - we add 80 to the height/width to accomodate for the padding + border width defined in the css

		var popMargTop = ($('#' + popID).height() + 80) / 2;

		var popMargLeft = ($('#' + popID).width() + 80) / 2;

		

		//Apply Margin to Popup

		$('#' + popID).css({ 

			'margin-top' : -popMargTop,

			'margin-left' : -popMargLeft

		});

		

		//Fade in Background

		$('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.

		$('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); //Fade in the fade layer 

		

		return false;

	});

	

	

	//Close Popups and Fade Layer

	$('a.close, #fade').live('click', function() { //When clicking on the close or fade layer...

	  	$('#fade , .popup_block').fadeOut(function() {

			$('#fade, a.close').remove();  

	}); //fade them both out

		

		return false;

	});



	

});




/* menu vybalovani hlavni menu */

        $(document).ready(function () {
                $('#next-category').click(
                function(){
                if($('#category-item').css('display') == 'block')
                        $('#category-item').css('display', 'none');
                else
                $('#category-item').show().css('display', 'block');
                }		
                );
                return false;
        
        });
	

