<?php

/**
 * 
 * Copyright (C) Die Randgruppe GmbH
 * 
 * http://www.randshop.com
 * http://www.dierandgruppe.com
 * 
 * Unter der Lizenz von Die Randgruppe GmbH:
 * http://www.randshop.com/Lizenz
 *  
 * $Author$
 * $Date$
 * $Revision$
 * 
 */

session_start();

// Hauptkonfigurationsdatei
if (!$SEOCall) {
    include_once("../../conf/config.inc.php");
    include_once(DATEIPFAD . "conf/db.inc.php");
}

include_once(DATEIPFAD . "includes/shopinitialize.inc.php");
include_once(DATEIPFAD . "includes/functions.global.inc.php");
if(KUNDENGRUPPEN) {
	include_once(DATEIPFAD . "includes/functions.mod.kundengruppen.inc.php");
} else {
	include_once(DATEIPFAD . "includes/functions.kundengruppen.inc.php");
}
include_once(DATEIPFAD . "includes/functions.artikel.inc.php");
include_once(DATEIPFAD . "includes/functions.kategorie.inc.php");
//Sessionregister
include_once(DATEIPFAD . "includes/session_register.inc.php");
//Spracheninclude
	if (@fopen(DATEIPFAD . "includes/language/langu_" . $_SESSION["languageisocode"] . ".inc.php",r)) {
		include_once(DATEIPFAD . "includes/language/langu_" . $_SESSION["languageisocode"] . ".inc.php");
} else {
	include_once(DATEIPFAD . "includes/language/langu_de.inc.php");
}	

if ($_GET['formaction']) { $FormAction = $_GET['formaction'];};

if ($FormAction == "artikelseite"){
	$_SESSION['cs_referer'] = $_SERVER['HTTP_REFERER'];
} else {
	unset($_SESSION['cs_referer']);
}


if($katId == "") {
	$_SESSION['kat'] = "";
}

	// Header
	include_once(DATEIPFAD . "includes/header.inc.php");

	if ((int)$_GET["id"]) {

		$MenueObject = GetMenueDetails((int)$_GET["id"], $_SESSION["languageid"]);

		$tpl_topHeadline = $MenueObject->headline;

		if ($MenueObject->bigImage != "") {
		    
			if(file_exists(DATEIPFAD . "images/dbimages/" . $MenueObject->bigImage)) {

				$imageSize = getimagesize(DATEIPFAD . "images/dbimages/" . $MenueObject->bigImage);
				$tpl_topImage =  "<img src=\"" . URLPFAD . "images/dbimages/" . $MenueObject->bigImage . "\" width=\"" . $imageSize[0] . "\" height=\"" . $imageSize[1] . "\" border=\"0\" align=\"left\">\n";

			}
		}
		
        $shopeinstellungenObject = GetShopeinstellungDetail();
		
        if ($shopeinstellungenObject->fck_aktiv) {
            $tpl_topEintrag = stripslashes($MenueObject->textEintrag) . "\n";
        } else {
            $tpl_topEintrag = nl2br(stripslashes($MenueObject->textEintrag)) . "\n";
        }	
	
		$contentFile = DATEIPFAD . "templates/" . $rowTemp->name . "/website/topnavi/topnavi.tpl";

} else {

	$contentFile = DATEIPFAD . "templates/" . $rowTemp->name . "/website/kein_inhalt.tpl";

}
	
// Letzte globale Zusammenfassung z.B. fuer Warenkorbanzeige, bevor das Template geladen wird.
include_once(DATEIPFAD . "includes/footer.inc.php");

// Template
if($mobilestyle) {
    include_once(DATEIPFAD . "templates/" . $rowTemp->name . "/mobile/layout.phtml");
} else {
    include_once(DATEIPFAD . "templates/" . $rowTemp->name . "/website/index.tpl");
}
	
@mysql_close($db);
?>
