          function findPosX(obj)
     {

          var curleft = 0;
          if (obj.offsetParent)
          {
               while (obj.offsetParent)
               {
                    curleft += obj.offsetLeft
                    obj = obj.offsetParent;
               }
          }
          else if (obj.x)
               curleft += obj.x;
return curleft;
}

function findPosY(obj)
     {
          var curtop = 0;
          if (obj.offsetParent)
          {
               while (obj.offsetParent)
               {
                    curtop += obj.offsetTop
                    obj = obj.offsetParent;
               }
          }
          else if (obj.y)
               curtop += obj.y;
return curtop;
}



          function maskKeyPress(objEvent) {
               var iKeyCode;
               iKeyCode = objEvent.keyCode;
               if(iKeyCode>=48 && iKeyCode<=57) return true;
               return false;
          }

		var cnt_offset_dx=-5;
		var cnt_offset_dy=0;
		var val_show_div = false;

		function storeValueAndHide(pic){
			parent.top_frame.Smile(pic);
			hideSmilesDiv();
		}

		function showSmilesDiv(){
			smilesDiv.style.display='block';
			smilesDiv.style.position='absolute';

			smilesDiv.style.left=(document.body.clientWidth-smilesDiv.clientWidth)+cnt_offset_dx;
			smilesDiv.style.top=cnt_offset_dy;
		}
	
		function hideSmilesDiv(){
			parent.top_frame.val_show_div = false;
			smilesDiv.style.display='none';
		}
		
		function isShowSmilesDiv(){
			return (smilesDiv.style.display=='block');
		}

		function showHideSmiles(){
			if (parent.board.isShowSmilesDiv()){
				parent.board.hideSmilesDiv();
				parent.top_frame.val_show_div = false;
			}else{
				parent.board.showSmilesDiv();
				parent.top_frame.val_show_div = true;
			}
		}

		function Smile(pic){
	          	form1.text.focus();
	            	form1.text.value = form1.text.value+pic;
          	}

    		function MM_jumpMenu(targ,selObj,restore){
      		eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
      		if(restore) selObj.selectedIndex=0;
    		}

    		function setFocus(){
    			document.form_chat.chat_query.focus();
    		}

        	function MM_goToURL() {
          	var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
          	for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location=\'"+args[i+1]+"\'");
        	}

		function openWin(src,sirka,vyska){
			scroll_bars = "yes";

			if((typeof(win)!= "undefined") && (win.closed == false)){
				x1 = win.document.body.clientWidth;
				y1 = win.document.body.clientHeight;
				win.location = src;
				win.resizeBy(sirka-x1,vyska-y1);
			}else{
				win = window.open(src,"Okno", "width="+sirka+",height="+vyska+",toolbar=0,directories=0,menubar=0,status=0,resizable=1,location=0,scrollbars="+scroll_bars);
			}
			win.focus();
		}

		function openWin2(name,src,sirka,vyska){
			var scroll_bars = "no";
			if(parseInt(vyska) > 700) scroll_bars = "yes";
			if((typeof(win)!= "undefined") && (win.closed == false)){
				x1 = win.document.body.clientWidth;
				y1 = win.document.body.clientHeight;
				win.location = src;
				win.resizeBy(sirka-x1,vyska-y1);
			}else{
				win = window.open(src, name, "width="+sirka+",height="+vyska+",toolbar=0,directories=0,menubar=0,status=0,resizable=1,location=0,scrollbars="+scroll_bars);
			}
			win.focus();
		}


          function openChat(src,sirka,vyska){
               var scroll_bars = "no";
               if(parseInt(vyska) > 700)scroll_bars = "yes";

               if((typeof(chat)!= "undefined") && (chat.closed == false)){
                    x1 = chat.document.body.clientWidth;
                    y1 = chat.document.body.clientHeight;
                    chat.location = src;
                    chat.resizeBy(sirka-x1,vyska-y1);
               }else{
               	chat = window.open(src,"OknoChatu", "width="+sirka+",height="+vyska+",toolbar=0,directories=0,menubar=0,status=0,resizable=1,location=0,scrollbars="+scroll_bars);
               }
               chat.focus();
          }

          function Res(src,dwidth,dheight) {
                document.location = src;
                window.resizeBy(dwidth,dheight);
          }

          function ahoj(x,y){
              	x1 = window.document.body.clientWidth;
              	y1 = window.document.body.clientHeight;
              	window.resizeBy(x-x1,y-y1);
          }

          function AddPic(pic){
               form1.note.focus();
               form1.note.value = form1.note.value+ "\n" + pic + "\n";
          }

          function form_chat_check(formular){
               if (form1.text.value == ""){
                    alert('Musíte zadat nejaký text!');
                    form1.text.focus();
                    return false;
               }else{
                    return true;
               }
          }

          function ChatBoxWidth(){
               if (document.body.offsetWidth > 280){
                    document.form1.text.style.width = document.body.offsetWidth - 190 + 'px';
               }
          }

          function chat_refresh() {
              document.form1.text.focus();
              parent.frames[1].location.reload();
    		}


          function countit(i) {
          	obj = window.document.getElementById("text_" + i);
               document.getElementById("charsLeft_" + i).innerHTML = 255 - obj.value.length;
               if(obj.value.length >= 255){
                obj.value = obj.value.substr(0, 255);
                return false;
               }
          }

function ToggleDiv(divName){
     objDiv = document.getElementById(divName);
     if(objDiv != null){
          if(objDiv.style.display == "none") objDiv.style.display = "block";
          else objDiv.style.display = "none";
     }
}

var type = 1;
function ShowAllTreeDivs(){
     var divs = document.getElementById('garage_tree').getElementsByTagName('div');
     if(divs == null) return;
     vis = (type == 1 ? "block":"none");
     type = !type;
     for(i=0;i<divs.length;i++){
          if(divs[i].id.match('div_tree_')){ //if they are 'see' divs

               if (document.getElementById) // DOM3 = IE5, NS6
                    divs[i].style.display = vis; // show/hide
               else
                    if (document.layers) // Netscape 4
                         document.layers[divs[i]].display = vis;
                    else // IE 4
                         document.all.hideshow.divs[i].visibility = vis;

          }
     }

     objshowHideText = document.getElementById('showHideText');
     if(objshowHideText != null){
     	objshowHideText.innerText = (type == 0 ? "Sbalit vše":"Rozbalit vše");
     }

}



var objects = document.getElementsByTagName("object");

function eolas(i)
{
    objects[i].outerHTML = objects[i].outerHTML;
}

for (var i=0; i<objects.length; i++)
    window.setTimeout("eolas(" + i + ")", 1);

