function Speichern()  
	{ 
		document.execCommand('SaveAs', '', 'Kalkulation.txt');
		
    }
    
/*---------------------------------------------*/
	
	function Radiobutton(was)
	
	{
		var temp;
		
		if (was == 1)
		{
			if (document.form_neues_Projekt.PRISBN[1].checked)
			{
				
				document.form_neues_Projekt.PRBuchhandel[1].checked = true;
				document.form_neues_Projekt.PRBarsortiment[1].checked = true;
				document.form_neues_Projekt.PRMesse[1].checked = true;
			}
			
		}
		if (was == 2)
		{			
			if ((document.form_neues_Projekt.PRBuchhandel[0].checked ) && (document.form_neues_Projekt.PRISBN[1].checked))
			{
				alert("Boekverkopen zonder ISBN zijn niet mogelijk via de boekhandel");
				document.form_neues_Projekt.PRBuchhandel[1].checked = true;
			}
			
		}
		if (was == 3)
		{			
			if ((document.form_neues_Projekt.PRBarsortiment[0].checked ) && (document.form_neues_Projekt.PRISBN[1].checked))
			{
				alert("Ein Verkauf ohne ISBN  ist über das Barsortiment nicht möglich.");
				document.form_neues_Projekt.PRBarsortiment[1].checked = true;
			}
			if (((document.form_neues_Projekt.PRBarsortiment[0].checked ) && (document.form_neues_Projekt.PRBuchhandel[1].checked)) || ((document.form_neues_Projekt.PRISBN[0].checked ) && (document.form_neues_Projekt.PRBuchhandel[1].checked)))
			{
				alert("Ein Verkauf ausschließlich über das Barsortiment ist nicht möglich.");
				document.form_neues_Projekt.PRBarsortiment[1].checked = true;
			}
			
			//temp = parseFloat(document.form_neues_Projekt.PRAutorenhonorarBAR.value.replace(',', '.'));
			
			
			//if (temp < 0)
			//{
				
			//	document.form_neues_Projekt.PRBarsortiment[1].checked = true;
			//}
			
		}
		if (was == 4)
		{
			if (document.form_neues_Projekt.PROnline[1].checked)
			{
				
				document.form_neues_Projekt.PRKopierschutz[1].checked = true;
				document.form_neues_Projekt.PRDOI[1].checked = true;
				document.form_neues_Projekt.PROnlinepublikationpreis.readOnly  = true;
			}
			else
			{
				document.form_neues_Projekt.PROnlinepublikationpreis.readOnly  = false;
			}
		}
		
		if (was == 5)
		{
			if (document.form_neues_Projekt.PROnline[1].checked)
			{
				
				document.form_neues_Projekt.PRKopierschutz[1].checked = true;
			}
		}
		
		if (was == 6)
		{
			if (document.form_neues_Projekt.PROnline[1].checked)
			{
				
				document.form_neues_Projekt.PRDOI[1].checked = true;
			}
		}
		
		if (was == 7)
		{
			if (document.form_neues_Projekt.PRBuchhandel[1].checked)
			{
				document.form_neues_Projekt.PRBarsortiment[1].checked = true;
				document.form_neues_Projekt.PRMesse[1].checked = true;
			}
		}
		
		if (was == 8)
		{			
			if ((document.form_neues_Projekt.PRMesse[0].checked ) && (document.form_neues_Projekt.PRISBN[1].checked))
			{
				alert("Boekverkopen zonder ISBN zijn niet mogelijk op de Buchmesse ");
				document.form_neues_Projekt.PRMesse[1].checked = true;
			}
			
			
		}
		
		if (was == 9)
		{
			if (document.form_neues_Projekt.PRLayout[6].checked)
			{
				
				document.form_neues_Projekt.PRFarbe[0].checked = false;
				document.form_neues_Projekt.PRFarbe[1].checked = false;
				document.form_neues_Projekt.PRFarbe[2].checked = false;
				document.form_neues_Projekt.PRFarbe[3].checked = false;
				document.form_neues_Projekt.PRFarbe[4].checked = false;
				document.form_neues_Projekt.PRFarbe[5].checked = false;
				document.form_neues_Projekt.PRFarbe[6].checked = false;
				document.form_neues_Projekt.PRFarbe[7].checked = false;
				document.form_neues_Projekt.PRFarbe[8].checked = false;
				document.form_neues_Projekt.PRFarbe[9].checked = false;
			}
		}
		
		if (was == 10)
		{
			document.form_neues_Projekt.PRISBN[1].checked = false
			document.form_neues_Projekt.PRISBN[0].checked = true
		}
		
		if (was == 11)
		{
			document.form_neues_Projekt.PRISBN[0].checked = false
			document.form_neues_Projekt.PRISBN[1].checked = true
		}
}

/*---------------------------------------------*/

function addElement() 
{ 
	var Fehlermeldung = "";
	var Empfaenger = "";
	
	Empfaenger = document.form_Empfehlung.EMAIL_EMPFAENGER.value

	validity = true;
	
	if (!check_empty(Empfaenger))
				{ validity = false; Fehlermeldung=Fehlermeldung + "- die E-Mail-Adresse des Empfängers" + String.fromCharCode(13, 10); }		
		        
	if (Fehlermeldung.length > 0)
				{ Fehlermeldung = "Bitte vervollständigen Sie noch folgende Angaben:" + String.fromCharCode(13, 10) + Fehlermeldung; }

	if  ((check_empty(Empfaenger)) && (!check_email(Empfaenger)))
				{
					validity = false; Fehlermeldung=Fehlermeldung + "Die E-Mail-Adresse des Empfängers ist ungültig!" + String.fromCharCode(13, 10); 
					document.form_Empfehlung.EMAIL_EMPFAENGER.value = ""; 
				}

	if (validity)
	{
		element = new Option(document.form_Empfehlung.EMAIL_EMPFAENGER.value, document.form_Empfehlung.EMAIL_EMPFAENGER.value, false, false); 
		document.form_Empfehlung.Elements.options[document.form_Empfehlung.Elements.options.length] = element; 
		document.form_Empfehlung.EMAIL_EMPFAENGER.value = ""; 
	}
	
	else
			{  alert(Fehlermeldung);}
		                          
	return validity;
} 


function deleteElement() 
{ 
	for(i=0; i < document.form_Empfehlung.Elements.length; i++) 
	{
		if(document.form_Empfehlung.Elements.options[i].selected == true) 
		{ 
			document.form_Empfehlung.Elements.options[i] = null; 
		} 
	}
} 


function resetSelection() 
{ 
    for(i=0; i < document.Formular.Elements2.length; i++) 
    { 
        if(document.Formular.Elements2.options[i].defaultSelected == true) 
        { 
            document.Formular.Elements2.options[i].selected = true; 
		} 
	} 
}  

function allToOther() {
  
 for(var j = 0; j < document.form_Empfehlung.Elements.length; j++) {
  document.form_Empfehlung.Elements[j].selected = true; // Alle Eintraege selektieren und
 }

}

function zuruecksetzen()
{
	document.form_Empfehlung.Elements.length = 0; 
	document.form_Empfehlung.BESCHREIBUNG.value = "";
}

/*---------------------------------------------*/





function doIt(was)
{
	
var newImage = new Image();
newImage.onload = function ()
{
getHeightWidth( this )
};

var Bild = new String();


Bild = "http://www.shaker-media.eu/SHM-Upload-Bilder/" + was.toString;

alert(Bild);

newImage.src = Bild;

getHeightWidth( newImage );
}

function getHeightWidth( newImage )
{

if (newImage.alreadyLoaded || newImage.width == 0)
	return true;
breite = newImage.width;
hoehe = newImage.height;
newImage.alreadyLoaded = true;
if ((breite < 1600) || (hoehe < 1200))
alert("Die Auflösung des gewählten Bilds scheint zu gering zu sein. Die Auflösung sollte mindestens 1600 x 1200 Pixel betragen. " + was);

}



/*---------------------------------------------*/
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function DisplayLayer(l, a) {
	obj = MM_findObj(l);
	if(a == 'show') obj.style.display = 'block';
	else if(a == 'hide') obj.style.display = 'none';
}

/*---------------------------------------------*/

function fenster(winname,wintitel) {
	var breite = screen.width/2;
	var hoehe = screen.height/2;
	var links=screen.width/2-breite/2;
	var oben=screen.height/2-hoehe/2;
	NewWin = window.open(winname, wintitel, "width="+breite+",height="+hoehe+",top="+oben+",left="+links+",toolbar=0,location=0, scrollbars=1");
}

/*---------------------------------------------*/
function imposeMaxLength(Object, MaxLen)
{
  return (Object.value.length <= MaxLen);
}


/*---------------------------------------------*/

function RefreshImage(valImageId) {
	var objImage = document.images[valImageId];
	if (objImage == undefined) {
		return;
	}
	var now = new Date();
	objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString();
}
