<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
// +----------------------------------------------------------------------+
// | PHP version 4/5                                                      |
// +----------------------------------------------------------------------+
// | This source file is a part of iScripts Multicart                     |
// +----------------------------------------------------------------------+
// | Authors: Programmer<programmer@armia.com>        		              |
// +----------------------------------------------------------------------+
// | Copyrights Armia Systems, Inc and iScripts.com © 2005                |
// | All rights reserved                                                  |
// +----------------------------------------------------------------------+
// | This script may not be distributed, sold, given away for free to     |
// | third party, or used as a part of any internet services such as      |
// | webdesign etc.                                                       |
// +----------------------------------------------------------------------+
?>
<?php
if(!isset($_SERVER['REQUEST_URI'])) {
	if(isset($_SERVER['SCRIPT_NAME']))
		$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'];
	else
		$_SERVER['REQUEST_URI'] = $_SERVER['PHP_SELF'];

	if($_SERVER['QUERY_STRING']){
		$_SERVER['REQUEST_URI'] .=  '?'.$_SERVER['QUERY_STRING'];
	}
}

if(strcasecmp(basename($_SERVER['REQUEST_URI']),"install.php")==0){
;
}else{
	if (INSTALLED ===true) {
		;
	}else{
		if(strstr($_SERVER['PHP_SELF'],'admin') == TRUE || strstr($_SERVER['PHP_SELF'],'sellers') == TRUE || strstr($_SERVER['PHP_SELF'],'affiliates') == TRUE)
		{
			header("Location:../install/install.php");
			//exit;
		}
		else
		{
			header("Location:./install/install.php");
		}	
	}
}
if(basename($_SERVER['PHP_SELF']) == "payment.php" || basename($_SERVER['PHP_SELF']) == "yourpay_payment.php") 
{
?>
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="https://www.w3.org/1999/xhtml">
	<head>

<?php
}
else
{
?>
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>

<?php
}
?>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title><?php echo htmlentities(SITE_NAME);?></title>

<!--Rating css begins-->

<link href="./style/rating.css" rel="stylesheet" type="text/css">

<!--Rating css ends-->

<?php

if(strstr($_SERVER['PHP_SELF'],'admin') == TRUE || strstr($_SERVER['PHP_SELF'],'sellers') == TRUE || strstr($_SERVER['PHP_SELF'],'affiliates') == TRUE || strstr($_SERVER['PHP_SELF'],'install') == TRUE)
{
	/*display the active template*/
	if (INSTALLED===true) {
	
	$active_template = displayTemplate();
	}

	//fetching header,footer class from active template // Don't remove it 
	if($active_template[4]) {
		$filename="../themes/".$active_template[4];
	}else {
		$filename="../themes/Feelings-Green/style.css";
	}
	
	$css_file=file_get_contents("$filename");
	$heder_style=explode("\n",strstr($css_file,'.subheading'));
	$acitve_color=explode("background-color:",$heder_style[2]);
	$header_style=substr($acitve_color[1],0,strlen($acitve_color[1])-1);
	// footer color 
	$footer_style=explode("\n",strstr($css_file,'.copyright_area'));
	$f_color=explode("background-color:",$footer_style[2]);
	$footer_bgcolor=substr($f_color[1],0,strlen($f_color[1])-1);
	// select font color
	$font_style=explode("\n",strstr($css_file,'.copyright_area'));
	$fnt_color=explode("color:",$font_style[3]);
	$font_color=substr($fnt_color[1],0,strlen($fnt_color[1])-1);
	
	$footer_style=explode("\n",strstr($css_file,'.copyright_area'));
	$f_color=explode("background-color:",$footer_style[2]);
	$footer_bgcolor=substr($f_color[1],0,strlen($f_color[1])-1);
	// loginarea color
	$login_style=explode("\n",strstr($css_file,'#login_area'));
	$l_color=explode("background-color:",$login_style[4]);
	$login_bgcolor=substr($l_color[1],0,strlen($l_color[1])-1);
	// End fetching Footer,header classes 
?>

<script src="../js/javascript_check.js"></script>
<link href="../style/template1-admin.css" rel="stylesheet" type="text/css">
<!--Template admin css begins-->
<style>
.header{
	height:85px;
	border:solid 1px #E1E1E1;
	border-bottom:solid 15px <?php echo $header_style;?>;
	background:#fff url(../images/header_grdnt.gif) repeat-x left top;
	margin-bottom:5px;
}
.copyright
{
	background-color:<?php echo $footer_bgcolor;?>;
	border:solid 1px #C4C3C3;
	height:25px;
	color:<?php echo $font_color;?>;
	padding-top:8px;

}
.login_btm_lnks1{
	font:11px Tahoma, Arial;
	color:<?php echo $font_color;?>;
	margin-bottom:5px;	
}
.login_btm_lnks1 A:link{
	font:11px Tahoma, Arial;
	color:<?php echo $font_color;?>;
	margin-bottom:5px;
	text-decoration:none;	
	 

}
.login_btm_lnks1 A:visited{
	font:11px Tahoma, Arial;
	color:<?php echo $font_color;?>;
	margin:8px 0px 5px;	
	margin-bottom:5px;	
	text-decoration:none;
}

#login_area_new{
	width:178px;
	height:179px;
	color:<?php echo $font_color;?>;
	background-color:<?php echo $login_bgcolor;?>;
	padding:20px 15px 0px;
}

</style>

<!--Template admin css ends-->

<?php
}
else
{

?>
<!--Template home css begins-->
<link href="./style/<?php echo $active_template[4]?>" rel="stylesheet" type="text/css">
<?php
}
?>
<!--Home page javscript begins-->
<script src="./js/script_homepage.js"></script>
<!--Home page javscript ends-->
<!-- rating star script begins -->
<script type="text/javascript" language="javascript" src="./js/behavior.js"></script>
<script type="text/javascript" language="javascript" src="./js/rating.js"></script>
<script type="text/javascript">AC_FL_RunContent = 0;</script>
<script language="javascript" type="text/javascript" src="./js/AC_RunActiveContent.js"></script>
<link href="favicon.ico" type="image/x-icon" rel="icon"> 
<link href="favicon.ico" type="image/x-icon" rel="shortcut icon">
<!-- rating star script ends -->
</head>