/**
Wird in Backoffice/presse/EditList.php verwendet
Wenn eines der Attributfelder ausgew&auml;hlt wird, wird eine Preview m&ouml;glich.
**/

preloadFlag = true;
function ChangeAddress()
	{
		markbasketmodified();
		currentAddress = document.basket.SelectedShipToAddress.value;
		if (currentAddress == "one-time")
		{
			// hide info-field
			document.all["ShipToAddress_Lines"].style.display = "none";

			// hide ERP-Standardadresse-info-field
			document.all["ShipToAddress_ERPAddress"].style.display = "none";

			// show one-time-mask
			document.all["one-time-ShipToAddress_Mask1"].style.display = "block";
			document.all["one-time-ShipToAddress_Mask2"].style.display = "block";
			document.all["one-time-ShipToAddress_Mask3"].style.display = "block";
			document.all["one-time-ShipToAddress_Mask4"].style.display = "block";
			document.all["one-time-ShipToAddress_Mask5"].style.display = "block";

		}
		else if (currentAddress == "UseERPShipToAddress")
		{
			// hide one-time-mask
			document.all["one-time-ShipToAddress_Mask1"].style.display = "none";
			document.all["one-time-ShipToAddress_Mask2"].style.display = "none";
			document.all["one-time-ShipToAddress_Mask3"].style.display = "none";
			document.all["one-time-ShipToAddress_Mask4"].style.display = "none";
			document.all["one-time-ShipToAddress_Mask5"].style.display = "none";

			// hide info-field
			document.all["ShipToAddress_Lines"].style.display = "none";
			
			// show ERP-Standardadresse-info-field
			document.all["ShipToAddress_ERPAddress"].style.display = "block";

		}

		else

		{
			
			// hide one-time-mask
			document.all["one-time-ShipToAddress_Mask1"].style.display = "none";
			document.all["one-time-ShipToAddress_Mask2"].style.display = "none";
			document.all["one-time-ShipToAddress_Mask3"].style.display = "none";
			document.all["one-time-ShipToAddress_Mask4"].style.display = "none";
			document.all["one-time-ShipToAddress_Mask5"].style.display = "none";

			// show info-field
			document.all["ShipToAddress_Lines"].style.display = "block";

			// hide ERP-Standardadresse-info-field
			document.all["ShipToAddress_ERPAddress"].style.display = "none";
		
			document.all['ShipToAddress_Lines_name1'].innerHTML = shiptoaddresses[currentAddress][0];
			document.all['ShipToAddress_Lines_name2'].innerHTML = shiptoaddresses[currentAddress][1];
			document.all['ShipToAddress_Lines_street'].innerHTML = shiptoaddresses[currentAddress][2];
			document.all['ShipToAddress_Lines_pc_city'].innerHTML = shiptoaddresses[currentAddress][3] + " " + shiptoaddresses[currentAddress][4];
			document.all['ShipToAddress_Lines_country'].innerHTML = shiptoaddresses[currentAddress][5];

		}
	}
	
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}
function runSlideShow(){
if (document.all){
document.images.PictureSlideShow.style.filter="blendTrans(duration=2)";
document.images.PictureSlideShow.style.filter="blendTrans(duration=CrossFadeDuration)";
document.images.PictureSlideShow.filters.blendTrans.Apply();}
document.images.PictureSlideShow.src = preLoad[jss].src;
if (document.all) document.images.PictureSlideShow.filters.blendTrans.Play();
jss = jss + 1;
if (jss > (pss)) jss=1;
tss = setTimeout('runSlideShow()', SlideShowSpeed);
}

// Um ein Feld beim anklicken o.ä. zu lehren...
function emptyField(FormName,FieldName)
			{
				// Empty Textarea
				eval("document." + FormName + '.' + FieldName + ".value = ''");
			}

function Fensterweite()
{
 if (window.innerWidth) return window.innerWidth;
 else if (document.body && document.body.offsetWidth) return document.body.offsetWidth;
 else return 0;
}

function Fensterhoehe()
{
 if (window.innerHeight) return window.innerHeight;
 else if (document.body && document.body.offsetHeight) return document.body.offsetHeight;
 else return 0;
}


function neuAufbau()
{
 if (Weite != Fensterweite() || Hoehe != Fensterhoehe())
 //window.history.go(0);
 document.OrderForm.InputWeite.value = Fensterweite();
 document.OrderForm.InputHoehe.value = Fensterhoehe();
 document.OrderForm.submit();
}

/*Überwachung von Netscape initialisieren*/
if(!window.Weite && window.innerWidth)
  {
   window.onresize = neuAufbau;
   Weite = Fensterweite();
   Hoehe = Fensterhoehe();
  }
