	
function checkChargenInput() {
	if (document.getElementById('chargenCode').value != '' && document.getElementById('produktSID').value != 0 && document.getElementById('chargenCode').value != 'CHARGENCODE') {
		
		checkseitemerkenformular();
		return true;
	}	
	else {
		alert("Bitte wählen Sie ihr Produkt und geben Sie den Chargencode von ihrer Produktpackung ein!");
		return false;	
	}
}

function checkKundenstimmenInput() {
	if (document.getElementById('kundenstimmeText').value == '') {
		alert("Bitte geben ausfüllen:\n\nIhre Meinung zum Produkt")
		return false;
	}	
	else {
		
		return true;	
	}
}

function checkChargenInputContent() {
	
	if (document.getElementById('chargenCodeContent').value != '' && document.getElementById('produktSIDContent').value != 0 && document.getElementById('chargenCodeContent').value != 'CHARGENCODE') {
		
		checkseitemerkenformular();
		return true;
	}	
	else {
		alert("Bitte wählen Sie ihr Produkt und geben Sie den Chargencode von ihrer Produktpackung ein!");
		return false;	
	}
}	

function showHinweis(produkteDropdown) {
	//alert(produkteDropdown.value);
	
	var hinweis = document.getElementById('hinweis');
	hinweis.style.display = 'block';
	
	if (produkteDropdown.value == 0) {
		hinweis.style.display = 'none';
	} else {
		var hinweisProductImage = document.getElementById('hinweisProductImage')
		
		var imageName = produkteDropdown.value;
		var imagePath = imageName.substring(imageName.lastIndexOf('|') + 1);

		if (imagePath) {
			imagePath = '/' + imagePath;
		} else {
			imagePath = '/fileadmin/img/hinweisImageNone.gif';
		}
		hinweisProductImage.src = imagePath;
	}
	
	var chargenCodeInput = document.getElementById('chargenCode');
	chargenCodeInput.focus();
}

function showHinweisContent(produkteDropdownContent) {
	//alert(produkteDropdown.value);
	var hinweisProductImage = document.getElementById('hinweisBildContent');

	if (produkteDropdownContent.value == 0) {
		hinweisProductImage.style.display = 'none';
	} else {
		hinweisProductImage.style.display = 'inline';
		
		var imageName = produkteDropdownContent.value;
		var imagePath = imageName.substring(imageName.lastIndexOf('|') + 1);
		
		if (imagePath) {
			imagePath = '/' + imagePath;
		} else {
			imagePath = '/fileadmin/img/hinweisImageNone.gif';
		}
		hinweisProductImage.src = imagePath;
	}
	
	var chargenCodeInput = document.getElementById('chargenCodeContent');
	chargenCodeInput.focus();
}

function hideHinweis() {
	var hinweis = document.getElementById('hinweis');
	hinweis.style.display = 'none';
}


function showNavLink(element){

       element.className += "hover";

}

function hideNavLink(element){

       element.className = element.className = "";

}

// elo - BEGIN
function checkseitemerkenformular(){

 var pagesize=getPageSize();
 var arrayPageScroll = getPageScroll();
 var lightboxTop = arrayPageScroll[1] + (arrayPageSize[3] / 15)
 document.getElementById('seitemerken_formular_layer').style.display='block';
 document.getElementById('seitemerken_formular_layer').style.height=pagesize[1]+'px';
 document.getElementById('seitemerken_formular_layer').style.width=pagesize[0]+'px';
 document.getElementById('seitemerken_formular_layer2').style.top=lightboxTop+'px';
 
 
 //getGemerkteVeranstaltungen();
 //getGemerkteSeiten();
 
 return true;
}	

function getPageSize(){
 
 var xScroll, yScroll;
 
 if (window.innerHeight && window.scrollMaxY) { 
  xScroll = document.body.scrollWidth;
  yScroll = window.innerHeight + window.scrollMaxY;
 } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
  xScroll = document.body.scrollWidth;
  yScroll = document.body.scrollHeight;
 } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
  xScroll = document.body.offsetWidth;
  yScroll = document.body.offsetHeight;
 }
 
 var windowWidth, windowHeight;
 if (self.innerHeight) { // all except Explorer
  windowWidth = self.innerWidth;
  windowHeight = self.innerHeight;
 } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
  windowWidth = document.documentElement.clientWidth;
  windowHeight = document.documentElement.clientHeight;
 } else if (document.body) { // other Explorers
  windowWidth = document.body.clientWidth;
  windowHeight = document.body.clientHeight;
 } 
 
 // for small pages with total height less then height of the viewport
 if(yScroll < windowHeight){
  pageHeight = windowHeight;
 } else { 
  pageHeight = yScroll;
 }

 // for small pages with total width less then width of the viewport
 if(xScroll < windowWidth){ 
  pageWidth = windowWidth;
 } else {
  pageWidth = xScroll;
 }


 arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
 return arrayPageSize;
}

function getPageScroll(){

 var yScroll;

 if (self.pageYOffset) {
  yScroll = self.pageYOffset;
 } else if (document.documentElement && document.documentElement.scrollTop){  // Explorer 6 Strict
  yScroll = document.documentElement.scrollTop;
 } else if (document.body) {// all other Explorers
  yScroll = document.body.scrollTop;
 }

 arrayPageScroll = new Array('',yScroll) 
 return arrayPageScroll;
}
	