﻿// JScript-Datei
function PopUp(ziel){
	window.open(ziel, "Info", "width=550, height=660, left=0, top=0, scrollbars=yes, resizable=no");
}

function Fenster(id){
    var Fenstr = window.open("http://xpsitemanager.by-experience.com/Default.aspx?" + id, "Privacy", "width=800, height=770, left=300, top=100, scrollbars=yes, resizable=yes");
    Fenstr.focus();
}

function Statistik(url, query){
  var Fenstr = window.open("http://xpsitemanager.by-experience.com/statistik.aspx", "Statistik", "width=800, height=770, left=300, top=100, scrollbars=yes, resizable=yes");
  Fenstr.focus();
}
 
function GallerieDD(selObj)
{
  if (selObj.options[selObj.selectedIndex].value != 00){
  var Fenstr = window.open("../pages/gallerie.aspx?gallerieID=" + selObj.options[selObj.selectedIndex].value, "Gallerie", "width=730, height=700, left=0, top=0, scrollbars=no, resizable=no");
  Fenstr.focus();
}
  if (restore) selObj.selectedIndex=0;
}

function Gallerie(gallerieID)
{
  var Fenstr = window.open("../pages/gallerie.aspx?gallerieID=" + gallerieID, "Gallerie", "width=730, height=700, left=0, top=0, scrollbars=no, resizable=no");
  Fenstr.focus();
  //if (restore) selObj.selectedIndex=0;
}

function popGallerie(gallerieID, fName, i, kategorieID, spracheID){
    var gallerie = window.open("../pages/album.aspx?gallerieID=" + gallerieID + "&fName=" + fName + "&startPos=" + i + "&kategorieID=" + kategorieID + "&spracheID=" + spracheID, "Gallerie", "width=540, height=700, left=300, top=50, scrollbars=no, resizable=no");
    gallerie.focus();
}

function zeige(ziel){
  verstecke()
  
  if (document.all)
  {
	   document.all[ziel].style.visibility = 'visible';
  }
  else if (document.layers)
  {
	   document.layers[ziel].visibility = 'show';
  }
  else if (document.getElementById)
  {
	   document.getElementById(ziel).style.visibility = 'visible';
  } 
}

function verstecke(ziel){

  for (var i = 0; i < 4; i++){
    if (document.all)
    {
	     document.all[ziel + i].style.visibility = 'hidden';
	     document.all[ziel + i].style.height = '0px';
    }
    else if (document.layers)
    {
	     document.layers[ziel + i].visibility = 'hide';
	     document.layers[ziel + i].style.height = '0px';
    }
    else if (document.getElementById)
    {
	     document.getElementById(ziel + i).style.visibility = 'hidden';
	     document.getElementById(ziel + i).style.height = '0px';
    }
  }
}
  
function zoomy(bild){
  window.open("../pages/zoom.aspx?bild=" + bild, "Zoomy", "width=10, height=10, left=60, top=60, scrollbars=no, resizable=yes");
}

function zoomUpload(bild){
  window.open("../pages/zoom.aspx?bild2=" + bild, "Zoomy", "width=10, height=10, left=60, top=60, scrollbars=no, resizable=yes");
}

function report(reportID, spracheID){
  window.open("../pages/popUp.aspx?reportID=" + reportID + "&lng=" + spracheID, "Report", "width=450, height=450, left=100, top=100, scrollbars=no, resizable=no");
}

function report2(reportID, spracheID){
  window.open("../pages/popUp.aspx?reportID=" + reportID + "&lng=" + spracheID, "Report", "width=650, height=450, left=100, top=100, scrollbars=no, resizable=no");
}

var i = 0;

$(function() {
	// run the code in the markup!		
	$('#s1').cycle({ 
		fx:      'fade', 
		speed:   300, 
		timeout: 0, 
		next:		 '#next1', 
		prev:    '#prev1' 
	});
	
	$('#prev1').click(function(){
		if (i < 2){
			i = maxBilder;
		}
		else{
			i--;
		}
    
    if(spracheID==2){
		  $('#bilderNr').html((i) + " da " + maxBilder);
    }
    else{
		  $('#bilderNr').html((i) + " von " + maxBilder);    
    }
    
		$('#zoom1').html("<a href='javascript:popGallerie(" + bildergallerieID + ",undefined," + (i - 1) + "," + galKat +  "," + spracheID + ");'><img src='../images/pfeil_plus.gif' alt='vergrößern' /></a>");
	});
	
	$('#next1').click(function(){
		if (i > maxBilder-1){
			i = 0;
			i = i+1;	
		}
		else{
			if (i < 1){
				i = i+1;
			}
			i++;
		}
		
		if(spracheID==2){
		  $('#bilderNr').html((i) + " da " + maxBilder);
    }
    else{
		  $('#bilderNr').html((i) + " von " + maxBilder);    
    }
    
    $('#zoom1').html("<a href='javascript:popGallerie(" + bildergallerieID + ",undefined," + (i - 1) + "," + galKat +  "," + spracheID + ");'><img src='../images/pfeil_plus.gif' alt='vergrößern' /></a>");
	});
});

//function zoom(j, galKat, spracheID){
//	window.open("../pages/gallerie.aspx?view=" + j + "&galKat=" + galKat + "&lng=" + spracheID, "Gallerie", "width=450, height=450, left=100, top=100, scrollbars=no, resizable=no");
//}

function Schliessen(){
  window.close();
}