// ------------------------------------------------------------------------------------------------ //
// Reiter in der rechten Spalte
// Elemente aufgeteilt in 
//  - "img"   =  Link-Image
//  - "mappe" = Content
function zeigeMappe(id,n,ivwressort) 
{
	var z = 1;
	// Vorhandene Reiter suchen	
	while ( document.getElementById( n + z + 'mappe' ) ) {
		// Mappen ausblenden
		document.getElementById( n + z + 'mappe' ).style.display = "none";
		// Rahmen unten anpassen
		 document.getElementById( n + z + 'img' ).style.borderBottomColor = '#cfcfcf';
		z++;
	}
	// ausgewählter Reiter anzeigen
	document.getElementById( id + 'mappe' ).style.display = 'block';
	// Rahmen unten an Hintergrundfargbe anpassen
	document.getElementById( id + 'img' ).style.borderBottomColor = '#e8e8e8';
	//ivwtag(ivwressort);
}
// Höchste Mappe ermitteln und gesamthöhe Höhe dieser anpassen
function MappeHoehe(n) 
{
/*
	var MappenBoxHoehe = ''; var z = 1;
	// Vorhandene Reiter suchen	
	while (document.getElementById( n + z + 'mappe' )) {
		// Höhe auslesen
		var MappenHoehe = document.getElementById( n + z + 'mappe' ).offsetHeight;
		// Höhe vergleichen und ggf. ersetzen
		if ( MappenHoehe > MappenBoxHoehe ) { MappenBoxHoehe = MappenHoehe;	}
		z++;
	}
	// Höhe der Reiter-Mappen definieren
    document.getElementById( n + 'Mappen' ).style.height = MappenBoxHoehe + 'px';
*/
    document.getElementById( n + 'Mappen' ).style.height = '150px';
}
// ------------------------------------------------------------------------------------------------ //
// Blätter-Box aufrufen
function stepStart(id, step, ivwressort) {
	var artikel = document.getElementsByName(id);
	var length = artikel.length;
	var ivw = ivwressort;
	// alle Artikel unsichtbar schalten
	for (var i = 0; i < length; i++) { try { artikel[i].style.display = 'none'; } catch(e) { break; } }
	// die ersten Artikel schalten
	for (var i = 0; i < step; i++) { try { artikel[i].style.display = 'block'; } catch(e) { break; } }
	// Pager-Funktion aufrufen
	for ( i=0; i < length; i++)	{ if ( artikel[i].style.display == 'block' ) { 
	stepPager(id, 1, artikel.length, step, ivw); break; } }
}
// Pager-Funktion
function stepPager(id, i, length, step, ivwressort) {
	if(document.getElementById('Pager_'+id)) {
		var sites = (Math.ceil(length / step));
		var site = Math.ceil(i / step);
		if (sites > 1) {
			var btnPrevImg = '<img src="'+ImagePath+'pager_arrow_prev.png" border="0" />';
			var btnNextImg = '<img src="'+ImagePath+'pager_arrow_next.png" border="0" />';
			var btnPrev = '<a href="javascript:void(0);" onclick="step(\''+id+'\', \'prev\','+step+', \''+ivwressort+'\')">'+btnPrevImg+'</a>';
			var btnNext = '<a href="javascript:void(0);" onclick="step(\''+id+'\', \'next\','+step+', \''+ivwressort+'\')">'+btnNextImg+'</a>';
			document.getElementById('Pager_'+id).innerHTML = site + ' von ' + sites + ' ' + btnPrev + ' ' + btnNext;
		}
	}
}
// ------------------------------------------------------------------------------------------------ //
// Diashow Aufmacher
var ThumbsClickMe = new Array;
var hoscount = 0;

// Array füllen
function pushThumbClickMe(thumb, datum, titel, location, trid, target, hoscount)
{
  ThumbsClickMe[hoscount] = new Object(); 
  ThumbsClickMe[hoscount]["thumb"] = thumb; 
  ThumbsClickMe[hoscount]["title"] = titel; 
  ThumbsClickMe[hoscount]["date"] = datum; 
  ThumbsClickMe[hoscount]["location"] = location; 
  ThumbsClickMe[hoscount]["trid"] = trid;
  ThumbsClickMe[hoscount]["target"] = target;
}
// Übersicht
function setGalClickMe()
{
  document.write('<div id="ClickMeAufmacherBottom">');    
  for (var i = 0; i < ThumbsClickMe.length; i++)
  {
    for (var Eigenschaft in ThumbsClickMe[i])
    {
      if(Eigenschaft == 'thumb')
      {
        var test='';
        test+='<a href="#" onclick="dk=window.open(\'/_/tools/diaview.html?_CMTREE=';
        test+=ThumbsClickMe[i]["trid"];
        test+='&list=1\',\'diashow\',\'width=300,height=300,resizable=no\');dk.focus();return(false)">';
        test+='<img ';
        test+='onmouseover="showGalClickMe(\'';
        test+= i ;
        test+='\',\'';
        test+=ThumbsClickMe[i]["target"];
        test+='\')" ';
        test+=ThumbsClickMe[i][Eigenschaft];
        test+=' class="MiniThumb" border="0" align="left" />';
        test+='</a>';
        document.write('&nbsp;');
        document.write(test);
      } 
    }
  }
  document.write('</div>');
  document.write('&nbsp;');
}

// Ausgabe
function showGalClickMe(id,target)
{
  // alert('id='+id+',target='+target);
  var img = ThumbsClickMe[id]["thumb"]; 
  var datum = ThumbsClickMe[id]["date"]; 
  var titel = ThumbsClickMe[id]["title"]; 
  var location = ThumbsClickMe[id]["location"];
  // alert('img='+img+' # datum='+datum+' # titel='+titel+' # location='+location);        
  var e  = document.getElementById(target);
  e.onclick = function()
              {
                window.open('/_/tools/diaview.html?_CMTREE=' + ThumbsClickMe[id]["trid"] + '&list=1','diashow','width=300,height=300,resizable=no');
              }
              document.getElementById(target).innerHTML = "<img " + img + " class=\"BigThumb\" />" + datum + "<br \/><b>" + titel + "<\/b><br \/>" + location;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //

var ThumbsMms = new Array;
hoscount = 0;
// Array füllen
function pushThumbMms(thumb, datum, titel, location, trid, picid, target, hoscount)
{
  ThumbsMms[hoscount] = new Object(); 
  ThumbsMms[hoscount]["thumb"] = thumb; 
  ThumbsMms[hoscount]["date"] = datum; 
  ThumbsMms[hoscount]["title"] = titel; 
  ThumbsMms[hoscount]["location"] = location; 
  ThumbsMms[hoscount]["trid"] = trid;
  ThumbsMms[hoscount]["picid"] = picid;
  ThumbsMms[hoscount]["target"] = target;
}
// Übersicht
function setGalMms()
{
  document.write('<div id="ClickMeAufmacherBottom">');	
  for (var i = 0; i < ThumbsMms.length; i++)
  {
    for (var Eigenschaft in ThumbsMms[i])
    {
      if(Eigenschaft == 'thumb')
      {

        var test='';
        test+='<a href="#" onclick="dk=window.open(\'/_/tools/diaview.html?_CMTREE=';
        test+=ThumbsMms[i]["trid"];
        test+='&_CMBILD=';
        test+=ThumbsMms[i]["picid"];
        test+='&list=1\',\'diashow\',\'width=300,height=300,resizable=yes\');dk.focus();return(false)">';
        test+='<img ';
        test+='onmouseover="showGalMms(\'';
        test+= i ;
        test+='\',\'';
        test+=ThumbsMms[i]["target"];
        test+='\')" ';
        test+=ThumbsMms[i][Eigenschaft];
        test+=' class="MiniThumb" border="0" align="left" />';
        test+='</a>';
        document.write('&nbsp;');
        document.write(test);


/*
        document.write("
        <a href=\"#\" onclick=\"dk=window.open('/_/tools/diaview.html?_CMTREE=" + 
        ThumbsMms[i]["trid"] + 
        "&_CMBILD=" + 
        ThumbsMms[i]["picid"] + 
        "&list=1','diashow','width=300,height=300,resizable=yes');dk.focus();return(false)\">
        <img onmouseover=\"showGalMms(" + i + ",'" + ThumbsMms[i]["target"] + "')\" " + ThumbsMms[i][Eigenschaft] + 
        " class=\"MiniThumb\" border=\"0\" align=\"left\" /><\/a>");
*/
      } 
	}
  }
  document.write('</div>');
  document.write('&nbsp;');
}

// Ausgabe
function showGalMms(id,target)
{
  var img = ThumbsMms[id]["thumb"];
  var datum = "";
  var titel = ThumbsMms[id]["title"];
  var location = ThumbsMms[id]["location"]
  var e  = document.getElementById(target);
  e.onclick = function()
              {
                window.open('/_/tools/diaview.html?_CMTREE=' + ThumbsMms[id]["trid"] + "&_CMBILD=" + ThumbsMms[id]["picid"] + '&list=1','diashow','width=300,height=300,resizable=no');
              }
		      document.getElementById(target).innerHTML = "<img " + ThumbsMms[id]["thumb"] + " class=\"BigThumb\" />" + datum + "<br \/><b>" + titel + "<\/b><br \/>" + location;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //
var ThumbsPromi = new Array;
hoscount = 0;
// Array füllen
function pushThumbPromi(thumb, datum, titel, location, trid, target, hoscount)
{
  ThumbsPromi[hoscount] = new Object(); 
  ThumbsPromi[hoscount]["thumb"] = thumb; 
  ThumbsPromi[hoscount]["title"] = titel; 
  ThumbsPromi[hoscount]["date"] = datum; 
  ThumbsPromi[hoscount]["location"] = location; 
  ThumbsPromi[hoscount]["trid"] = trid;
  ThumbsPromi[hoscount]["target"] = target;
}

// Übersicht
function setGalPromi()
{
  document.write('<div id="ClickMeAufmacherBottom">');	
  for (var i = 0; i < ThumbsPromi.length; i++)
  {
    for (var Eigenschaft in ThumbsPromi[i])
    {
	  if(Eigenschaft == 'thumb')
      {
        var test='';
        test+='<a href="#" onclick="dk=window.open(\'/_/tools/diaview.html?_CMTREE=';
        test+=ThumbsPromi[i]["trid"];
        test+='&list=1\',\'diashow\',\'width=300,height=300,resizable=no\');dk.focus();return(false)">';
        test+='<img ';
        test+='onmouseover="showGalPromi(\'';
        test+= i ;
        test+='\',\'';
        test+=ThumbsPromi[i]["target"];
        test+='\')" ';
        test+=ThumbsPromi[i][Eigenschaft];
        test+=' class="MiniThumb" border="0" align="left" />';
        test+='</a>';
        document.write('&nbsp;');
        document.write(test);
      } 
	}
  }
  document.write('</div>');
}

// Ausgabe
function showGalPromi(id,target)
{
  var img = ThumbsPromi[id]["thumb"]; 
  var datum = ThumbsPromi[id]["date"]; 
  var titel = ThumbsPromi[id]["title"]; 
  var location = ThumbsPromi[id]["location"];
  var e  = document.getElementById(target);
  e.onclick = function()
              {
                window.open('/_/tools/diaview.html?_CMTREE=' + ThumbsPromi[id]["trid"] + '&list=1','diashow','width=300,height=300,resizable=no');
              }
              document.getElementById(target).innerHTML = "<img " + img + " class=\"BigThumb\" />" + datum + "<br \/><b>" + titel + "<\/b><br \/>" + location;
}
// ------------------------------------------------------------------------------------------------ //  
