 function Rozbal(id)
 {
  var obj = document.getElementById('elem'+id);
  if(obj.style.display == 'none')
   obj.style.display = 'block';
  else
   obj.style.display = 'none'
 }
 function SbalVse()
  {
 	  var elems =new Array(1, 2, 3, 301, 3011, 302, 303, 304, 3041, 305, 306, 3061, 3062, 3063, 4, 401, 402, 403, 404,405,406,407,408, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,16);
     for(i=0; i < elems.length; i++)
     {
  	   var obj = document.getElementById('elem'+ elems[i]);
       obj.style.display = 'none';
  	 }
    
  }
 function SbalVse2()
  {
 	  //var elems =new Array(1, 2, 3, 301, 3011, 302, 303, 304, 3041, 305, 306, 3061, 3062, 3063, 4, 401, 402, 403, 404,405,406,407,408, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
     for(i=1; i < 28; i++)
     {
  	   var obj = document.getElementById('elem'+ i);
       obj.style.display = 'none';
  	 }
    
  }
  function RozbalVse()
  {
 	  var elems =new Array(1, 2, 3, 301, 3011, 302, 303, 304, 3041, 305, 306, 3061, 3062, 3063, 4, 401, 402, 403, 404,405,406,407,408, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,16);
     for(i=0; i < elems.length; i++)
     {
  	   var obj = document.getElementById('elem'+ elems[i]);
       obj.style.display = 'block';
  	 }
    
  }
    function RozbalVse2()
  {
 	  //var elems =new Array(1, 2, 3, 301, 3011, 302, 303, 304, 3041, 305, 306, 3061, 3062, 3063, 4, 401, 402, 403, 404,405,406,407,408, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
     for(i=1; i < 28; i++)
     {
  	   var obj = document.getElementById('elem'+ i);
       obj.style.display = 'block';
  	 }
    
  }
function files(table)
{

  var i;
  var istr;
  var istr2;
  var last=0;
  var tmp;
  var inputs=new Array();
  var output; 
  
//  alert(input.form.elements['document'+table+'0']);
  
  output='';
  
  i=0;
  istr='0';
  while (document.getElementById('document'+table+istr))
  {
    tmp=document.getElementById('document'+table+istr).value;
    if (''!=tmp)
    {
      output+='<input type="file" id="document'+table+istr+'" name="document'+table+istr+'" value="'+tmp+'" onchange="files(\''+table+'\');"/><br />';
    }
    inputs[i]=tmp;
    i++;
    istr=''+i;
  }
  
  output+='<input type="file" id="document'+table+istr+'" name="document'+table+istr+'" onchange="files(\''+table+'\');" />';
  
  document.getElementById('documents'+table).innerHTML=output;
  document.getElementById('documentnew0').value='aaa';
  
  
/*   
  for (i=1; i<=10; i++)
  {
    istr='cv'+i;
    istr2='cv-'+i;

    if (''!=document.getElementById(istr).value)
    {
      document.getElementById(istr2).style.display='block';
      last=i;
    }
    else
    {
   //   document.getElementById(istr2).style.display='none';
      tmp=i;
      while ( (tmp<10) && (''!=document.getElementById('cv'+(tmp+1)).value) )
      {
        document.getElementById('cv'+tmp).value=document.getElementById('cv'+(tmp+1)).value;
        last=tmp;
        tmp++;
      }
      
      if (tmp<=10)
      {
         document.getElementById('cv-'+(tmp)).style.display='none';
         document.getElementById('cv'+(tmp)).value='';
      }
    }
  }
  
  if (10>last)
  {
    istr='cv-'+(last+1);
    document.getElementById(istr).style.display='block';
  }
*/

}


function showDetail(url,w,h){

	wasOpen  = false;
  if ( (0<w) && (0<h) )
  {
	 win = window.open(url,'detail','left='+(screen.width/2-w/2)+', top='+(screen.height/2-h/2)+', width='+w+',height='+h+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
	}
	else
	{
    win = window.open(url);
  }
	win.focus();
  return (typeof(win)=='object')?true:false;

}       
function showDetail2(file,w,h){

	wasOpen  = false;
  if ( (0<w) && (0<h) )
  {
  
  okno = '<html>';
  okno +='<body>';  
  okno += '<p id="player">Nainstaluj te si <a href="http://www.macromedia.com/go/getflashplayer">Flash Player</a> pro shlédnutí videa.</p>';
  okno +='</body>';
  okno +='</html>';
    if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;

	   var s2 = new SWFObject("/flvplayer.swf","playlist","320","240","7");
	   s2.addParam("allowfullscreen","true");
	   s2.addVariable("file","/video/playlist.xml");
	   s2.addVariable("displayheight","400");
	   s2.addVariable("backcolor","0x034ea2");
	   s2.addVariable("frontcolor","0xf3fbff");
	   s2.addVariable("lightcolor","0xc7eafb");
	   s2.write("player");

  
  
	 win = window.open(okno,'detail','left='+(screen.width/2-w/2)+', top='+(screen.height/2-h/2)+', width='+w+',height='+h+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
	}
	else
	{
    win = window.open(url);
  }
	win.focus();
  return (typeof(win)=='object')?true:false;

}  

function showSubmenu(no)
{
  if (document.getElementById('submenu'+no))
  {
    document.getElementById('menu'+no).style.background='url(../images/menu-active.png) right bottom no-repeat'; 
    document.getElementById('submenu'+no).style.visibility='visible';  
    document.getElementById('submenu'+no).style.top=(document.getElementById('menu'+no).offsetTop+2)+'px';  
  }
}

function hideSubmenu(no)
{       
  if (document.getElementById('submenu'+no))
  {
    document.getElementById('menu'+no).style.background='url(../images/menu-separator.jpg) right bottom no-repeat'; 
    document.getElementById('submenu'+no).style.visibility='hidden';  
  }
}










  function monthName(month){

   
    var mn=new Array(13); 
    
    mn[1]='Leden';
    mn[2]='Únor';
    mn[3]='Březen';
    mn[4]='Duben';
    mn[5]='Květen';
    mn[6]='Červen';
    mn[7]='Červenec';
    mn[8]='Srpen';
    mn[9]='Září';
    mn[10]='Říjen';
    mn[11]='Listopad'; 
    mn[12]='Prosinec';
    
    return mn[month];
  }


// nastavi datum a cas vybrany v kalendari do inputboxu "date"

function setDateTime(day, month, year, hour, min, obj)
{
  document.getElementById('time_select').style.visibility='hidden';
  document.getElementById(obj).value=day+'. '+month+'. '+year+', '+document.getElementById('hour').value+':'+document.getElementById('minute').value;
}            




// zobrazi kalendar

function calendar(month, year, hour, min, obj)
{
  var content;
  
  
  if ('visible'!=document.getElementById('time_select').style.visibility)   
  {  
    var string=new String(document.getElementById(obj).value);
    var tmp=string.split(', ');
    var tmp_date=new String(tmp[0]);
    var tmp_time=new String(tmp[1]);
    
    var date=tmp_date.split('. ');
    var time=tmp_time.split(':');
    

    n_month=date[1];
    n_year=date[2];
    
    n_hour=time[0];
    n_min=time[1]; 
    
    
    if ( 
      (parseInt(n_month)<13) && (parseInt(n_month)>0)
      &&
      (parseInt(n_year)<3000) && (parseInt(n_year)>1970)
      &&
      (parseInt(n_hour)<25) && (parseInt(n_hour)>=0)
      &&
      (parseInt(n_min)<60) && (parseInt(n_min)>=0) 
    )
    {
      month=parseInt(n_month);   
      year=parseInt(n_year);
      hour=parseInt(n_hour);
      min=parseInt(n_min);
    }
    
  }
  
  date=new Date(year, month-1, 1);
  var dow=date.getDay()-1;
  
  
  var daysinmonth = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) daysinmonth[2] = 29;
  
  var nod=daysinmonth[month-1];
  
  
  content='<div class="float_right" onmouseover="this.style.cursor=\'pointer\';" onclick="document.getElementById(\'time_select\').style.visibility=\'hidden\';">X</div><b>Zvolte čas a poté datum</b> ';

  content+='<div class="margin-top"><input type="text" id="hour" maxlength="2" value="'+hour+'" /> h : <input type="text" id="minute" maxlength="2" value='+min+' /> m</div><br />';

  content+='<div id="cal_tab"><table id="calendar_table" cellpadding="0" cellspacing="0" border="0">';

  content+='<tr><th>Po</th><th>Út</th><th>St</th><th>Čt</th><th>Pá</th><th>So</th><th>Ne</th></tr>';

  
  if (dow<0)
  {
    dow=dow+7;
  }
  
  for (i=1; i<=dow%7; i++)
  {
    if (1==i%7)
    {
      content+='</tr><tr>';
    }
    content+='<td>&nbsp;</td>'; 
  
  }
  
  
  for (i=dow+1; i<=nod+dow; i++)
  {
    if (1==i%7)
    {
      content+='</tr><tr>';
    }   
    
    content+='<td><span onmouseover="this.style.cursor=\'pointer\';" onclick="setDateTime('+(i-dow)+', '+month+', '+year+', '+hour+', '+min+', \''+obj+'\')">'+(i-dow)+'</a></td>';           
  }

  if (0!=(nod+dow)%7)
  {
    for (i=(nod+dow)%7; i<7; i++)
    {
      content+='<td>&nbsp;</td>'; 
    }
  }

  content+='</tr>';   
  
  content+='</table></div>';   
   
  if (month>1)
  {
    content+='<span onmouseover="this.style.cursor=\'pointer\';" onclick="calendar('+(month-1)+', '+year+', '+hour+', '+min+', \''+obj+'\')"> &lt; </span>';
  }
   
  content+=monthName(month);
  
  if (month<12)
  {
    content+='<span onmouseover="this.style.cursor=\'pointer\';" onclick="calendar('+(month+1)+', '+year+', '+hour+', '+min+', \''+obj+'\')"> &gt; </span>';
  }
 
  content+='<br />';
 
  if (year>1970)
  {
    content+='<span onmouseover="this.style.cursor=\'pointer\';" onclick="calendar('+month+', '+(year-1)+', '+hour+', '+min+', \''+obj+'\')"> &lt; </span>';
  }
    
  content+=year;
  
  if (year<3000) 
  {
    content+='<span onmouseover="this.style.cursor=\'pointer\';" onclick="calendar('+month+', '+(year+1)+', '+hour+', '+min+', \''+obj+'\')"> &gt; </span><br />';
  }

  
  

  document.getElementById('time_select').style.left=(screen.width/2-document.getElementById('time_select').offsetWidth/2)+'px';
  document.getElementById('time_select').style.top=(screen.height/2-document.getElementById('time_select').offsetHeight/2)+'px';
  document.getElementById('time_select').style.visibility='visible';
  document.getElementById('time_select').innerHTML=content;
}   














function setDate(day, month, year, obj)
{
  document.getElementById('time_select').style.visibility='hidden';
  document.getElementById(obj).value=day+'. '+month+'. '+year;
}            





function calendarDate(month, year, obj)
{

  var content;
  var css_class;

  if (month<1)
  {
    month=12;
    year--;
  }
  
  if (month>12)
  {
    month=1;
    year++;
  }
  
  if ('visible'!=document.getElementById('time_select').style.visibility)   
  {  
    var string=new String(document.getElementById(obj).value);
    var tmp=string.split(', ');
    var tmp_date=new String(tmp[0]);
    var tmp_time=new String(tmp[1]);
    
    var date=tmp_date.split('. ');
    var time=tmp_time.split(':');
    

    n_month=date[1];
    n_year=date[2];
    
    
    
    if ( 
      (parseInt(n_month)<13) && (parseInt(n_month)>0)
      &&
      (parseInt(n_year)<3000) && (parseInt(n_year)>1970)
    )
    {
      month=parseInt(n_month);   
      year=parseInt(n_year);
    }
    
  }
  
  date=new Date(year, month-1, 1);
  var dow=date.getDay()-1;

  var today=new Date();
  
  
  var daysinmonth = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) daysinmonth[2] = 29;
  
  var nod=daysinmonth[month-1];
  
  
  content='<div class="float_right" onmouseover="this.style.cursor=\'pointer\';" onclick="document.getElementById(\'time_select\').style.visibility=\'hidden\';">X</div><b>Zvolte datum</b> ';

  content+='<div id="cal_tab"><table id="calendar_table" cellpadding="0" cellspacing="0" border="0">';

  content+='<tr><th>Po</th><th>Út</th><th>St</th><th>Čt</th><th>Pá</th><th class="weekend">So</th><th class="weekend">Ne</th></tr>';

  
  if (dow<0)
  {
    dow=dow+7;
  }
  
  for (i=1; i<=dow%7; i++)
  {
    if (1==i%7)
    {
      content+='</tr><tr>';
    }
    content+='<td>&nbsp;</td>'; 
  
  }
  
  
  for (i=dow+1; i<=nod+dow; i++)
  {
    if (1==i%7)
    {
      content+='</tr><tr>';
    }   
      
      if ( ((i-dow)==today.getDate()) && (month==(today.getMonth()+1)) && (year==(today.getYear()+1900)) )
      {
        css_class=' class="today"';
      }
      else
      if ( (i%7>5) ||  (0==i%7) )
      {
        css_class=' class="weekend"';
      }
      else
      {
        css_class='';
      }
    
    content+='<td'+css_class+'><span onmouseover="this.style.cursor=\'pointer\';" onclick="setDate('+(i-dow)+', '+month+', '+year+', \''+obj+'\')">'+(i-dow)+'</a></td>';           
  }

  if (0!=(nod+dow)%7)
  {
    for (i=(nod+dow)%7; i<7; i++)
    {
      content+='<td'+css_class+'>&nbsp;</td>'; 
    }
  }

  content+='</tr>';   
  
  content+='</table></div>';   
  
  content+='<div id="month_year_select">';
  
  content+='<span class="left_arrow" style="padding-left: 15px;" onmouseover="this.style.cursor=\'pointer\';" onclick="calendarDate('+(month-1)+', '+year+', \''+obj+'\')"><!-- --></span>';
   
  content+='<span class="month_select">'+monthName(month)+'</span>';
  
  content+='<span class="right_arrow" onmouseover="this.style.cursor=\'pointer\';" onclick="calendarDate('+(month+1)+', '+year+', \''+obj+'\')"><!-- --></span>';
 
  content+='<div class="clear_both"><!-- --></div>';
 
  if (year>10)
  { 
    content+='<span class="left_long_arrow" onmouseover="this.style.cursor=\'pointer\';" onclick="calendarDate('+month+', '+(year-10)+', \''+obj+'\')"><!-- --></span>';
  }

  if (year>1)
  {
    content+='<span class="left_arrow" onmouseover="this.style.cursor=\'pointer\';" onclick="calendarDate('+month+', '+(year-1)+', \''+obj+'\')"><!-- --></span>';
  }
    

  content+='<span class="year_select">'+year+'</span>';
  
  if (year<4091) 
  {
    content+='<span class="right_arrow" onmouseover="this.style.cursor=\'pointer\';" onclick="calendarDate('+month+', '+(year+1)+', \''+obj+'\')"><!-- --></span>';
  }

  if (year<5000) 
  {
    content+='<span class="right_long_arrow" onmouseover="this.style.cursor=\'pointer\';" onclick="calendarDate('+month+', '+(year+10)+', \''+obj+'\')"><!-- --></span>';
  }
  content+='<div class="clear_both"><!-- --></div>';
  
  content+='</div>';
   
  document.getElementById('time_select').style.left=(screen.width/2-document.getElementById('time_select').offsetWidth/2)+'px';
  document.getElementById('time_select').style.top=(screen.height/2-document.getElementById('time_select').offsetHeight/2)+'px';
  document.getElementById('time_select').style.visibility='visible';
  document.getElementById('time_select').innerHTML=content;
}   


function childern(node)
{
  var result='';
  var i;

    result+=node.style.length;
  
  if (count>10000) 
  {
    return false;
  }
  
  count++;
  


  for (i=0; i<node.childNodes.length; i++)
  {
    result+=childern(node.childNodes[i]);
  }
  
  return result;
}


var count=0;

function inactive()
{
/*
  var tmp;
  var i;
//  document.bgColor='#dddddd';
  
  //alert(document.styleSheets[0].cssRules.length);
  
 // alert(document.childNodes.length);

//  for (i=0; i<document.childNodes.length; i++)
//  {
//    tmp+=childern(document.childNodes[i]);
//  }


  for (i=0; i<document.styleSheets[0].cssRules.length; i++)
  {
    tmp=document.styleSheets[0].cssRules[i].style.cssText;
    if ('color'==tmp.substring(0, 5))
    {
//      alert(tmp);
      document.styleSheets[0].cssRules[].cssText='color: rgb(10, 10, 10);';
    }    
  //  alert("Style sheet " + i + " is titled " + document.styleSheets[i].title);
  }
  

//  alert(tmp);

  //document.getElementById('page').style.background='#ddd';
  //document.getElementById('page').style.background='#ddd';
*/  
  
}


function openTree()
{

}



function showImage(url){

  var w;
  var h;
  var win;

  w=h=1;
	wasOpen  = false;
  if ( (0<w) && (0<h) )
  {
	  win = window.open('', '', 'left='+(screen.width/2-70)+', top='+(screen.height/2-60)+', width=190, height=100, toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
	}
	else
	{
    win = window.open(url);
  }

  win.focus();

  win.document.write('<html style="padding: 0; maring: 0;"><head><META http-equiv="cache-control" content="no-cache" /><META http-equiv="pragma" content="no-cache" /></head><body style="padding: 0; maring: 0; background: #fff;"><div style="text-align: center; padding: 30px 0;" id="loading"><img src="/images/loading.gif" width="98" height="13" alt="" /></div><img id="photo" style="position: absolute; left: 0; top: 0; visibility: hidden;" onclick="window.close();" onload="this.style.visibility=\'visible\'; window.moveTo(screen.width/2-(document.images.photo.width+30)/2, screen.height/2-(document.images.photo.height+60)/2); window.resizeTo((document.getElementById(\'photo\').offsetWidth), (document.getElementById(\'photo\').offsetHeight+45)); window.moveTo(screen.width/2-(document.images.photo.width+10)/2, screen.height/2-(document.images.photo.height+60)/2);" name="photo" src="'+url+'" alt="" /></body></html>');
  
  return (typeof(win)=='object')?true:false;


}  

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 notice(operation, box)
{
  if (document.getElementById(box))
  {
  if ('show'==operation)
  {
    document.getElementById(box).style.backgroundPosition='0 0';    
  }
  else
  {
    //document.getElementById(box).style.visibility='hidden';
    document.getElementById(box).style.backgroundPosition='-100px -100px'; 
  }
  }
}



function objectInfoShow(obj, sender)
{
  document.getElementById('object-info').innerHTML=document.getElementById('object-info-'+obj).innerHTML
  document.getElementById('object-info').style.visibility='visible';
  document.getElementById('object-info').style.left=(findPosX(sender)-125)+'px';  
  document.getElementById('object-info').style.top=(findPosY(sender)+25)+'px';  
}

function objectInfoHide(obj)
{
  document.getElementById('object-info').style.visibility='hidden';
}



function showInfo(text)
{
  if (document.getElementById('js-info'))
  {
    document.getElementById('js-info').innerHTML=text;
    document.getElementById('js-info').style.visibility='visible';
  }
}

function hideInfo()
{
  if (document.getElementById('js-info'))
  {
    document.getElementById('js-info').style.visibility='hidden';
    document.getElementById('js-info').innerHTML='';
  }
}

function ajaxGet(key, inputId, is_null)
{

//alert(document.getElementById(inputId).options[0].value);
//return false;

  var i;
  var offset;
  
  offset=0;

  
  while (document.getElementById(inputId).options.length > 0) 
  {
		document.getElementById(inputId).removeChild(document.getElementById(inputId).childNodes[0])
	}
	
  if ('null'==is_null)
  {
	 document.getElementById(inputId).options[0]=new Option('-', '');
	 offset=1;
	}
	
	
	if (ajax[inputId][key])
	{
	
  for (i=1; i<=ajax[inputId][key].length; i++)
  {
    if (ajax[inputId][key][i])
    {
        document.getElementById(inputId).options[i]=new Option(ajax[inputId][key][i][1], ajax[inputId][key][i][0]);
    }
  }

  }
//alert(document.getElementById(inputId).innerHTML);


  return true;
        



//  alert(document.getElementById(inputId).innerHTML);

}




function ajaxInit(inputId, values)
{

  
  var pattern, character;
  var flag;
  var output;
  var master_key, popKey, valuesext;
  var tmp;
  var tmp_array=new Array();
  var offset=new Array();

  tmp=1;
  flag=1;
  output=master_key='';

  
  for (i=0; i<values.length; i++)
  {
    pattern=values.substring(i, i+3);
    character=values.substring(i, i+1);
      
    if ('$$$'==pattern)
    {
      flag=2;
      i+=2;
      popKey='';
      tmp_array[master_key]=new Array();
      offset[master_key]=0;
    }
    else if ('%%%'==pattern)
    {
      flag=3;
      i+=2;
      valuesext='';
    }
    else if ('~~~'==pattern)
    {
      flag=2;
      i+=2;
      offset[master_key]++;
      tmp_array[master_key][offset[master_key]]=new Array(popKey, valuesext);
      popKey='';
    }    
    else if ('|||'==pattern)
    {
      offset[master_key]++;
      tmp_array[master_key][offset[master_key]]=new Array(popKey, valuesext);
      flag=1;
      i+=2;
      master_key='';
    }  
    else if (1==flag)
    {
      master_key+=character;
    }  
    else if (2==flag)
    {
      popKey+=character;
    }  
    else if (3==flag)
    {
      valuesext+=character;
    }  
    
  }

      offset[master_key]++;
      tmp_array[master_key][offset[master_key]]=new Array(popKey, valuesext);


  ajax[inputId]=tmp_array;


}




var ajax=new Array();
