
//nc relaodpage
function reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.pgW=innerWidth; document.pgH=innerHeight; onresize=reloadPage; }}
  else if (innerWidth!=document.pgW || innerHeight!=document.pgH) location.reload();
}
reloadPage(true);

//Window Name
 window.name = 'algavita2005';
 
//status zeile
var txt = "";
function szeile(anzeige)
   {
    status = anzeige;
   }
   
//____________________________ Fenster  __________________________________________________________________
//  onClick="javascript:upload(this.href, 'bild', '440', '500', 'no');  return false" 
 		var Fenster = 0;
		var Fenster;
		function upload(meineSeite,meinName,w,h,scroll) {
			LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
			TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
		
			settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
			Fenster = window.open(meineSeite,meinName,settings)
			Fenster.focus();
		}
		
// Function f�r Newsletter
var fensterNL = 0;
function newslett()
{
	if(fensterNL!=0&&fensterNL.closed!=true)
	{
		fensterNL.focus();
		fensterNL = open("#", "newsletter", "width=550,height=350,scrollbars=no,resizable=no,status=no");
		document.form_newsl.target = "newsletter";
		document.form_newsl.submit();
	}
	else
	{
		fensterNL = open("#", "newsletter", "width=550,height=350,scrollbars=no,resizable=no,status=no");
		document.form_newsl.target = "newsletter";
		document.form_newsl.submit();
	}
}
// Function f�r Newsletter
var fensterGS = 0;
function gspiel()
{
	if(fensterGS!=0&&fensterGS.closed!=true)
	{
		fensterGS.focus();
		fensterGS = open("#", "gewinnspiel", "width=550,height=350,scrollbars=no,resizable=no,status=no");
		document.formular.target = "gewinnspiel";
		document.formular.submit();
	}
	else
	{
		fensterGS = open("#", "gewinnspiel", "width=550,height=350,scrollbars=no,resizable=no,status=no");
		document.formular.target = "gewinnspiel";
		document.formular.submit();
	}
}

// Function f�r Warenkorb INSERT
var fensterWK = 0;
function wkInsert()
{
	if(fensterWK!=0&&fensterWK.closed!=true)
	{
		fensterWK.focus();
		fensterWK = open("#", "wkInsert", "width=450,height=300,scrollbars=Yes,resizable=Yes,status=no");
		document.formular.target = "wkInsert";
		document.formular.submit();
	}
	else
	{
		fensterWK = open("#", "wkInsert", "width=450,height=300,scrollbars=Yes,resizable=Yes,status=no");
		document.formular.target = "wkInsert";
		document.formular.submit();
	}
	
}

///.......******************************..............
function scroll(id, direction, speed) {
    var aussen = document.getElementById(id);
    var innen =  document.getElementById(id+"_scroll");
    var layertop = parseInt(innen.style.top) || 0;
    var scrollheight = (aussen.offsetHeight - innen.offsetHeight);
   if (direction == "down" && layertop > scrollheight) {
     innen.style.top = (layertop - speed) + "px";
   }

   else if (direction == "up" && layertop ) {
     innen.style.top = (layertop + speed) + "px";
   }
   timer = setTimeout("scroll('" + id + "','" + direction + "', " + speed + ")", 10);
 }
  
function stop() {
  if (timer) clearTimeout(timer);
}

/* * */
var scrollText = "   Zur Kasse! ";
function scrollen() {
document.scroller.button1.value = scrollText;
scrollText = scrollText.substring(1) +
scrollText.substring(0,1);
setTimeout('scrollen()',150);
}

//~~~: Suchen :~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function clearSuche()
{
 if(document.getElementById('sushop').value == 'Begriff oder Art-Nr.'){
 	document.getElementById('sushop').value = '';
 }
}
function setSuche() {
  if (document.getElementById('sushop').value == '') {
   document.getElementById('sushop').value = 'Begriff oder Art-Nr.';
  }
 }

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
var wkwin=0;
 function produktwk() {
	if(wkwin!=0&&wkwin.closed!=true) {
		wkwin.focus();
		//var left=(screen.availWidth-width)/2;
		//var top=(screen.availHeight-height)/2;
		wkwin = open("regis/wk_insert.php5", "wk", "width=450,height=300,top=250,left=250,scrollbars=Yes,resizable=yes,status=no");
		document.formular.target = "wk";
		document.formular.submit();
		//fenster.moveTo(left,top);
	}
	else {
		wkwin = open("regis/wk_insert.php5", "wk", "width=450,height=300,top=250,left=250,scrollbars=Yes,resizable=yes,status=no");
		document.formular.target = "wk";
		document.formular.submit();
	}
 }

///....... POS von WK löschen ******************************.............. 
function deleteIt(num){
	var c1="document.aktual"+num+".deleteID.value=\'1\';";
	var c2="document.aktual"+num+".submit();";
	eval(c1);
	eval(c2);
}
