window.onload=function(){
	init();
	get_drinky_hp_box_content('1');
	startClock();
	rotateBanner('6');

// 	var radio_lines = getElementsByClass('odpoved','div');
//
// 	for (i=0;i<radio_lines.length;i++){
//
// 		radio_lines[i].onclick = function(){
//      	for (j=0;j<radio_lines.length;j++){
//      	  removeClass(radio_lines[j],'selected');
//      	  var butt = this.getElementsByTagName('input[0]');
//      	  butt.checked = false;
//      	}
//
// 			var button = this.getElementsByTagName('input[0]');
//
// 			addClass(radio_lines[i],'selected');
// 			button.checked = true;
//
// 		};
// 	}

};

function show_flash_hp_banner(flash, width, height, url)
{
	var div_flash 	= document.getElementById('hp_action_banner_flash');
	var div_content = document.getElementById('hp_action_banner');
	
	if ( div_flash && div_content )
	{
	    var flash_string    = flash;
	    
	    if ( url.length>0 )
	    {
	        flash_string    = flash_string + "?clickthru=" + url;
		}
	    
		var fo 				= new FlashObject(flash_string, "hp_action_banner_flash", width, height, 6);

		if (fo.installedVer.major >= 6)
		{
			fo.addParam("quality", "high");
			fo.addParam("bgcolor", "#191919");
			fo.addParam("allowScriptAccess", "sameDomain");
			fo.addParam("allowFullScreen", "false");
			fo.addParam("wmode", "transparent");

			fo.write("hp_action_banner_flash");
		}
		
		removeClass(div_flash, "hidden");
		addClass(div_content, "hidden");
	}
} // @end show_flash_hp_banner


function hidde_flash_hp_banner()
{
    var div_flash 	= document.getElementById('hp_action_banner_flash');
	var div_content = document.getElementById('hp_action_banner');

	if ( div_flash && div_content )
	{
	    addClass(div_flash, "hidden");
	    removeClass(div_content, "hidden");
	}
} // @end hidde_flash_hp_banner



/**
 *  Sledujeme pohyb mysi - vyuzito pro zobrazovani popup okynem v miste kliku
 */
 
var IE = document.all?true:false;
if (!IE) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = getMouseXY;

var tempX = 0;
var tempY = 0;

function getMouseXY(e)
{  
  if (IE)  // grab the x-y pos.s if browser is IE
  {
    var scrollTop   = 0;
    var scrollLeft  = 0;
    
    if ( ( document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop) )
    {
       scrollTop = document.documentElement.scrollTop ?
                          document.documentElement.scrollTop :
                          document.body.scrollTop;
    }
    
    if ( ( document.documentElement && document.documentElement.scrollLeft) || (document.body && document.body.scrollLeft) )
    {
       scrollLeft = document.documentElement.scrollLeft ?
                          document.documentElement.scrollLeft :
                          document.body.scrollLeft;
    }
                      
    tempX = event.x + scrollLeft;
    tempY = event.y + scrollTop;

  }
  else   // grab the x-y pos.s if browser is NS
  {
    tempX = e.pageX;
    tempY = e.pageY;
  }
  
  if (tempX < 0){tempX = 0;}
  if (tempY < 0){tempY = 0;}

  return true;
}

/**
 *  v soutezi o ctyrkolku zobrazi upozorneni ze se chysta vstup na stranky s citlivym obsahem
 */
var souhlasBox = null;

function showSouhlasBox( cat )
{

  if ( souhlasBox!=null ) {
    hiddeSouhlasBox();
  }

  var url = 'ajax/ctyrkolka_potvrzeni.php?cat='+cat;

  souhlasBox                      = new popupBox();

  souhlasBox.closeButton          = false;
  
  souhlasBox.globalVariableName   = 'souhlasBox';
  souhlasBox.mainDivId            = 'souhlasBox';

  souhlasBox.width                = 400;
  souhlasBox.height               = 380;

  souhlasBox.paddingLeft          = souhlasBox.paddingRight  = 10;
  souhlasBox.paddingTop           = souhlasBox.paddingBottom = 10;

  souhlasBox.loadContent( url );
  souhlasBox.show();  

}


function hiddeSouhlasBox()
{
  if ( souhlasBox!=null ) {
    souhlasBox.destroyBox();
    souhlasBox    = null;
  }
}


function ucinkujici_info_click( selected_stage )
{
  var infos = getElementsByClass( 'semtexCultureFestival_ucinkujici_info', 'div' );
  
  if ( infos && infos.length )
  { 
    for ( i=0; i<infos.length; i++ )
    {
      if ( infos[i].id==selected_stage && (infos[i].style.display=='none' || infos[i].style.display=='') )
      {
        //alert(infos[i].id + ' ' + selected_stage);
        infos[i].style.visibility = 'visible';
        infos[i].style.display    = 'block';
      }
      else
      {
        infos[i].style.visibility = 'hidden';
        infos[i].style.display    = 'none';
      }
    }
  }
  
  init();
  
}

/**
 *  Vytisknuti preposlaneho obrazku - drinkmakera
 */
function drinkmakerImage_print( id )
{
   window.print();
}

function archiv_akci()
{
  var archiv_div  = document.getElementById( 'archiv_akci_id' );
  
  if ( archiv_div )
  {
    if ( archiv_div.style.display=='block' )
    {
      archiv_div.style.display      = 'none';
      archiv_div.style.visibility   = 'hidden';
    }
    else
    {
      archiv_div.style.display      = 'block';
      archiv_div.style.visibility   = 'visible';
    }
  }
}

function init()
{
  var blue_div    = document.getElementById( 'content_in_blue' )
  var content_div = document.getElementById( 'content' );
  
  if ( blue_div && content_div )
  {
    var content_div_height  = content_div.offsetHeight;
  
    blue_div.style.height = content_div_height+'px';
  }
}

/**
 *  Funkce se vola po kliku ve flashi Drinkmakera na kluka nebo holku
 *  type  = 'kluk' | 'holka'
 */
function drinkMakerFlashBigClick( type )
{
  var div_uvod      = document.getElementById( 'drinkmakerContent_uvod' );
  var div_poVyberu  = document.getElementById( 'drinkmakerContent_poVyberu' );
  
  if ( div_uvod && div_poVyberu )
  {
    div_uvod.style.visibility     = 'hidden';
    div_uvod.style.display        = 'none';
    
    div_poVyberu.style.visibility = 'visible';
    div_poVyberu.style.display    = 'block';
  }
  
}


/**
 *  Zobrazuje a schovava dalasi fotky u prehledu fotek u novinek a akci
 */
function show_other_images( a_from, id )
{
  var lines = getElementsByClass( 'fotogalerie_'+id, 'div' );
  
  /* pokud se zobrazuji dalsi obrazky tak je true */
  var zobrazeni = true;
  
  if ( lines && lines.length>0 )
  {
    var i;
    
    for ( i=0; i<lines.length; i++ )
    {
      elem  = lines[i];
      
      if ( isClass( elem, 'photo_item_line_other') )
      {
        if ( isClass(elem, 'photo_item_line_other_hidde') )
          removeClass( elem, 'photo_item_line_other_hidde' );
        else
        {
          addClass( elem, 'photo_item_line_other_hidde ');
          zobrazeni = false;
        }
      }
    }
  }
  
  if ( zobrazeni && a_from )
    a_from.innerHTML  = '&lt;&lt; schovat';
  else
    a_from.innerHTML  = 'zobrazit další &gt;&gt;';
    
  init();
}

/**
 *  Zobrazi hodnoceni formou hvezdicek
 */
function show_hodnoceni_stars( elemId, countCele, widthNeCele )
{
  var countCeleAdd  =  1*countCele +1;
  
  for ( var i=0; i<=5; i++ )
  {
    if ( i>0 && i<=countCele )
      set_full_star( elemId, i, false );
    else
    if ( i>0 && i==countCeleAdd )
    {
      set_full_star( elemId, i, widthNeCele );
    }
    else
      set_empty_star( elemId, i );
  }
}

/**
 *  Funkce zobrazi hvezdicky v hodnoceni
 */
function show_stars( elemId, znamka )
{
  for ( var i=1; i<=5; i++ )
  {
    if ( i<=znamka )
      set_full_star( elemId, i, false );
    else
      set_empty_star( elemId, i );
  }
}

/**
 *  Zvyrazni hvezdicku (pokud je width=false, tak nastavi maximalni hodnotu)
 */
function set_full_star( elemId, znamka, width )
{
  var class_in      = 'star_class_ident_'+elemId+'_znamka_'+znamka;
  var star_list     = getElementsByClass( class_in, 'span' );
  var star          = false;
  
  
  if ( star_list && star_list.length )
    star            = star_list[0];
    
  if ( star!=false )
  {
    var widthCss  = 0;
    
    if ( width===false )
      widthCss    = 15;
    else
      widthCss    = width;
      
    star.style.width  = widthCss+'px';
  }
}

/**
 *  Zrusi zvyrazneni hvezdicky
 */
function set_empty_star( elemId, znamka )
{
  var class_in      = 'star_class_ident_'+elemId+'_znamka_'+znamka;
  var star_list     = getElementsByClass( class_in, 'span' );
  var star          = false;

  if ( star_list && star_list.length )
    star            = star_list[0];

  if ( star!=false )
  {
    star.style.width  = '0px';
  }
}


function checkFrmEpohlednice( form )
{
  if ( !form )
    return false;
    
  if ( form.jmeno_odesilatele.value.length<=0 )
  {
    alert('Zadej jméno odesílatele');
    return false;
  }
  else
  if ( form.email_odesilatele.value.length<=0 )
  {
    alert('Zadej email odesílatele');
    return false;
  }
  else
  if ( !check_validEmail(form.email_odesilatele.value) )
  {
    alert('Zadej validní email odesílatele');
    return false;
  }
  else
  if ( form.jmeno_prijemce.value.length<=0 )
  {
    alert('Zadej jméno příjemce');
    return false;
  }
  else
  if ( form.email_prijemce.value.length<=0 )
  {
    alert('Zadej email příjemce');
    return false;
  }
  else
  if ( !check_validEmail(form.email_prijemce.value) )
  {
    alert('Zadej validní email příjemce');
    return false;
  }
  else
  if ( form.text_pro_prijemce.value.length<=0 )
  {
    alert('Zadej text pro příjemce');
    return false;
  }
  
  return true;
}

/**
 *  Otestuje validnost formulare pro vkladani prispevku
 */
function checkFrmPridatPrispevek( form )
{
  if ( !form )
    return false;
    
  if ( form.jmeno.value.length<=0 )
  {
    alert('Zadej jméno');
    return false;
  }
  else
  if ( form.prijmeni.value.length<=0 )
  {
    alert('Zadej příjmení');
    return false;
  }
  else
  if ( form.nick.value.length<=0 )
  {
    alert('Zadej přezdívku');
    return false;
  }
  else
  if ( form.email.value.length<=0 )
  {
    alert('Zadej email');
    return false;
  }
  else
  if ( !check_validEmail(form.email.value) )
  {
    alert('Zadej validní email');
    return false;
  }
  else
  if ( form.nazev_prispevku.value.length<=0 )
  {
    alert('Zadej název příspěvku');
    return false;
  }
  else
  if ( form.kratky_popis.value.length<=0 )
  {
    alert('Zadej krátký popis');
    return false;
  }
  else
  if ( form.dt_narozeni.value.length<=0 )
  {
    alert('Zadej datum narození');
    return false;
  }
  else
  if ( !check_validDate(form.dt_narozeni.value) )
  {
    alert('Zadej správně datum narození (\'dd.mm.yyyy\')');
    return false;
  }
  else
  if ( form.ulice.value.length<=0 )
  {
    alert('Zadej ulici');
    return false;
  }
  else
  if ( form.mesto.value.length<=0 )
  {
    alert('Zadej město');
    return false;
  }
  else
  if ( form.psc.value.length<=0 )
  {
    alert('Zadej PSČ');
    return false;
  }
  else
  if ( form.telefon.value.length<=0 )
  {
    alert('Zadej telefon');
    return false;
  }
  
  else
  if ( !form.souhlas.checked ) {
    alert("Zaškrtni Tvůj souhlas s podmínkami");
    return false;
  }

  return true;
}

/**
 *  Otestuje validnost formulare pro vkladani prispevku
 */
function checkFrmPridatPrispevek4k( form )
{
  if ( !form )
    return false;
    
  
  if ( form.nazev_prispevku.value.length<=0 )
  {
    alert('Zadej název příspěvku');
    return false;
  }
  else
  if ( form.kratky_popis.value.length<=0 )
  {
    alert('Zadej krátký popis');
    return false;
  }
  else
  if ( !form.souhlas.checked ) {
    alert("Zaškrtni Tvůj souhlas s podmínkami");
    return false;
  }

  return true;
}

function checkFrmPridatPrispevekBarman( form )
{
  if ( !form )
    return false;
    
  
  if ( form.nazev_prispevku.value.length<=0 )
  {
    alert('Zadej název příspěvku');
    return false;
  }
  else
  if ( form.recept.value.length<=0 )
  {
    alert('Zadej recept');
    return false;
  }
  else
  if ( form.prisady.value.length<=0 )
  {
    alert('Zadej přísady');
    return false;
  }
  else
  if ( !form.souhlas.checked ) {
    alert("Zaškrtni Tvůj souhlas s podmínkami");
    return false;
  }

  return true;
}
/**
 *  Otestuje validnost formulare pro vkladani nahravky
 */
function checkFrmPridatNahravku( form )
{
  if ( !form )
    return false;
    
  if ( form.jmeno.value.length<=0 )
  {
    alert('Zadej jméno');
    return false;
  }
  else
  if ( form.prijmeni.value.length<=0 )
  {
    alert('Zadej příjmení');
    return false;
  }
  else
  if ( form.email.value.length<=0 )
  {
    alert('Zadej email');
    return false;
  }
  else
  if ( !check_validEmail(form.email.value) )
  {
    alert('Zadej validní email');
    return false;
  }
  else
  if ( !form.souhlas.checked ) {
    alert("Zaškrtni Tvůj souhlas s podmínkami");
    return false;
  }
  
  return true;
}


/**
 *  Zobrazi informace o hodnoceni u vybraneho uzivatele
 */
var prehratBox = null;

function showPrehratBox( type, elemId, hash )
{

  if ( prehratBox!=null ) {
    hiddePrehratBox();
  }

  var url = 'ajax/prehrat.php?type='+type+'&elemId='+elemId+'&hash='+hash;

  prehratBox                      = new popupBox();

  prehratBox.globalVariableName   = 'prehratBox';
  prehratBox.mainDivId            = 'prehratBox';

  prehratBox.width                = 400;
  prehratBox.height               = 350;

  prehratBox.paddingLeft          = prehratBox.paddingRight  = 10;
  prehratBox.paddingTop           = prehratBox.paddingBottom = 10;

  prehratBox.loadContent( url );
  prehratBox.show();

}


function hiddePrehratBox()
{
  if ( prehratBox!=null ) {
    prehratBox.destroyBox();
    prehratBox    = null;
  }
}



/**
 *  Zobrazi informace o hodnoceni u vybraneho uzivatele
 */
var epohledniceBox = null;

function showEpohledniceBox( pohledniceId, email_odesilatele, jmeno_odesilatele )
{

  if ( epohledniceBox!=null ) {
    hiddeEpohledniceBox();
  }

  var url = 'ajax/epohlednice.php?pohledniceId='+pohledniceId;

  if ( email_odesilatele.length>0 )
    url += '&email_odesilatele='+email_odesilatele;

  if ( jmeno_odesilatele.length>0 )
    url += '&jmeno_odesilatele='+jmeno_odesilatele;

  epohledniceBox                      = new popupBox();

  epohledniceBox.globalVariableName   = 'epohledniceBox';


  epohledniceBox.mainDivId            = 'epohledniceBox';

  epohledniceBox.width                = 750;
  epohledniceBox.height               = 650;

  epohledniceBox.paddingLeft          = epohledniceBox.paddingRight  = 20;
  epohledniceBox.paddingTop           = epohledniceBox.paddingBottom = 10;

  epohledniceBox.loadContent( url );
  epohledniceBox.show();

}


function hiddeEpohledniceBox()
{
  if ( epohledniceBox!=null ) {
    epohledniceBox.destroyBox();
    epohledniceBox    = null;
  }
}





/**
 *  Zobrazi informace o hodnoceni u vybraneho uzivatele
 */
var pridatNahravkuBox = null;

function showDjSoutezPridatNahravkuBoxBox()
{

  if ( pridatNahravkuBox!=null ) {
    hiddeDjSoutezPridatNahravkuBox();
  }

  var url = 'ajax/dj_soutez_pridat_nahravku.php';

  pridatNahravkuBox                      = new popupBox();

  pridatNahravkuBox.globalVariableName   = 'pridatNahravkuBox';
  //pridatNahravkuBox.left               = tempX-200;
  //pridatNahravkuBox.top                = tempY;

  //alert(tempY);

  pridatNahravkuBox.mainDivId            = 'pridatNahravkuBox';

  pridatNahravkuBox.width                = 750;
  pridatNahravkuBox.height               = 500;

  pridatNahravkuBox.paddingLeft          = pridatNahravkuBox.paddingRight  = 20;
  pridatNahravkuBox.paddingTop           = pridatNahravkuBox.paddingBottom = 10;

  pridatNahravkuBox.loadContent( url );
  pridatNahravkuBox.show();

}


function hiddeDjSoutezPridatNahravkuBox()
{
  if ( pridatNahravkuBox!=null ) {
    pridatNahravkuBox.destroyBox();
    pridatNahravkuBox    = null;
  }
}


var pridatPrispevekBox = null;

function showLetniSoutezPridatPrispevekBoxBox( type_item )
{
  if ( pridatPrispevekBox!=null ) {
    hiddeLetniSoutezPridatPrispevekBox();
  }

  var url = 'ajax/letni_soutez_pridat_prispevek.php?type_item='+type_item;

  pridatPrispevekBox                      = new popupBox();

  pridatPrispevekBox.globalVariableName   = 'pridatPrispevekBox';
  //pridatNahravkuBox.left               = tempX-200;
  //pridatNahravkuBox.top                = tempY;

  //alert(tempY);

  pridatPrispevekBox.mainDivId            = 'pridatPrispevekBox';

  pridatPrispevekBox.width                = 850;
  pridatPrispevekBox.height               = 700;

  pridatPrispevekBox.paddingLeft          = pridatPrispevekBox.paddingRight  = 20;
  pridatPrispevekBox.paddingTop           = pridatPrispevekBox.paddingBottom = 10;

  pridatPrispevekBox.loadContent( url );
  pridatPrispevekBox.show();

}


function hiddeLetniSoutezPridatPrispevekBox()
{
  if ( pridatPrispevekBox!=null ) {
    pridatPrispevekBox.destroyBox();
    pridatPrispevekBox    = null;
  }
}



var pridatCtyrkolkaPrispevekBox = null;

function showSoutezOCtyrkolkuPridatPrispevekBoxBox( type_item )
{
  if ( pridatCtyrkolkaPrispevekBox!=null ) {
    hiddeSoutezOCtyrkolkuPridatPrispevekBox();
  }

  var url = 'ajax/soutez_o_ctyrkolku_pridat_prispevek.php?type_item='+type_item;

  pridatCtyrkolkaPrispevekBox                      = new popupBox();

  pridatCtyrkolkaPrispevekBox.globalVariableName   = 'pridatCtyrkolkaPrispevekBox';
  //pridatNahravkuBox.left               = tempX-200;
  //pridatNahravkuBox.top                = tempY;

  //alert(tempY);

  pridatCtyrkolkaPrispevekBox.mainDivId            = 'pridatPrispevekBox';

  pridatCtyrkolkaPrispevekBox.width                = 850;
  pridatCtyrkolkaPrispevekBox.height               = 550;

  pridatCtyrkolkaPrispevekBox.paddingLeft          = pridatCtyrkolkaPrispevekBox.paddingRight  = 20;
  pridatCtyrkolkaPrispevekBox.paddingTop           = pridatCtyrkolkaPrispevekBox.paddingBottom = 10;

  pridatCtyrkolkaPrispevekBox.loadContent( url );
  pridatCtyrkolkaPrispevekBox.show();

}

var pridatBarmanPrispevekBox = null;

function showSoutezBarmanPridatPrispevekBoxBox( type_item )
{
  if ( pridatBarmanPrispevekBox!=null ) {
    hiddeSoutezBarmanPridatPrispevekBox();
  }

  var url = 'ajax/soutez_barman_pridat_prispevek.php?type_item='+type_item;

  pridatBarmanPrispevekBox                      = new popupBox();

  pridatBarmanPrispevekBox.globalVariableName   = 'pridatBarmanPrispevekBox';
  //pridatNahravkuBox.left               = tempX-200;
  //pridatNahravkuBox.top                = tempY;

  //alert(tempY);

  pridatBarmanPrispevekBox.mainDivId            = 'pridatPrispevekBox';

  pridatBarmanPrispevekBox.width                = 850;
  pridatBarmanPrispevekBox.height               = 550;

  pridatBarmanPrispevekBox.paddingLeft          = pridatBarmanPrispevekBox.paddingRight  = 20;
  pridatBarmanPrispevekBox.paddingTop           = pridatBarmanPrispevekBox.paddingBottom = 10;

  pridatBarmanPrispevekBox.loadContent( url );
  pridatBarmanPrispevekBox.show();

}

function hiddeSoutezBarmanPridatPrispevekBox()
{
  if ( pridatBarmanPrispevekBox!=null ) {
    pridatBarmanPrispevekBox.destroyBox();
    pridatBarmanPrispevekBox    = null;
  }
}

function hiddeSoutezOCtyrkolkuPridatPrispevekBox()
{
  if ( pridatCtyrkolkaPrispevekBox!=null ) {
    pridatCtyrkolkaPrispevekBox.destroyBox();
    pridatCtyrkolkaPrispevekBox    = null;
  }
}


var timerID = null;
var timerRunning = false;

function showtime()
{
	today = new Date();
	var festivalDay  = document.getElementById("top_panel_odpocet_dnu");
	var festivalDate = document.getElementById("top_panel_odpocet_hodin");
   
  if ( !festivalDay || !festivalDate )
    return;
    
	var cas = festivalDate.innerHTML.split(":");
	var indexD = parseInt(festivalDay.innerHTML.indexOf("D"));
	var den =  parseInt(festivalDay.innerHTML.substring(0,(indexD)));
	//BigDay = new Date("december 24, 2007")
	//alert(cas[0]+"  "+cas[1]+"  "+cas[2]);
	msPerDay = 24 * 60 * 60 * 1000 ;
	BigDayTime = today.getTime() + (den*msPerDay) + (parseInt(cas[0]) * 60 * 60 * 1000) + (parseInt(cas[1]) * 60 * 1000) + (parseInt(cas[2]) * 1000)-1;
	//alert(today.getTime());
	timeLeft = (BigDayTime - today.getTime());
	if(timeLeft > 0) {
		//alert(BigDayTime);
		e_daysLeft = timeLeft / msPerDay;
		daysLeft = Math.floor(e_daysLeft);
		e_daysLeft = timeLeft / msPerDay;
		daysLeft = Math.floor(e_daysLeft);
		e_hrsLeft = (e_daysLeft - daysLeft)*24;
		hrsLeft = Math.floor(e_hrsLeft);
		minsLeft = Math.floor((e_hrsLeft - hrsLeft)*60);
		hrsLeft = hrsLeft;
		e_minsLeft = (e_hrsLeft - hrsLeft)*60;
		secLeft = Math.floor(e_hrsLeft);
		secLeft = Math.floor((e_minsLeft - minsLeft)*60);
		secLeft = secLeft;
		//Temp3='Do 24. prosince 2007 zbývá '+daysLeft+' dní, '+hrsLeft+' hodin, '+minsLeft+' minut, '+secLeft+' sekund.'
		festivalDay.innerHTML = daysLeft+"D";
		if(hrsLeft < 10) {
			hrsLeft = "0"+hrsLeft;
		}
		if(minsLeft < 10) {
			minsLeft = "0"+minsLeft;
		}
		if(secLeft < 10) {
			secLeft = "0"+secLeft;
		}
		festivalDate.innerHTML = hrsLeft+":"+minsLeft+":"+secLeft;
		timerID = setTimeout("showtime()",1000);
		timerRunning = true;
	} else {
		festivalDay.innerHTML = "  ";
		festivalDate.innerHTML = "Akce začala"
		stopClock();
	}
	
}

function stopClock()
{
	if(timerRunning)
	 clearTimeout(timerID);
	 
	timerRunning = false;
	return;
}

function startClock() {
	stopClock();
	showtime();
}

var bannerTimerID = null;
var bannerTimerRunning = false;
 var bannery = {
//       0 : {"type": "flash", "src" : "flash/superpower.swf", "width" : 546, "height" : 305, "link" : "http://www.semtexculture.cz/novinky/rok_2010/mesic_kveten/super-novinka---semtex-super-power-75-ml-62.html"},
      0 : {"type": "image", "src" : "images/semtex_soutez_C3.jpg", "alt" : "Soutěž super power", "link" : "http://www.semtexculture.cz/anketa.html"},
	  1 : {"type": "image", "src" : "images/546x305_vizual_Trnkobrani.jpg", "alt" : "Vizovické trnkobraní", "link" : "http://www.vizovicketrnkobrani.cz/", "target" : 'target="_blank"'},
      2 : {"type": "image", "src" : "images/semtex_soutez_C3.jpg", "alt" : "Soutěž super power", "link" : "http://www.semtexculture.cz/anketa.html"},
	  3 : {"type": "image", "src" : "images/street_dance.jpg", "alt" : "Street Dance", "link" : "http://www.streetdance3d.cz/", "target" : 'target="_blank"'},
	  4 : {"type": "image", "src" : "images/semtex_soutez_C3.jpg", "alt" : "Soutěž super power", "link" : "http://www.semtexculture.cz/anketa.html"},
	  5 : {"type": "image", "src" : "images/hiphopkemp.jpg", "alt" : "Hip Hop Kemp 2010", "link" : "http://www.hiphopkemp.cz/", "target" : 'target="_blank"'}
   	};

var pocetObrazku = 6;
var aktualniBanner = 0;

function rotateBanner(cas) {
	stopRotateBanners();
	startRotateBanners(cas);
}

function stopRotateBanners() {
	if(bannerTimerRunning)
	clearTimeout(bannerTimerID);
	bannerTimerRunning = false;
	return true;
}

function startRotateBanners(cas) {
	var hp_action_banner = document.getElementById("hp_action_banner");
	
	if ( !hp_action_banner )
    	return;
  
    if ( bannery[aktualniBanner]['type']=='image' )
    {
		hp_action_banner.innerHTML = '<a href="'+bannery[aktualniBanner]['link']+'" '+bannery[aktualniBanner]['target']+'><img src="'+bannery[aktualniBanner]['src']+'" alt="'+bannery[aktualniBanner]['alt']+'" id="hp_action_banner_img" border="0" /></a>';
		hidde_flash_hp_banner();
	}
	else
	if ( bannery[aktualniBanner]['type']=='flash' )
	{
	    show_flash_hp_banner(bannery[aktualniBanner]['src'], bannery[aktualniBanner]['width'], bannery[aktualniBanner]['height'], bannery[aktualniBanner]['link']);
	}

    var cas_new = 1000 * cas;

	if ( bannery[aktualniBanner]['type']=='flash' )
	{
	    //cas_new = 1000 * (cas+7);
	    cas_new = cas_new + 6000;
	}
	
	if(aktualniBanner < (pocetObrazku-1)) {
		aktualniBanner = aktualniBanner + 1;
	} else {
		aktualniBanner = 0;
	}

	timerID = setTimeout("startRotateBanners("+cas+")",cas_new);
	bannerTimerRunning = true;
}

function showLoadingMap(){  
    document.getElementById("map").innerHTML = "";
    document.getElementById("map").style.display = "block";
    document.getElementById("map").style.background= document.body.style.backgroundColor; //'#191919'
    document.getElementById("map").innerHTML = "<img src='http://www.semtexculture.cz/images/LOADING.jpg' style='position: relative; top: 50%; left: 50%' alt=''>";
}



function ctyrkolkaSoutezRegistruj()
{
  if (confirm('Nejdřív se přihlaš, nebo zaregistruj, a pak vlož příspěvek.'))
  {
    self.location.href = "http://www.semtexculture.cz/registrace.html";
//    alert("ook");
  }
   return false;
    
}

function nextStep()
{
	var box_hide = document.getElementById('krok1');
	var box_show = document.getElementById('krok2');
	removeClass(box_hide, 'show');
	removeClass(box_show, 'hide');

	addClass(box_show, 'show');
	addClass(box_hide, 'hide');

	return false;
}

function selectOdp(element)
{

	var radio_lines = getElementsByClass('odpoved','div');

	for (i=0;i<radio_lines.length;i++){
 	  removeClass(radio_lines[i],'selected');
 	  var butt = radio_lines[i].getElementsByTagName('input');
 	  butt[0].checked = false;
	}

	var button = element.getElementsByTagName('input');

	element.className = 'odpoved selected';
	button[0].checked = true;

}
