//  Webmanufaktur Standard JS functions

function WM_OnLoad() {
	P7_initPM(1,7,1,-20,10);
	if(MM_findObj('p7scroller1')!=null) {
		P7_setScroller('p7scroller1','p7s1content1',0,0);
  }
	if(MM_findObj('p7Scroller')!=null) {
		P7_Snap('content','p7Scroller',88,292);
	}
	if(MM_findObj('pagenavigator')!=null) {
		P7_Snap('content','pagenavigator',356,368);
	}
	if(MM_findObj('undercover')!=null) {
		P7_Snap('content','undercover',17,361);
	}
}

function WM_OnResize() {
	if(MM_findObj('p7Scroller')!=null) {
		P7_Snap('content','p7Scroller',88,292);
	}
	if(MM_findObj('pagenavigator')!=null) {
		P7_Snap('content','pagenavigator',356,368);
	}
	if(MM_findObj('undercover')!=null) {
		P7_Snap('content','undercover',17,361);
	}
}

// redirect to language according to browser language

function SelLang(AllLang, DefLang) {
  if (navigator.language) lang = navigator.language;			// nav
  if (navigator.userLanguage) lang = navigator.userLanguage;	// ie
  lang = lang.substr(0,2);
  if (AllLang.indexOf(lang) != -1) window.location = "/" + lang;
  else window.location = "/" + DefLang ;
}

// display Picture in Popup Windows

function openPicture(imgName,imgWidth,imgHeight,alt) { 
	newWindow = window.open("","histPopup","width="+imgWidth+",height="+imgHeight+",scrollbars=no,menubar=no,status=no");
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onClick="self.close()" onBlur="self.close()">'); 
	newWindow.document.write('<img src="'+imgName+'" width="'+imgWidth+'" height="'+imgHeight+'" alt="'+alt+'" title="'+alt+'" />');
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}

function OpenWindow(wp, ww, wh) {
  var wy = ( (screen.width - ww) / 2 );
  var wx = ( (screen.height - wh) / 2 );
  var wa = "height="+wh+",width="+ww+",top="+wx+",left="+wy+",scrollbars=no,menubar=no,status=no,resizable";
  var ww = window.open(wp, "subwin", wa);
  return false;
}

