jQuery.noConflict();

var activeTab;

jQuery(document).ready(function() {


    //Default Action
    jQuery(".tab_content").hide(); //Hide all content
    jQuery("ul.tabs li:first").addClass("active").show(); //Activate first tab
    jQuery(".tab_content:first").show(); //Show first tab content
    activeTab = "#" + jQuery(".tab_content:first").get(0).id;
	
    //On Click Event
    jQuery("ul.tabs li").click(function() {
        var cont = true;
        jQuery(activeTab + "  .required").each(function() {
            if(this.value == null || this.value.length <= 0) cont = false;
        });
        if(!cont) {
            alert("Vyplňte všechna požadovaná pole!");
            return false;
        }
        jQuery("ul.tabs li").removeClass("active"); //Remove any "active" class
        jQuery(this).addClass("active"); //Add "active" class to selected tab
        jQuery(".tab_content").hide(); //Hide all tab content
        activeTab = jQuery(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
        jQuery(activeTab).fadeIn(); //Fade in the active content
        return false;
    });
	
    jQuery("ul.xtabs li").click(function() {
        var cont = true;
        jQuery(activeTab + "  .required").each(function() {
            if(this.value == null || this.value.length <= 0) cont = false;
        });
        if(!cont) {
            alert("Vyplňte všechna požadovaná pole!");
            return false;
        }
        jQuery("ul.tabs li").removeClass("active");
		
        jQuery(".tab_content").hide(); //Hide all tab content
        activeTab = jQuery(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
        jQuery(activeTab+'a').addClass("active"); //Add "active" class to selected tab
        jQuery(activeTab).fadeIn(); //Fade in the active content
        return false;
    });

});

function check(co) {
    var cont = true
    jQuery(co + " .required").each(function() {
            if($(this).val() == null || $(this).val().length <= 0) cont = false;
        });
    if(!cont) {
        alert("Vyplňte všechna požadovaná pole!");
        return false;
    }
    return true;
}
