﻿var tLast = 'tab1';
var sLast = 'sk';
var SrTxt = new Array();
SrTxt['sk'] = 'Nájdi na internete:';
SrTxt['fr'] = 'Nájdi v obrázkoch:';
SrTxt['mp'] = 'Nájdi na mapách:';
SrTxt['rf'] = 'Nájdi v referátoch:';
SrTxt['sl'] = 'Nájdi v slovníkoch:';

function bannerzz(str){
	str = str.replace(/&LT;/g,'<');
	str = str.replace(/&GT;/g,'>');
	//alert(str);
	document.write(str);
}

function nahlad(id){
	var frm = document.getElementById(id);
	if (frm){
		frm.action='posli/nahlad.php';
	}
	return true;
}

function akceptuj(){
	var snd = document.getElementById('accept');
	if (snd){
		snd.value='OK';
	}
	return true;
}

function posli(id){
	var frm = document.getElementById(id);
	var snd = document.getElementById('odoslane');
	if (frm && snd){
		frm.action='posli/index.php';
		snd.value='OK';
	}
	return true;
}

function uprav(){
	var snd = document.getElementById('odoslane');
	if (snd){
		snd.value='';
	}
	return true;
}

function swSrch(tNow,sNow)
{
	if(sNow == sLast) return false;
	if(!sLast) sLast = 'sk'; if(!tLast) tLast = 'tab1';
	document.getElementById('li'+tNow).className = 'act';
	document.getElementById('li'+tLast).className = '';
	
	document.getElementById('searchText').innerHTML = SrTxt[sNow];
	document.getElementById('whatsearch').value = sNow;
	
	if(sNow == 'sl') { 
    document.getElementById('slsel').style.display = '';
    document.getElementById('phrase').className = 'header-input mini';
  } 
	else { 
    document.getElementById('slsel').style.display = 'none';
    document.getElementById('phrase').className = 'header-input';
    }
	sLast = sNow; tLast = tNow;
} 

function kopiruj(from,to_id){
	var text = from.value;
	var to = document.getElementById(to_id);
	to.value = from.value;
	
}

			/* pohladnica */

	var Poh_txt = new Array();
	Poh_txt['poh_text'] = 'V tejto časti sa zobrazí text Vášho pozdravu. Zadajte pozdrav, ktorý sa má zobrazovať sem, alebo do formulára.';
	Poh_txt['poh_meno'] = 'Vaše meno';
	Poh_txt['poh_nadpis'] = 'Nadpis';
	Poh_txt['poh_email'] = 'Váš e-mail';

function vypln_pohladnicu(){
	var pole = new Array();
	pole[0] = document.getElementById('poh_text');
	pole[1] = document.getElementById('poh_meno');
	pole[2] = document.getElementById('poh_nadpis');
	pole[3] = document.getElementById('poh_email');
				
	for (var i=0;i<pole.length;i++){
		if (pole[i].value == ''){
			pole[i].value = Poh_txt[pole[i].id];
		}
	}
}

function check_color(id,color){
	var frm= document.getElementById(id);
	var button = frm.elements['color'];
	//if (color != '') kolorizuj(color);
	if (button){
		for (var i=0;i<button.length;i++){
			if (button[i].value == color) button[i].checked = true;
			if (button[i].checked) kolorizuj(button[i]);
		}
	}
}

function kolorizuj(totok){
	var pole = new Array();
	pole[0] = document.getElementById('poh_text');
	pole[1] = document.getElementById('poh_meno');
	pole[2] = document.getElementById('poh_nadpis');
	pole[3] = document.getElementById('poh_email');
	
	for(var i=0;i<pole.length;i++){
		pole[i].style.color = '#'+totok.value;;
	}
}

function cisti(totok){
	if (totok.value == Poh_txt[totok.id]){
		totok.value='';

		/*totok.className="ramcek";*/
	}
}