home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 October / Chip_2003-10_cd2.bin / prezentace / yamamusic / kontakty_soubory / admin.js next >
Text File  |  2003-07-24  |  5KB  |  199 lines

  1. <!--
  2. var highcolor = '#d4eef1';
  3. var lowcolor  = '#8EBDC2';
  4. var selectedcolor  = '#FF9595';
  5. var root_path = document.cookie;
  6. var enter = true;
  7.  
  8. root_path = root_path.substring(root_path.indexOf('root_path'));
  9. root_path = '/'+root_path.substring(13,root_path.indexOf(';')+1);
  10. if(root_path == '/ ') 
  11. //    alert('>'+root_path+'<');
  12. root_path = '';
  13.  
  14. function kytara_click(id)
  15. {
  16.     x = 200;y=50;
  17.     var maxX = screen.availWidth;
  18.     var maxY = screen.availHeight;
  19.     xpos = (maxX/2) - (x/2); ypos = (maxY/2) - (y/2) ;
  20.     var kytara_big = window.open('kytara_big.html?id='+id.src,'kytara_big','top='+ypos+',left='+xpos+'toolbar=no,location=no,status=no,menubar=no,scroolbars=no,resizeable=no,width='+x+',height='+y,true);
  21.     kytara_big.focus();
  22. }
  23.  
  24. function menu(id,mode,pic)
  25. {
  26.     if(id.id == 'index')
  27.     {
  28.         if(mode)
  29.         {
  30.             id.style.background = '#FFFFFF';
  31.             id.style.color        = 'black';
  32.         }
  33.         if(!mode)
  34.         {
  35.             id.style.background = 'Rgb(216,216,216)';
  36.             id.style.color        = '#2B565B';
  37.         }
  38.     }
  39.     else
  40.     {
  41.         if(mode)
  42.         {
  43.             document.getElementById('imgmenu_'+pic).src = root_path+'/images/menu_roh_on.gif';
  44.             id.style.background = '#2B565B';
  45.             id.style.color        = 'white';
  46.         }
  47.         if(!mode)
  48.         {
  49.             document.getElementById('imgmenu_'+pic).src = root_path+'/images/menu_roh_off.gif';
  50.             id.style.background = '#E8E8E8';
  51.             id.style.color        = 'black';
  52.         }
  53.     }
  54. }
  55.  
  56.  
  57. // zmena barev v objektu
  58. function changeline(id,mode,selected)
  59. {
  60.     if(mode)
  61.     {
  62. //        id.style.cursor     = 'pointer'
  63.         id.style.background = highcolor;
  64.     }
  65.     if(!mode)
  66.     {
  67. //        id.style.cursor     = 'default'
  68.         if(!selected)
  69.             id.style.background = lowcolor;
  70.         else
  71.             id.style.background = selectedcolor;
  72.     }
  73. }
  74.  
  75. function acceptmenu()
  76. {    
  77.     if(!enter) return;
  78.     if(document.menuconf.id.value == '')
  79.     {
  80.         alert('Pro editaci zßznamu musφte nap°ed vybrat po₧adovanou polo₧ku !!');
  81.         return;
  82.     }
  83.     if(location.href.indexOf('newsconf.php') != -1)
  84.     {
  85.         document.menuconf.text.value = document.all('novinka').innerHTML;
  86.         var d = document.menuconf.datum.value;
  87.         var date = d.split('.');
  88.         if (date.length != 3)
  89.         {
  90.             alert('èptan∞ zadanΘ datum !!');
  91.             document.menuconf.datum.value = '';
  92.             return;
  93.         }
  94.         document.menuconf.datum.value = date[2]+'-'+date[1]+'-'+date[0];
  95.     }
  96.     document.menuconf.action.value='acceptrecord';
  97.     if(enter) document.menuconf.submit();    
  98. }
  99.  
  100. function menuclick(href,id)
  101. {
  102. //    alert(top.document.frames["main"].document.location.href);
  103.     top.document.frames["main"].document.location.href = href+'?edit='+id;
  104. //    document.location.href = href+'?edit='+id;
  105. }
  106.  
  107. function addmenu()
  108. {
  109.     if(location.href.indexOf('newsconf.php') != -1)
  110.     {
  111.         document.menuconf.text.value = document.all('novinka').innerHTML;
  112.         var d = document.menuconf.datum.value;
  113.         var date = d.split('.');
  114.         if (date.length != 3)
  115.         {
  116.             alert('èptan∞ zadanΘ datum !!');
  117.             document.menuconf.datum.value = '';
  118.             return;
  119.         }
  120.         document.menuconf.datum.value = date[2]+'-'+date[1]+'-'+date[0];
  121.     }
  122.     document.menuconf.action.value='addrecord';
  123.     document.menuconf.submit();    
  124. }
  125.  
  126. function delmenu()
  127. {
  128.     if(document.menuconf.id.value != '')
  129.     {    
  130.         document.menuconf.action.value='delrecord';
  131.         document.getElementById('line_'+document.menuconf.line.value).style.background = highcolor;
  132.         if(confirm('Opravdu chcete smazat zßznam??') && enter)
  133.             document.menuconf.submit();    
  134.         document.getElementById('line_'+document.menuconf.line.value).style.background = lowcolor;
  135.     }
  136. }
  137.  
  138. function delnews()
  139. {
  140.     if(document.menuconf.id.value != '')
  141.     {    
  142.         document.menuconf.action.value='delrecord';
  143.         d  = document.frames("fmenu")
  144. //        alert(top.main.document.menuconf.line.value);
  145. //        d.document.getElementById('line_'+top.main.document.menuconf.line.value).style.background = highcolor;
  146.         if(confirm('Opravdu chcete smazat zßznam??'))
  147.             document.menuconf.submit();    
  148. //        d.document.getElementById('line_'+document.menuconf.line.value).style.background = lowcolor;
  149.  
  150.     }
  151. }
  152.  
  153. // prepinani stavu tlacitek
  154. function switch_button(id, status)
  155. {
  156.     var txtSrc='';
  157.     switch(status)
  158.     {
  159.         // Prepni do ON stavu!!
  160.         case true: 
  161.             if(id.src.indexOf('_on')!=-1)
  162.                 break;
  163.             txtSrc = id.src.substring(0,id.src.lastIndexOf('_'));
  164.             if(txtSrc != '')
  165.                 id.src = txtSrc+'_on.gif';            // zapnuty stav tlacitka
  166.         break;
  167.         // Prepni do OFF stavu
  168.         case false:
  169.             if(id.src.indexOf('_off')!=-1)
  170.                 break;
  171.             txtSrc = id.src.substring(0,id.src.lastIndexOf('_'));
  172.             if(txtSrc != '')
  173.                 id.src = txtSrc+'_off.gif';                // Vypnuti tlacitka
  174.         break;
  175.  
  176.         default:
  177.             if(id.src.indexOf('_on')!=-1)
  178.                 break;
  179.             txtSrc = id.src.substring(0,id.src.lastIndexOf('_'));
  180.             if(txtSrc != '')
  181.                 id.src = txtSrc+'.gif';                // Vypnuti tlacitka
  182.         break;
  183.     }
  184. }
  185.  
  186. // Provede EXECCOMMAND prikaz pro HTMLEditor
  187. function command(id,strcommand,display,value)
  188. {
  189.     document.execCommand(strcommand,display,value);
  190.     document.all('novinka').focus();
  191. }
  192.  
  193. // Volano tagem A po klepnuti na sipecku v radku seznamu menu
  194. function move(id,mode)
  195. {
  196.     document.location.href = 'menuconf.php?move='+mode+'&id='+id;
  197. }
  198. //-->
  199.