
function select_radio_by_value(id, v) {
    var ro=document.getElementById(id+v);
		ro.checked=true;
} 

function select_cbo_by_value(id, v) {
    var cbo=document.getElementById(''+id);
    for(var i=0; i<cbo.length; i++) {
        if(cbo.options[i].text==v) {
					cbo.selectedIndex=i;
          return;
        }
    }
} 

rotating_images = new Array();

//Duplicate these lines here to add new images to the rotation.

var active_image_delay = 3; //in seconds

var active_image_index = 0;

function rotateImages() {

  //Ensure routine runs only if my_images exists on the page.
  if (!document.getElementById('my_images') || rotating_images.length < 1) return;
  var new_image_code = '';

  new_image = document.createElement('IMG');
  new_image.src = rotating_images[active_image_index].image;
  new_image.border = "0";

  new_link = document.createElement('A');
  new_link.href = rotating_images[active_image_index].url;

  new_link.appendChild(new_image);


  if (document.getElementById('my_images').hasChildNodes() ) {
    while (document.getElementById('my_images').childNodes.length >= 1 ) {
      document.getElementById('my_images').removeChild(document.getElementById('my_images').firstChild );
    }
  }

  document.getElementById('my_images').appendChild(new_link);

  active_image_index = (active_image_index+1)%rotating_images.length;

  setTimeout('rotateImages();',active_image_delay*1000);
}
function RotatingImage (image_url, url) {
  this.image = image_url;
  this.url = url;
}

function kontrola_objednavka(obj) {
    if(obj.meno.value==""){
    	alert('Meno a Priezvisko je povinné pole - prosím, vyplniť!');
    	return false;
    }
    if(obj.telefon.value==""){
    	alert('Telefon je povinné pole - prosím, vyplniť!');
    	return false;
    }
    if(obj.email.value==""){
    	alert('E-mail je povinné pole - prosím, vyplniť!');
    	return false;
    }
    return true;
}

function kontrola_prihlaska(obj) {
    if(obj.termin_akcie.value==""){
    	alert('Termin akcie je povinné pole - prosím, vyplniť!');
    	return false;
    }
	  if(obj.meno.value==""){
    	alert('Meno a Priezvisko je povinné pole - prosím, vyplniť!');
    	return false;
    }
    if(obj.telefon.value==""){
    	alert('Telefon je povinné pole - prosím, vyplniť!');
    	return false;
    }
    if(obj.email.value==""){
    	alert('E-mail je povinné pole - prosím, vyplniť!');
    	return false;
    }
    return true;
}