﻿
/* --------------------------------------------------------------------
	jQuery - ScrollTo
-------------------------------------------------------------------- */
$('a.top').click(function(){
	$.scrollTo( 0, 2500);
	return false;
});

 
/* --------------------------------------------------------------------
	ID ein und ausblenden
-------------------------------------------------------------------- */
function changeVisibility(id) {

  var el = document.getElementById(id);

  if (el) {
	if (el.style.display == "none")
	  el.style.display = "block";
	else
	  el.style.display = "none";
  }
}


/* --------------------------------------------------------------------
	Neue Seite nach select aufrufen
-------------------------------------------------------------------- */
function select_jump(jumpto){
	document.location.href=jumpto.value;
 }
 
 
/* --------------------------------------------------------------------
	Seite per JS wechseln
-------------------------------------------------------------------- */
function goto(url){
	document.location.href=url;
 }
 
 
/* --------------------------------------------------------------------
	Neues Fenster...anstatt target "_blank" 
-------------------------------------------------------------------- */
function targetBlank (url) {
  blankWin = window.open(url,'_blank','menubar=0,toolbar=0,location=0,directories=0,fullscreen=0,titlebar=0,hotkeys=0,status=0,scrollbars=0,resizable=0');
}


/* --------------------------------------------------------------------
	Bild tauschen - changeImg('eg1','eg_thumbs[1]') oder bildobj;
-------------------------------------------------------------------- */
function changeImg(bildname,bildobj)
{
	document.images[bildname].src = eval(bildobj + ".src");
}

/* --------------------------------------------------------------------
	Bild in einem neuen Fenster öffnen
-------------------------------------------------------------------- */
function OpenNewImage(bigurl, width, height)
{
    var newWindow = window.open("", "pictureViewer", "location=no, directories=no, fullscreen=no, menubar=no, status=no, toolbar=no, width=" + width + ", height=" + height + ", scrollbars=no");
    newWindow.document.writeln("<html>");
	 newWindow.document.writeln("<base href='http://xxx.xxx.de/' />");
	newWindow.document.writeln("<style>* {margin: 0; padding: 0; border: none; text-decoration:none;}</style>");
    newWindow.document.writeln("<body>");
    newWindow.document.writeln("<a href='javascript:window.close();'");
    newWindow.document.writeln("<img src='" + bigurl + "' alt='Click to close' id='bigImage'/>");
    newWindow.document.writeln("</a>");
    newWindow.document.writeln("</body></html>");
    newWindow.document.close();
}