var rssboxscrolldir  = 't'; //b - bottom   t - top  or empty
var rssboxscrollauto = 'y';



function activateHomeWide(active_id)
{
 if (homerightactive!=active_id)
   {
    $('#rightwide'+homerightactive).removeClass('widerightbgact').addClass('widerightbg');
    $('#rightwide'+active_id).removeClass('widerightbg').addClass('widerightbgact');
    
    $('#rightwidetable'+homerightactive).css('display', 'none');
    $('#rightwidetable'+active_id).css('display', 'block');
    
    homerightactive = active_id;
   }
}


function gotourl(url)
{
 document.location.href = url;
}




function init ( )
{
  timeDisplay = document.createTextNode ( "" );
  document.getElementById("clock").appendChild ( timeDisplay );
}

function updateClock ( )
{
  var currentTime = new Date ( );

  var currentHours = currentTime.getHours ( );
  var currentMinutes = currentTime.getMinutes ( );
  var currentSeconds = currentTime.getSeconds ( );

  currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
  currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;

  var currentTimeString = currentHours + ":" + currentMinutes + ":" + currentSeconds;// + " " + timeOfDay;

  document.getElementById("clock").firstChild.nodeValue = currentTimeString;
}





function checkRSSBoxNavi()
{
 var mt = parseInt($('#rssnews').css('margin-top'));
 
 
 
 
 if (rssboxscrolldir=='qt') mt=mt+10;
 
 if (rssboxscrollauto=='y') step = 1;
 else                       step = 3;
 
 if (rssboxscrolldir=='t') mt=mt-step;
 if (rssboxscrolldir=='b') mt=mt+step;
 
 var fr = $('#rssnewsbox').height() - $('#rssnews').height();
 
 if (mt>0)
   {
    mt = 0;
    
    if (rssboxscrollauto=='y') rssboxscrolldir = 't';
   }
 
 if (mt<fr)
   {
    mt = fr;
    if (rssboxscrollauto=='y') rssboxscrolldir = 'qt';
   }
 
 
 if (mt<=0 && mt>fr)
   if (rssboxscrolldir=='qt' || rssboxscrolldir=='t' || rssboxscrolldir=='b') $('#rssnews').css({'margin-top' : mt})
 
}










var d = document;




function getElement(i)
{ 
 var ob = d.all?d.all[i]:d.layers?d.layers[i]:d.getElementById(i); 
 return ob; 
} 










var timer = null;

var scroll_timer_call   = 80;
var scroll_xpos_now    = 0;
var scroll_xpos_target = 0;
var scroll_step_by     = 1212;

var scroll_dir             = '';
var scroll_pics_timer_call = 80;
var scroll_pics_step       = 4;
var scroll_pics_limit      = 0;





function magArtPicShow(newdiv)
{
 if (last_active_picdiv!='') getElement(last_active_picdiv).style.display = 'none';
 
 getElement(newdiv).style.display = 'block';
 
 last_active_picdiv = newdiv;
}



function scrollPics()
{
 pre_xpos_now = scroll_xpos_now;
 
 if (scroll_dir=='right')
   {
    scroll_xpos_now = scroll_xpos_now - scroll_pics_step;
    
    if (scroll_xpos_now<scroll_pics_limit) scroll_xpos_now = scroll_pics_limit;
   }
 
 if (scroll_dir=='left')
   {
    scroll_xpos_now = scroll_xpos_now + scroll_pics_step;
    
    if (scroll_xpos_now>0) scroll_xpos_now = 0;
   }
 
 
 if (pre_xpos_now != scroll_xpos_now) $('#magpicslist').css('margin-left', scroll_xpos_now+'px');
 //getElement('magpicslist').style.left = scroll_xpos_now;
 
 
 clearTimeout(timer);
 timer = setTimeout("scrollPics()", scroll_pics_timer_call);
}






function scrollPicsRun(dir)
{
 scroll_dir = dir;
}







function scrollPicsStop()
{
 scroll_dir = '';
}





function doNTH()
{
}




function searchCheckGo()
{
 var np = $.trim($('#f_phrase').val());
 
 if (np.length<3)
   {
    $('#f_phrase').css({'border' : '1px solid red'});
    alert('Bitte tragen Sie mindestens 3 Buchstaben Ihres Suchbegriffes ein');
   }
 else
   {
    $('#g').val('suche');
    $('#searchform').attr('action', '?').submit();
   }
}











