



/* Bringt Bilder auf der Description-Seite in den Vordergrund. 8.8.2010*/

var nMediaMaxZIndex = 3; //StartIndex, wird immer nur hochgesetzt.

function MediaDescUpperPic(pObject)
{
	nMediaMaxZIndex++;
	pObject.style.zIndex = nMediaMaxZIndex;
	//alert(nMediaMaxZIndex + ' - ' + pObject.style.zIndex);

}


var g_PicBoxSizeN = new Array(700,660);
var g_PicBoxSizeW = new Array(900,650);
var g_PicBoxSizeH = new Array(700,750);
var g_PicBoxSizeWH = new Array(700,810);


function ShowPicture(nIDBilder, cSize)
{
	//window.open("p_pictures.php4?f_nID="+nIDBilder+"&f_cSize="+cSize, "sf_p_picture","width=700,height=650,resizable=yes,scrollbars=no");
	window.open("p_pictures.php4?f_nID="+nIDBilder+"&f_cSize="+cSize, "sf_p_picture","width="+g_PicBoxSizeN[0]+",height="+g_PicBoxSizeN[1]+",resizable=yes,scrollbars=no");
	//window.open("p_pictures.php4?f_nID="+nIDBilder+"&f_cSize="+cSize, "sf_p_picture","width="+g_PicBoxSizeN[0]+",height="+g_PicBoxSizeN[1]+",resizable=yes,scrollbars=auto");
}


function CheckPicBoxSize()
{
	//nActWidth = window.innerWidth;
	//nActHeight = window.outerHeight;
	//nActWidth = 100;
	var nNewWidth;
	var nNewWidth;
	if (bOnEdge == 0 && bWideField == 0) {
		nNewWidth = g_PicBoxSizeN[0];
		nNewHeight = g_PicBoxSizeN[1];
	}
	if (bOnEdge == 1 && bWideField == 0) {
		nNewWidth = g_PicBoxSizeH[0];
		nNewHeight = g_PicBoxSizeH[1];
	}
	if (bOnEdge == 0 && bWideField == 1) {
		nNewWidth = g_PicBoxSizeW[0];
		nNewHeight = g_PicBoxSizeW[1];
	}
	if (bOnEdge == 1 && bWideField == 1) {
		nNewWidth = g_PicBoxSizeWH[0];
		nNewHeight = g_PicBoxSizeWH[1];
	}
	if (cPicSize != 4 && cPicSize != 8) {
		window.resizeTo(nNewWidth, nNewHeight);
	}
	
	//alert("Checke Breite:" + window.pageYOffset + " höhe:" + nActHeight);

}
function ShowInfo(nIDInfo)
{

	//win_info = window.open("p_info.php4?f_nID="+nIDInfo, "sf_p_info","width=200,height=200,resizable=yes,scrollbars=no, top=2000,left=2000'");
	//alert("Argument 0:" + ShowInfo.arguments[0]);
	strParameter = "";
	for (nIndex = 0; nIndex < ShowInfo.arguments.length; nIndex++) {
		if (strParameter == "") {
			strParameter = "?";
		} else {
			strParameter+= "&";
		}
		strParameter+= "f_nID" + (nIndex + 1) + "=" + ShowInfo.arguments[nIndex];
	}
	//alert("Parameter = " + strParameter);

	//Mehrfach-Infobox
	//win_info = window.open("p_info.php4" + strParameter, "sf_p_info","width=200,height=200,resizable=yes,scrollbars=no, top=2000,left=2000'");
	win_info = window.open("p_info.php4" + strParameter, "sf_p_info","width=200,height=200,resizable=yes,scrollbars=no, top=2000,left=2000, menubar=yes, toolbar=yes'");

	//Einfach-Infobox
	//win_info = window.open("p_info.php4?f_nID="+nIDInfo, "sf_p_info","width=200,height=200,resizable=yes,scrollbars=no, top=2000,left=2000'");

}






// *************************************************************************************
// *************************************************************************************
// -------------------------------------------------------------------------------------
// 
// Der Krempel muss noch in eigene Datei (FileFunctions o.ä)
// 
// -------------------------------------------------------------------------------------
// *************************************************************************************
// *************************************************************************************


// -------------------------------------------------------------------------------------
// Standard-HTML-Kopf (Komplette Eröffnung bis einschl. Body-Start-Tag)
// Mit dem Parameter wird das zu füllende Document (Frame) übergeben.
// -------------------------------------------------------------------------------------
function OutputHTMLHeader(pDoc)
{
	with (pDoc) {
		writeln("<HTML><HEAD>");
		writeln("<link rel=\"stylesheet\" href=\"CSS/sf_base.css\">");
		writeln("<TITLE>Schmeissfliege.de</TITLE>");
		writeln("</HEAD>");
		//writeln("<BODY bgcolor=\"#00bbff\">"); 		//klappt nit, wird ignoriert
		writeln("<BODY>");
		//bgColor = "00BBFF";
		//bgColor = "aqua";
		//#b8cfb8		//Original-Farbe
	}
}

// -------------------------------------------------------------------------------------
// Schließt HTML-File ab.
// Mit dem Parameter wird das zu füllende Document (Frame) übergeben.
// -------------------------------------------------------------------------------------
function OutputHTMLFooter(pDoc, bClose)
{
	with (pDoc) {
		writeln("</BODY>");
		writeln("</HTML>");
		if (bClose) {
			close();
		}
	}
}








function ObjectTest() {
	//alert('Function ArrayTest');
	document.write('Function ObjectTest ...');
	
	
	
	
	
	
	
	
	
	
	
	/*
	aUser = new Array();
	aUser[0] = new Object();
	aUser[1] = new Object();
	aUser[2] = new Object();
	
	pUser = new Object();
	
	pUser.Vorname = 'Martin';
	pUser.Nachname = 'Seydler';
	aUser[0] = pUser;
	
	pUser.Vorname = 'Wolle';
	pUser.Nachname = 'roth';
	aUser[1] = pUser;
	
	pUser.Vorname = 'Donald';
	pUser.Nachname = 'Duck';
	aUser[2] = pUser;
	
	document.write(aUser[0].Vorname);
	//document.write('<br>Jemand da?');
	
	
	for (nC = 0; nC < aUser.length; nC++)
	{
		document.write('<br>Name ' + nC + ': ' + aUser[nC].Vorname + ' ' + aUser[nC].Nachname);
	}
	pUser.Vorname = "Willi";
	for (nC = 0; nC < aUser.length; nC++)
	{
		document.write('<br>Name ' + nC + ': ' + aUser[nC].Vorname + ' ' + aUser[nC].Nachname);
	}
	*/
}



function ArrayTest() {
	//alert('Function ArrayTest');
	document.write('Function ArrayTest ausgeführt');
	
	aUser = new Array();
	aUser[0] = 'Martin';
	aUser[1] = 'Fritz';
	aUser[2] = 'Willi';
	
	//document.write('<br>Jemand da?');
	
	
	for (nC = 0; nC < aUser.length; nC++)
	{
		document.write('<br>Name: ' + aUser[nC]);
	}
	
	
	
}




/**
 * Sets/unsets the pointer in browse mode
 *
 * @param   object   the table row
 * @param   object   the color to use for this row
 * @param   object   the background color
 *
 * @return  boolean  whether pointer is set or not
 */
function setPointer(theRow, thePointerColor, theNormalBgColor)
{
    var theCells = null;

    if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    var rowCellsCnt  = theCells.length;
    var currentColor = null;
    var newColor     = null;
    // Opera does not return valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined' && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        newColor     = (currentColor.toLowerCase() == thePointerColor.toLowerCase())
                     ? theNormalBgColor
                     : thePointerColor;
        for (var c = 0; c < rowCellsCnt; c++) {
            theCells[c].setAttribute('bgcolor', newColor, 0);
        } // end for
    }
    else {
        currentColor = theCells[0].style.backgroundColor;
        newColor     = (currentColor.toLowerCase() == thePointerColor.toLowerCase())
                     ? theNormalBgColor
                     : thePointerColor;
        for (var c = 0; c < rowCellsCnt; c++) {
            theCells[c].style.backgroundColor = newColor;
        }
    }

    return true;
} 
// end of the 'setPointer()' function


