// set action and post form
function doGeneralAction(action) {
	var elForm = document.forms[0];
	elForm.action.value = action.toUpperCase();
	elForm.submit();
}
function doMatnrAction(action,addmatnr) {
	var elForm = document.forms[0];
	elForm.addmatnr.value = addmatnr;
	doGeneralAction(action);
}

// open popup for article info
function articleInfo(href) {
	if (navigator.appName=='Netscape')
	   var opener = window.open(href,'ArticleInfo',"width=700,height=450,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
	else
	   var opener = window.open(href,'ArticleInfo',"width=700,height=450,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
}

// open popup info
function popupPicture(href) {
	if (navigator.appName=='Netscape')
	   var opener = window.open(href,'bigpicture',"width=700,height=660,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no");
	else
	   var opener = window.open(href,'bigpicture',"width=700,height=660,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no");
}

//open popup for cv-code Info
function popupcvcodeinfo(){
	   var opener = window.open('cvcodeinfo.htm','cvcodeinfo',"width=400,height=300,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no");
}


// open popup for download
function popupDownload(href) {
	if (navigator.appName=='Netscape')
	   var opener = window.open(href,'Download',"width=760,height=560,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
	else
	   var opener = window.open(href,'Download',"width=760,height=560,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
}

// redirect opener to myjuwel for login
function redirectToLogin(msg) {
	alert(msg);
	opener.location = 'myjuwel.htm';
	window.close();
}

// try to reload opener in article info
function reloadOpener() {
	var win = opener;
	if (win.document.forms) {
		var forms = win.document.forms;		
		var lastForm = forms.length - 1;
		// submit last form (form after action subforms)
		forms[lastForm].submit();	
	} else {
		win.location.reload();	
	}
}

// TEST FÜR JUWEL-ERWEITERUNGEN; JZ 28.11.2006
function disableclick(e) {
var clickmessage="Copyright by Juwel Aquarium GmbH & Co. KG";
	if (document.all) {
		if (event.button==2||event.button==3) {
			if (event.srcElement.tagName=="IMG"){
				alert(clickmessage);
				return false;
			}
		}
	}else if (document.layers) {
		if (e.which == 3) {
			alert(clickmessage);
			return false;
		}
	}else if (document.getElementById){
		
		if (e.which==3&&e.target.tagName=="IMG"){
			document.oncontextmenu=new Function("alert('Copyright by Juwel Aquarium GmbH & Co. KG');return false;");
		}else{
			document.oncontextmenu=new Function("return true");
		}
	}
}

function associateimages(){
	for(i=0;i<document.images.length;i++)
	document.images[i].onmousedown=disableclick;
}

//NUR FUER DIE UMFRGAESEITE
function openSurvey(){
  theURL ='http://survey.2ask.de/4280355a84aef6c7/survey.html';
  window.open(theURL,'newWindow','toolbar=no,menubar=no,resizable=no,scrollbars=no,status=no,location=no,width=700,height=600');
}

function cookieHolen () {
  var Wert = "";
  if (document.cookie) {
    var Wertstart = document.cookie.indexOf("=") + 1;
    var Wertende = document.cookie.indexOf(";");
    if (Wertende == -1)
      Wertende = document.cookie.length;
    Wert = document.cookie.substring(0, Wertende);
  }
  if(Wert != "visit")
  	openSurvey();
  return Wert;
}

function cookieSetzen () {
  var Verfallszeit = 1000 * 60 * 60 * 24 * 2;
  var jetzt = new Date();
  var Auszeit = new Date(jetzt.getTime() + Verfallszeit);
  document.cookie = "visit; expires=" + Auszeit.toGMTString() + ";";
}



//ENDE UMFRAGESEITE
if (document.all)
	document.onmousedown=disableclick
else if (document.getElementById)
	document.onmouseup=disableclick
else if (document.layers)
	associateimages()


