/* KEYVISUAL */
var interval;
jQuery(document).ready(function(){
	//slide down login
	jQuery('.switchLogin').click(function() {
		jQuery('#intranetLogin').slideDown("slow");
		jQuery('#intranetLogin').removeClass('hidden');
		return false;
	});
	//keyvisual
	jQuery('#keyvisualSwitch li').click(function(){ 
		switchKeyvisual(this);
		return false;
	});
	//tabs
	jQuery('#containerTabs').tabs({ fxFade: true, fxSpeed: 'normal' });
});

function switchKeyvisual(e){
	var n = e.id.replace('sw','');
	jQuery('#front-keyvisual .kv .kvLi').fadeOut('slow');
	jQuery('#keyvisualSwitch li').removeClass('selected');
	jQuery('#sw'+n).addClass('selected');
	interval = setInterval("showMe("+n+")",400);
}

function showMe(n){
	jQuery('#front-keyvisual .cont'+n+'').fadeIn('slow');
	clearInterval(interval);
}

/* TABS */
/*jQuery(document).ready(function(){
	jQuery('.tabs li a').click(function(){
		switchTab(this);
		return false;		
	});
});
function switchTab(a){
	//deselect all tabs
	jQuery('.tabs li').removeClass('selected');
	//select the one
	jQuery(a).parent().addClass('selected');
	var id = a.getAttribute('href'); 
	id=id.split('#')[1];
	jQuery('.tabContent').addClass('hidden');
	jQuery('#'+id).removeClass('hidden');
}*/

// navaden popup
function popup (doc, w, h) {
  if (w == null) w = 450
  if (h == null) h = 640
  var floater = null
  window.name = "merkur"
  floater = window.open (doc, 'igrca', 'width=' + w + ',height=' + h + ',resizable=no,scrollbars=no')

  if (floater != null) {
    if (floater.opener == null) {
      floater.opener = self
    }
    floater.location.href = doc
  }
}

/*switch language*/
function switchLanguage(){
	e = document.getElementById('switch-language');
	if(e.style.display=='none')e.style.display='block';
	else e.style.display='none';
}
