/*
hover = location.href.split(".html");
temp = hover[0].split("/");

if(temp[3] != ""){
    $("#status_link").val(document.location);
    var now = temp[4];
}else{
    var now = "information";
}



temp = 0;

var link = "http://www.partnerskesystemy.cz/";

var form_ok = 0;



function load_all(){

    $.validator.setDefaults({
       submitHandler: function() { $("#status_form").html("ok"); }
    });

    $('#password').keyup(function(){$('#result').html(passwordStrength($('#password').val(),$('#login').val()))});
    $("#signup_form").validate({

        rules: {
            "d[login]": "required",
            "d[password]": "required",
            "d[password2]": {
                required: true,
                equalTo: "#password"
            },
            "d[mail]": {
                required: true,
                email: true
            },
        },
        messages: {
            "d[login]": "Please enter your login name",
            "d[password]": "Please provide a password",
            "d[password2]": {
                required: "Please provide a password",
                equalTo: "Please enter the same password as above"
            },
            "d[mail]": "Please enter a valid email address",
        }
    });  
    

    $("#login_form").validate({
    
        errorLabelContainer: $(".error_login"),

        rules: {
            "d[sign_login]": "required",
            "d[sign_password]": "required",
        },
        messages: {
            "d[sign_login]": "Vyplňte poličko LOGIN.",
            "d[sign_password]": "Zadejte heslo.",
        }
    }); 
   
    
    $("#login_form").submit(function() {
        if($("#status_form").html() == "ok"){    
                var action = $(this).attr("action");
                if(!action){action = $("#status_link").html();}
                $.post(action+"?d[ajax]=1", $("form").serialize(),
                function(data){$("#block_center").html(data);load_all();});

        }
        $("#status_form").html("")
        return false;
    });
    
    
    $(".onchange_submit").change(function() {
                var action = $(this).attr("action");
                if(!action){action = $("#status_link").html();}
                $.post(action+"?d[ajax]=1", $("form").serialize(),
                function(data){$("#block_center").html(data);load_all();}); 
    });    
  
     

}

$(window).keydown( function(event) { if(event.keyCode == 116){$.get("/?d[redict]="+$("#status_link").html());} } );

//$("#status_link").html()

$(document).ready(function() {
    
    load_all();
    
    $.listen('click','a',function(){
        var targ = $(this).attr("target");
        if(targ!="_blank"){
            $("#block_center").html("<center><img src='/design/loading.gif'></center>");
            var link = $(this).attr("href"); var tempik = link.split("?");
            znak = "?"; if(tempik[1]!="" && tempik[1]!=undefined){ znak = "&"; }          
            //alert("1: "+link+znak+"d[ajax]=1");       
            $.get(link+znak+"d[ajax]=1", function(data){
                $("#block_center").html(data); load_all();
            }); 
            $("#status_link").html(link);  return false;
        }
    });
    
    $(".topmenu").click(function () {
        temp = $("#status_link").html().split("/");
        hover = temp[2].split(".");
        $("."+now+"_a").attr("class",now);
        $("."+hover[0]).attr("class",hover[0]+" "+hover[0]+"_a");
        now = hover[0];
        return false;
    });
    
});
/*

function processRequestt(status){
  if (httpRequest.readyState == 4){
    if(httpRequest.status == 200){
		alert( httpRequest.responseText);
    }else{
        alert("Chyba pri nacitani stanky"+ httpRequest.status +":"+ httpRequest.statusText);
    }
  }
}*/

function open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable){
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';
  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}

function open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';
  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}

function vote_now(object){

     if (object != ""){
        if (window.ActiveXObject){
          httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
        }else{
          httpRequest = new XMLHttpRequest();
        }
        if(status == true){
        	obj = grabObject("button_confront");
        	obj.style.visibility = "visible";
        	obj.style.position = "relative";
        	status = "yes";
        }else{
        	status = "no";
        }
        httpRequest.open("GET", "/moduls/POLL/vote_now.php?ida="+object, true);
        httpRequest.onreadystatechange= function () {processRequestt(); } ;
        httpRequest.send(null);
     }
}

function switch_visibility(to_visible, to_hidden){
	
	for(h=0;h<to_hidden.length; h++){
		var obj = grabObject(to_hidden[h]);
		if(obj){
			obj.style.visibility = "hidden";
			obj.style.position = "absolute";
		}
	}
	for(v=0;v<to_visible.length; v++){
		var obj = grabObject(to_visible[v]);
		if(obj){
			obj.style.visibility = "visible";
			obj.style.position = "relative";
		}
	}
}
function confirmDelete(delUrl) {
  if (confirm("Potvrzujete smazání tohoto prvků? Je to nenávratný.")) {
    document.location = delUrl;
  }
}

function ps_content_thumbs_mark(){
    
}
