var index = 0;
var xmlhttp = new Array();

function change_titlePhoto(){
	if(window.XMLHttpRequest){
     	xmlhttp.push(new XMLHttpRequest());
	}
	else if(window.ActiveXObject){
	     xmlhttp.push(new ActiveXObject("Microsoft.XMLHTTP"));
	}
	index = xmlhttp.length - 1;
     if(xmlhttp[index]){
     	var obj = document.getElementById("titlePhoto");
          xmlhttp[index].open("GET", "inc/title_photos.php", true);
          xmlhttp[index].onreadystatechange = function() {
               if(xmlhttp[index].readyState == 4 && xmlhttp[index].status == 200){
                    obj.innerHTML = xmlhttp[index].responseText;
               }
          }
          xmlhttp[index].send(null);
     }
}

function VerifyForumForm(forumForm) {
	var why = "";

	if(forumForm.nick.value == ""){
		why += "Před odesláním zadejte své jméno!\n";
	}
	if(forumForm.zprava.value == ""){
		why += "Před odesláním zadejte text vzkazu!\n";
	}
	if(forumForm.code.value == ""){
		why += "Před odesláním zadejte potvrzovací kód!\n";
	}
	if (forumForm.email.value != ""){
		why += checkEmail(forumForm.email.value);
	}

	if (why != ""){
	    alert(why);
	return false;
	}

	return true;
}

function checkEmail (strng) {
	var error = "";

	var emailFilter=/^.+@.+\..{2,3}$/;
	  if (!(emailFilter.test(strng))) {
	  error += "E-mailová adresa nemá platný formát.\n";
	}

	var illegalChars= /[\(\)\<\>\,\;\:\\\\[\]]/
	if (strng.match(illegalChars)) {
		error += "Zadaná e-mailová adresa obsahuje nepovolené znaky.\n";
	}
	return error;
}

function writeEmbedFlash(file, width, height)
{
  document.write('<embed src="'+file+'" width="'+width+'" height="'+height+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent"></embed>');
}

function fullbanner_off()
{
	document.getElementById('fullBanner').style.visibility="hidden";
	document.getElementById('fullBannerData').style.visibility="hidden";
}