<!--

browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);


// swap_div

function tabButtonClicked(t, b) {
  var lis=document.body.getElementsByTagName('li');
  for (var i=0; i<lis.length; i++) {
    if (lis[i].id==t+'_'+b+'_button') {
			lis[i].className='ac';
    } else if (lis[i].id.match('^'+t+'_.*_button$')) {
			lis[i].className='ia';        
    }
  }
  var divs=document.body.getElementsByTagName('div');
  for (var i=0; i<divs.length; i++) {
    if (divs[i].id==t+'_'+b+'_content') {
			divs[i].style.display='block';
    } else if (divs[i].id.match('^'+t+'_.*_content$')) {
			divs[i].style.display='none';
    }
  }
  if (typeof createCookie == 'function')	createCookie('top_box_select_'+ t, b, 365);
}
// swap_div - END


// HELP

var help = false

function changeHelp(pa_s) {
	if (help) {
		help.style.visibility   = 'visible';
		help.innerHTML          = pa_s;
	}
}

function hideHelp() {
	if (help) help.style.visibility='hidden';
}

function getMouseMove(e) {
    if (document.all) e = event;
	if (help)
		if (help.style.visibility == 'visible') {
			doc_pos = getScrollXY();
			help.style.left = doc_pos[0] + e.clientX + 5 + 'px';
			help.style.top  = doc_pos[1] + e.clientY + 20 + 'px';
		}
}

function helpInit() {
	help = document.getElementById('helpbox');
}

document.onmousemove=getMouseMove;
var help=false;

function main_onload() {
	helpInit();
}



function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}

// HELP - END



function loadimg(src,par)
{
	src='/zobrazfoto.asp?src=' + src + '&par=' + par;
	window.open(src,'', 'resizable=yes,scrollbars=yes,width=600,height=550');
}

function hlfrm_submit()
{
	var now, typ;
	now = new Date;
	typ = 2;
	if (document.forms['hlfrm'].hl_kde[1].checked) 
	{
		if (typ==1)
		{
			location.href='http://www.zoohoo.sk?q='+document.forms['hlfrm'].hltext2.value +'&ref=70'; return false; 
		} else {
			location.href='http://www.atlas.sk/search.php?id=sme&phrase='+document.forms['hlfrm'].hltext2.value +'&what=f'; return false; 
		}
	} else {
		return true;
	}
}


function st_openWindow(theURL, winName, features) { 
  window.open(theURL, winName, features);
}
function add_favorit()
{
	if (browserName == "Microsoft Internet Explorer" && browserVer >= 4) 
	{
	  window.external.AddFavorite("http://www.sme.sk", document.title);
	} else {
		st_openWindow('http://www.sme.sk/footer/favorit.htm','Favorit','width=500,height=300');
	}
}

function add_favorit2(w)
{
	if (browserName == "Microsoft Internet Explorer" && browserVer >= 4) 
	{
	  window.external.AddFavorite(w, document.title);
	} else {
		st_openWindow('http://www.sme.sk/footer/favorit.htm','Favorit','width=500,height=300');
	}
}

function send_err_info(pa_type, pa_id)
{
	st_openWindow('http://www.sme.sk/chyba/?id='+pa_id, 'chyba_info', 'resizable=no,scrollbars=yes,width=500,height=590');
}

function storm_detect_browser()
{
	var ret = '';
	var agt = navigator.userAgent.toLowerCase();
	var appVer = navigator.appVersion.toLowerCase();
	var iePos  = appVer.indexOf('msie'); 
	if (agt.indexOf('opera') != -1) ret = 'OPERA'; 
	if ((iePos!=-1) && (ret!='OPERA')) ret = 'IE';
	if ((agt.search('firefox') !=-1) == true) ret = 'FF'
	return ret;
}
var storm_browser = storm_detect_browser();

function addEvent(obj, evType, fn){
	if (obj.addEventListener){
		obj.addEventListener(evType, fn, false);
		return true;
	}
	else if (obj.attachEvent){
		var r = obj.attachEvent('on'+evType, fn);
		return r;
	}
		else {
		return false;
	}
}

function read_top_box_select()
{
	if ((typeof readCookie == 'function') && (typeof tabButtonClicked == 'function'))
	{
		var h;
		if (document.getElementById('tab1_1hod_button')) { h = readCookie('top_box_select_tab1'); if (h) tabButtonClicked("tab1", h); }
		if (document.getElementById('tab2_1hod_button')) { h = readCookie('top_box_select_tab2'); if (h) tabButtonClicked("tab2", h); }
		if (document.getElementById('tab3_1hod_button')) { h = readCookie('top_box_select_tab3'); if (h) tabButtonClicked("tab3", h); }
		if (document.getElementById('tab4_1hod_button')) { h = readCookie('top_box_select_tab4'); if (h) tabButtonClicked("tab4", h); }
	}
}

addEvent(window, 'load',	read_top_box_select);

function change_css(id, st)
{
	var elem;
	if(document.getElementById) {
		var elem = document.getElementById(id);
	} else if (document.all){
		var elem = document.all[id];
	}
	if (elem) elem.className = st;
}

function check_char_count(id_form, max_char, id_txt)
{
	var f = document.getElementById(id_form);
	if (id_txt) var t = document.getElementById(id_txt);
	if (f) {
		var p = f.value.length;
		if (p>max_char) f.value = f.value.substring(0, max_char);
		if (t) {
			t.innerHTML = ((max_char - p)<0) ? 0 : (max_char - p);
		}
	}
}

function write_mstr(s1, s2) {
	var dmz=new Array('-','*','@','#'); 
	document.write(s1 + dmz[2] + s2);
}

function bookmark_site(title, url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}


//-->
-->
