
function submitformid( id )
{
  submitform( document.getElementById(id) );
}

function submitform( ii )
{
  ii.submit();
}


function getImgProd(proid,poradie,width,height){
	 var x1 = width + 20;
	 var y1 = height + 30;
     var left = screen.width/2 - x1/2;
     var top = screen.height/2 - y1/2;
     window.open("./showimg.php?id="+proid+"&p="+poradie,"detailIMG","scrollbars=no,width="+x1+",height="+y1+",left="+left+",top="+top);	
}

function getFaDetail(proid,poradie,width,height){
	 var x1 = 800;
	 var y1 = 900;
     var left = screen.width/2 - x1/2;
     var top = screen.height/2 - y1/2;
     window.open("/moje_funkcie/pre_fakturu_pdf.php?id="+proid+"&p="+poradie,"detailIMG","scrollbars=yes,width="+x1+",height="+y1+",left="+left+",top="+top);	
}
function getPlatobneDetail(proid,poradie,width,height){
	 var x1 = 800;
	 var y1 = 900;
     var left = screen.width/2 - x1/2;
     var top = screen.height/2 - y1/2;
     window.open("./showplatobne.php?id="+proid+"&p="+poradie,"detailIMG","scrollbars=yes,width="+x1+",height="+y1+",left="+left+",top="+top);	
}

function getPoukazkaDetail(proid,poradie,width,height){
	 var x1 = 800;
	 var y1 = 900;
     var left = screen.width/2 - x1/2;
     var top = screen.height/2 - y1/2;
     window.open("./showpoukazka.php?id="+proid+"&p="+poradie,"detailIMG","scrollbars=yes,width="+x1+",height="+y1+",left="+left+",top="+top);	
}



 function showHide(id)
   {
		var style=document.getElementById(id).style;
		style.display = (style.display=="none") ? 'block' : 'none';
	}



function klik_na_select( id_hiddenu, hodnota_do_hiddenu, id_zobrazeneho_div, hodnota_zobrazeneho_div, id_otvorenej_ponuky )
 {
   nahrada_selectu( id_hiddenu, hodnota_do_hiddenu, id_zobrazeneho_div, hodnota_zobrazeneho_div  );
   hide_element( id_otvorenej_ponuky );
 }

function nahrada_selectu( id_hiddenu, hodnota_do_hiddenu, id_zobrazeneho_div, hodnota_zobrazeneho_div  )
  {
		 document.getElementById(id_zobrazeneho_div).innerHTML = hodnota_zobrazeneho_div;
		 document.getElementById(id_hiddenu).value = hodnota_do_hiddenu;
	}

 function show_element(id)
  {
		var style=document.getElementById(id).style;
		style.display =  'block' ;
	}

 function hide_element(id)
  {
		var style=document.getElementById(id).style;
		style.display =  'none' ;
	}	
	function pozadie (farba,idd)
  {
		idd.style.background = farba;
	}

	function zmena_obsahu (novy_obsah, id)
  {
		id.innerHTML = novy_obsah;
	}
	
	function ukaz_darcek( id ,pocet )
	{
	  var na_zviditelnenie = 0;
	  var bol_viditelny = 0;
	 
    for(i=0;i<pocet;i++)
    {
      if( bol_viditelny == 1 )
      {
        bol_viditelny = 2;
        na_zviditelnenie = i;
      }
     
      var style=document.getElementById( id+"_"+i ).style;
      if( style.display == 'block' && bol_viditelny == 0 ) bol_viditelny = 1;
      document.getElementById( id+"_"+i ).style.display = 'none';
    }
    document.getElementById( id+"_"+na_zviditelnenie ).style.display = 'block';
  }
	
	function ukaz_darcek_bck( id ,pocet )
	{
	  var na_zviditelnenie = pocet - 1;
	  var bol_viditelny = 0;
	 
    for(i=pocet-1;i>=0;i--)
    {
      if( bol_viditelny == 1 )
      {
        bol_viditelny = 2;
        na_zviditelnenie = i;
      }
     
      var style=document.getElementById( id+"_"+i ).style;
      if( style.display == 'block' && bol_viditelny == 0 ) bol_viditelny = 1;
      document.getElementById( id+"_"+i ).style.display = 'none';
    }
    document.getElementById( id+"_"+na_zviditelnenie ).style.display = 'block';
  }
	
	
	function insertimg(linka){
     	var left = screen.width/2 + 150;
    	window.open("./venovanieDetail.php?typimg=1&img="+linka+"","prehladIMG","scrollbars=yes,width=300,height=650,left="+left+",top=10");
	}
	
	function zrusit_obsah_inputu( id )
	{
    id.value="";
  }

	function zmena_obsah_inputu( id, val )
	{
    document.getElementById(id).value=val;
  }
	
	function ukaz_kategoriu(kat_id){
     	var left = screen.width/2 + 150;
    	//window.open("./obsah_kategorieDetail.php?kat_id="+kat_id+"","prehladIMG","scrollbars=yes,width=800,height=750,left="+left+",top=10");
    	zviditelnit_help_700( "./obsah_kategorieDetail.php?kat_id="+kat_id );
	}

function getOtazkaAukciu( a_id, p_id ){
        var left = screen.width/2 - 400;
        var top = screen.height/2 - 400;
        //zviditelnit_help_700( "./forms/otazka_k_aukcii.php?a_id="+a_id+"&p_id="+p_id );
         window.onload=function(){tb_show("otazka", "./forms/otazka_k_aukcii.php?a_id="+a_id+"&p_id="+p_id+"&TB_iframe=true&width=800&height=400", false);}
        //window.open("./forms/otazka_k_aukcii.php?a_id="+a_id+"&p_id="+p_id,"otazkaaukciu","scrollbars=yes,width=650,height=650,left="+left+",top="+top);
    }
    

    
	function zviditelnit_help (id_help)
  {
		if( id_help == 224 )
		{
     document.getElementById( "info_iframe_akcia" ).src="help.php?id="+id_help;
		 show_element("okno_help_akcia");
    }
    else
    {
		document.getElementById( "info_iframe" ).src="help.php?id="+id_help;
		show_element("okno_help");
		}
	}
	
  function zneviditelnit_help ()
  {
    hide_element("okno_help");
    hide_element("okno_help_akcia");
    hide_element("okno_help_700");
    hide_element("okno_help_900");
	}  
    
  function zviditelnit_help_2 (id_help)
  {
		document.getElementById( "info_iframe" ).src=id_help;
		show_element("okno_help");
	}  
    
   function zviditelnit_help_700 (id_help)
  {
		document.getElementById( "info_iframe_700" ).src=id_help;
		show_element("okno_help_700");
	}  

   function zviditelnit_help_900 (id_help)
  {
		document.getElementById( "info_iframe_900" ).src="help.php?id="+id_help;
		show_element("okno_help_900");
	} 
    
  function getnasiel_problem(){
        var left = screen.width/2 - 400;
        var top = screen.height/2 - 400;

        zviditelnit_help_700( "forms/nasiel_problem.php" );
        //window.open("./forms/otazka_k_aukcii.php?a_id="+a_id+"&p_id="+p_id,"otazkaaukciu","scrollbars=yes,width=650,height=650,left="+left+",top="+top);
    }
    

   function zobraz_text( t_id ){
        var left = screen.width/2 - 400;
        var top = screen.height/2 - 400;
        //zviditelnit_help_700( "./forms/sleduj_aukciu.php?a_id="+a_id );
        //window.open("./forms/sleduj_aukciu.php?a_id="+a_id,"sledujaukciu","scrollbars=yes,width=650,height=650,left="+left+",top="+top);
        tb_show("otazka", "./vypis_text.php?t_id="+t_id+"&TB_iframe=true&width=650&height=150", false);
    }
    
   function zobraz_text_2( t_id ){
        var left = screen.width/2 - 400;
        var top = screen.height/2 - 400;
        //zviditelnit_help_700( "./forms/sleduj_aukciu.php?a_id="+a_id );
        //window.open("./forms/sleduj_aukciu.php?a_id="+a_id,"sledujaukciu","scrollbars=yes,width=650,height=650,left="+left+",top="+top);
        tb_show("otazka", "./vypis_text.php?t_id="+t_id+"&TB_iframe=true&width=750&height=180", false);
    }
   
   
      function zobraz_text_cislo( t_id, premenna ){
        var left = screen.width/2 - 400;
        var top = screen.height/2 - 400;
        //zviditelnit_help_700( "./forms/sleduj_aukciu.php?a_id="+a_id );
        //window.open("./forms/sleduj_aukciu.php?a_id="+a_id,"sledujaukciu","scrollbars=yes,width=650,height=650,left="+left+",top="+top);
        tb_show("otazka", "./vypis_text.php?t_id="+t_id+"&premenna="+premenna+"&TB_iframe=true&width=650&height=150", false);
    }
    
  function prehod_valentina()
	 {
     showHide('valentinsky_oznam');
 
   
   }
   
   
   
	function zrusit_obsah_inputu_new( id )
	{
    if( id.value == "Sem napíšte PSČ, alebo mesto" || id.value == "Here type postcode or town" || id.value == "Názov produktu" || id.value == "Doplnte text poznámky" ) id.value="";
    if( id.value == 'Napríklad môžete uviesť, že príjemca má strašne rád doplnky a perličky. Alebo príjemca má rád iba prírodné materiály, nič umelé. Alebo v strede by som chcel, aby bol umiestnený "konkrétny kvet" - názov a okolo tie ostatné apod.'  ) id.value="";
  }


  function zrusit_obsah_inputu_new_2( id, text )
	{
    if( id.value == text ) id.value="";
  }

   function jumpScroll( scr ) {
   	window.scroll(0, scr ); // horizontal and vertical scroll targets
}

function IFrame(parentElement)
{
   // Create the iframe which will be returned
   var iframe = document.createElement("iframe");
 
   // If no parent element is specified then use body as the parent element
   if(parentElement == null)
      parentElement = document.body;
 
   // This is necessary in order to initialize the document inside the iframe
   parentElement.appendChild(iframe);
 
   // Initiate the iframe's document to null
   iframe.doc = null;
 
   // Depending on browser platform get the iframe's document, this is only
   // available if the iframe has already been appended to an element which
   // has been added to the document
   if(iframe.contentDocument)
      // Firefox, Opera
      iframe.doc = iframe.contentDocument;
   else if(iframe.contentWindow)
      // Internet Explorer
      iframe.doc = iframe.contentWindow.document;
   else if(iframe.document)
      // Others?
      iframe.doc = iframe.document;
 
   // If we did not succeed in finding the document then throw an exception
   if(iframe.doc == null)
      throw "Document not found, append the parent element to the DOM before creating the IFrame";
 
   // Create the script inside the iframe's document which will call the
   iframe.doc.open();
   iframe.doc.close();
 
   // Return the iframe, now with an extra property iframe.doc containing the
   // iframe's document
   return iframe;
}


