function showElement(elementName) {

	var NS = (document.layers) ? true : false;
	var mozilla = (document.getElementById(elementName)) ? true : false;
	var IE = (document.all) ? true : false;
	var isMac = (navigator.userAgent.indexOf('Mac') > 0);

	if (IE) {
		if (document.all[elementName].style.visibility != 'visible') {
			document.all[elementName].style.visibility = 'visible';
		} else {
			document.all[elementName].style.visibility = 'hidden';
		}
		document.all[elementName].style.setAttribute("width", "158px" );
	} else if (mozilla) {
		if (document.getElementById(elementName).style.visibility != 'visible') {
			document.getElementById(elementName).style.visibility = 'visible';
		} else {
			document.getElementById(elementName).style.visibility = 'hidden';
		}
	} else {
		alert('Browser noch nicht unterstützt!');
	}
}

function checkIdent(thisElem) {

	if (thisElem.name.indexOf('[ISBN_1]')>=0) {
		thisIndex = '[ISBN_1]';
		otherIndex = '[ISBN_2]';
	} else {
		thisIndex = '[ISBN_2]';
		otherIndex = '[ISBN_1]';
	}
	otherElem = document.forms[0].elements[thisElem.name.replace(thisIndex, otherIndex)];
	if (thisElem.selectedIndex == otherElem.selectedIndex && thisElem.selectedIndex > 0) {
		alert('Achtung! Sie haben 2 identische ISBN-Nummern ausgewählt.');
	}

}

function SwapImage(image, newImage) {
	document.images[image].src = newImage;

}

function ChangeRadio(){
	document.c.When[1].checked=true;
}




function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v3.0
  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); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function checkForm() {
	
	var checked = false;
	if( typeof document.forms[0].answer.value != 'undefined') {
		checked = document.forms[0].answer.checked;
	} else {
		for	(i=0;i<document.forms[0].answer.length;i++) {
			if (document.forms[0].answer[i].checked) {
				checked = true;
				break;	
			}	
		}
	}
	if (!checked) {
		alert( "Bitte eine Antwort auswählen!" );
	}
	return (checked) ? true : false;
}

function checkForm2() {
			
	var checked = false;
	for (i=0;i<document.forms[0].elements["answer[]"].length;i++) {
		if (document.forms[0].elements[i].checked) {
			checked = true;
			break;	
		}	
	}
	if (!checked) {
		alert( "Bitte eine Antwort auswählen!" );
	}
	return (checked) ? true : false;
}
			
				

function checkWinForm() {
	
	if (document.forms[0].vorname.value == "") {
		alert( "Bitte geben Sie Ihren Vornamen ein." );
		document.forms[0].vorname.focus();
		return false;
	}
	
	if (document.forms[0].nachname.value == "") {
		alert( "Bitte geben Sie Ihren Nachnamen ein." );
		document.forms[0].nachname.focus();
		return false;
	}
	
	if (document.forms[0].email.value == "") {
		alert( "Bitte geben Sie Ihre eMail-Adresse ein." );
		document.forms[0].email.focus();
		return false;
	}
	
	if (document.forms[0].street.value == "") {
		alert( "Bitte geben Sie Ihre Adresse ein." );
		document.forms[0].street.focus();
		return false;
	}
	
	if (document.forms[0].city.value == "") {
		alert( "Bitte geben Sie Ihre Adresse ein." );
		document.forms[0].city.focus();
		return false;
	}
	
	if (! document.forms[0].agb.checked) {
		alert( "Bitte bestätigen Sie die Datenschutzhinweise." );
		return false;
	}
	
	return true;
}


function popup(source, name, width, height, resizable, scrollbars, status, top, left ) { 
 	  var winl = (screen.width - width)/2;
	  var wint = (screen.height - height)/2;
 	    window.open(source, name, "width=" + width + ",height=" + height + ",resizable=" + resizable + ",scrollbars=" + scrollbars + ",status=" + status + ",top=" + wint + ",left=" + winl );
	} 

function openwin(file, width, height)
{
	var win;
	win=window.open('', 'image', 'menubar=no, toolbar=no, status=no, top=50, left=50, width='+width+',height='+height+',resizeable=no, scrollbars=yes');
	win.resizeTo(width, height);
	win.document.open();
	win.document.write('<HTML><HEAD><TITLE>BILDDETAILANSICHT</TITLE><link rel="stylesheet" type="text/css" ></HEAD>');
	win.document.write('<BODY style="margin:0;" onLoad="window.focus();">');
	win.document.write('<table border=0 cellspacing=0 cellpadding=0 width=100% align=center>');
	win.document.write('<tr><td>');
	win.document.write('<a href=# onClick="self.close();"><img border=0 hspace=0 vspace=0 src="'+file+'"></a>');
	win.document.write('</td></tr></table>');
	win.document.write('</BODY></HTML>');
	win.document.close();
}

function show_img(img, width, height)
{
	var win;
	win=window.open('', 'image', 'menubar=no, toolbar=no, status=no, top=50, left=50, width='+width+',height='+height+',resizeable=no, scrollbars=yes');
	win.resizeTo(width, height);
	win.document.open();
	win.document.write('<HTML><HEAD><TITLE>BILDDETAILANSICHT</TITLE><link rel="stylesheet" type="text/css" ></HEAD>');
	win.document.write('<BODY style="margin:0;" onLoad="window.focus();">');
	win.document.write('<table border=0 cellspacing=0 cellpadding=0 width=100% align=center>');
	win.document.write('<tr><td>');
	win.document.write('<a href=# onClick="self.close();"><img src="'+img+'" border="0"></a>');
	win.document.write('</td></tr></table>');
	win.document.write('</BODY></HTML>');
	win.document.close();
}
