function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else 
countfield.value = maxlimit - field.value.length;
}


var my_div = null;
var newDiv = null;

$(document).ready(function(){

         $("#featured > ul").tabs({event: 'mouseover',fx:{opacity: "toggle"}}).tabs("rotate", 3000, false); 
 
});

function WSR_getElementsByClassName(_2,_3,_4){
var _5=(_3=="*"&&_2.all)?_2.all:_2.getElementsByTagName(_3);
var _6=new Array();
_4=_4.replace(/\-/g,"\\-");
var _7=new RegExp("(^|\\s)"+_4+"(\\s|$)");
var _8;
for(var i=0;i<_5.length;i++){
_8=_5[i];
if(_7.test(_8.className)){
_6.push(_8);
}
}
return (_6);
}

function odkaz(url){

document.location.href = url;
}

function ukaz(id) {
if (document.getElementById("show_"+id).style.display == ""){
show = "none";
show2 = "";
}
else{
show = "";
show2 = "none";
}
document.getElementById("show_"+id).style.display = show;
document.getElementById("ukazka_"+id).style.display = show2;
}

      function nahled(image,popis) {
      document["profil_hrace"].src = image;
      var textContent = document.getElementById('popisek_obrazku');
       
      document.getElementById('popisek_obrazku').innerHTML = popis;
      }


 function setPointer(theRow, thePointerColor)
 {
    if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        var theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        var theCells = theRow.cells;
    }
    else {
        return false;
    }

    var rowCellsCnt  = theCells.length;
    for (var c = 0; c < rowCellsCnt; c++) {
        theCells[c].style.backgroundColor = thePointerColor;
    }

    return true;
 }


function Smajlik(co) {
        document.formularek.kobsah.value = document.formularek.kobsah.value + co;
}


function pridej_soupisku()
{
if (document.getElementById('soupiska')== null)
{
// create a new div element
// and give it some content
newDiv = document.createElement("div");
newDiv.id = "soupiska";
newDiv.innerHTML = "potřebuješ flash";
// add the newly created element and it's content into the DOM
my_div = document.getElementById("header");
my_div.appendChild(newDiv);
var so = new SWFObject("http://www.real-madrid.cz/vypis/soupiska.swf", "zapasy_m", "845", "530", "8", "#000046");
so.addParam("wmode", "transparent");
so.write("soupiska");
}
}
function schovej_soupisku () {
if (document.getElementById('soupiska')!= null)
{
var t = document.getElementById('soupiska');
t.parentNode.removeChild(t);
}
}

function rozbal(id){
     var i = 1; 
     while(document.getElementById('menu_id_'+i))     {
          document.getElementById('menu_id_'+i).style.display = 'none';
          document.getElementById('menu_'+i).className = '';
          i = i+1;
     } 
     document.getElementById('menu_'+id).className = 'menu-a';
     document.getElementById('menu_id_'+id).style.display = 'inline';    
}
function zmiz(){
     var i = 1;
     while(document.getElementById('menu_id_'+i))     {
          document.getElementById('menu_id_'+i).style.display = 'none';
          document.getElementById('menu_'+i).className = '';
          i = i+1;
 
     }
}
function zmiz2(){
document.getElementById('menu_1').className = 'menu-a';
document.getElementById('menu_id_1').style.display = 'inline';

}


function bublinoviny(e){
lbActions=WSR_getElementsByClassName(document,"a","napovedna");
for(i=0;i<lbActions.length;i++){
if(window.addEventListener){
lbActions[i].addEventListener("mouseover",zobrazbublinu,false);
lbActions[i].addEventListener("mouseout",schovejbublinu,false);
}else{
lbActions[i].attachEvent("onmouseover",zobrazbublinu);
lbActions[i].attachEvent("onmouseout",schovejbublinu);
}
}
}
function zobrazbublinu(_b){
var _c;
if(_b["srcElement"]){
	_c=_b["srcElement"];
}else{
	_c=_b["target"];
}
if (_c.href == undefined){
	_c=_c.parentNode;
}
var _d=_c.href;
var _qq=_c.name;
var _e=findPos(_c)[0]+5;
var _f=findPos(_c)[1]+17;
var _10=document.createElement("div");
document.getElementsByTagName("body")[0].appendChild(_10);
_10.className="previewbubble";
if (BrowserDetect.browser == 'Explorer') {
_10.style.width="240px";
_10.style.position="absolute";
_10.style.top=_f;
_10.style.zIndex=99999;
_10.style.left=_e;
_10.style.textAlign="left";
_10.style.height="190px";
_10.style.paddingTop="0";
_10.style.paddingLeft="0";
_10.style.paddingBottom="0";
_10.style.paddingRight="0";
_10.style.marginTop="0";
_10.style.marginLeft="0";
_10.style.marginBottom="0";
_10.style.marginRight="0";
_10.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + bubbleImagePath + "',sizingMethod='image')";
} else {
_10.setAttribute("style","text-align: center; z-index: 99999; position: absolute; top: "+_f+"px ; left: "+_e+"px ; background: url("+ bubbleImagePath +") no-repeat; width: 240px; height: 190px; padding: 0; margin: 0;");
}
if (BrowserDetect.browser == 'Safari' || BrowserDetect.browser == 'Konqueror' ) {

var _height = _f;
    
_10.setAttribute("style","text-align: center; z-index: 99999; position: absolute; top: "+ _height +"px ; left: "+_e+"px ; background: url("+ bubbleImagePath +") no-repeat; width: 240px; height: 190px; padding: 0; margin: 0;");
    
}
var vlozeny = document.createElement("div");
_10.appendChild(vlozeny);
vlozeny.appendChild(document.createTextNode(_qq));
vlozeny.style.marginTop="27px";
vlozeny.style.marginLeft="24px";
vlozeny.style.marginBottom="12px";
vlozeny.style.marginRight="12px";
vlozeny.style.textAlign= "justify";
vlozeny.style.color= "#ff6600";
vlozeny.style.fontSize= "16px";
}


function schovejbublinu(_12){
lbActions=WSR_getElementsByClassName(document,"div","previewbubble");
for(i=0;i<lbActions.length;i++){
lbActions[i].parentNode.removeChild(lbActions[i]);
}
}
if(window.addEventListener){
addEventListener("load",bublinoviny,false);
}else{
attachEvent("onload",bublinoviny);
}