/**
 * Opens new window (without: toolbar, menubar, statusbar)
 * with given window height and width.
 *
 * @param     myWindow       url of site to show in new window
 * @param     width          width of new window
 * @param     height         height of new window                
 */
function openWin(myWindow, width, height)
{
  newWin = open(myWindow, "displayWindow", "scrollbars=no, resizable=no, status=no, toolbar=no, menubar=no, width=" + width + ",height=" + height);
  newWin.focus();
}


function openWindow(GrafikURL, intWidth, intHeight)
{	
	var left	= screen.width/2 - intWidth/2 	- 100;
	var top		= screen.height/2 - intHeight/2 - 100;
	
	// for real image size preload window
		
	intWidth += 20;
	popupwindow = window.open('', 'DateWindow', 'scrollbars=no, status=no, toolbar=no, menubar=no, width='+(intWidth)+',height='+(intHeight)+', left=' + left +', top=' + top);
	
	popupwindow.focus();
    popupwindow.document.open();
	
	popupwindow.document.write("<html><head>");
    popupwindow.document.write("<title>Grafikanzeige</title>");
    popupwindow.document.write("</head>");
    popupwindow.document.write("<body leftmargin=\"0\" marginheight=\"0\" marginwidth=\"0\" topmargin=\"0\" >");
    popupwindow.document.write("<img border=\"0\" onclick=\"window.close()\" onload=\"window.resizeTo(" + intWidth +", " + intHeight +")\" src=\""+ GrafikURL +"\" title=\"Zum Schließen auf das Foto klicken\" width=\"" + intWidth + "\" height=\"" + intHeight + "\">");
    popupwindow.document.write("</body></html>"); 
	
}


function openExportTextWindow()
{	
	var left	= screen.width/2  -600	- 100;
	var top		= screen.height/2  -600 - 100;
	
	newWin = open('TextExport.php', "displayWindow", "scrollbars=yes, resizable=yes, status=no, toolbar=no, menubar=no, width=600,height=600, left=" + left +", top=" + top);
  newWin.focus();
  
	
	
    
	
}

function ShowHideStatement( statement_id, include_dir )
{	
	var strContent = 'statement_'  + statement_id  + '_content' ;
	var strContent2 = 'statement_'  + statement_id  + '_content_2' ;
	var strImage = 'statement_'  + statement_id  + '_image' ;

	
	objContent = document.getElementById(strContent);
	objImage = document.getElementById(strImage);
	
	if (objContent.style.display == 'none' || objContent.style.display == "")
	{
		objContent.style.display = 'block';	
		objImage.src= include_dir + 'images/dropdown.gif';
	} else {
		objContent.style.display = 'none';	
		objImage.src= include_dir + 'images/dropdown_right.gif';
	}
}

/**
 * Changes image
 *
 * @param     imgID          name of the pic to change
 * @param     imgObjName     name of the pic to change with
 */
function changeImage(imgID, imgObjName) 
{  
  document.images[imgID].src = eval(imgObjName + ".src")
}


function setFilter( filter )
{
	document.getElementsByName("filter")[0].value = filter;
	window.document.forms['form_filter'].submit();
}


function setStyleAndSubmit( dateListingStyle )
{
	document.getElementById("dateListingStyle").value = dateListingStyle;
	document.dateFilter.submit();
	
}

function removeCheck( link )
{
	result = confirm('Datensatz wirklich entfernen?');
	if( result )
		window.location.href = link;
}

function openEditorWindow( link )
{
	F1 = window.open(link, "Editor",  "scrollbars=yes,resizable=yes,status=yes,width=550,height=700");
}