<?php
/* * *********************** MODIFICATION AXEVISION 20121204 ******************* */
$microtimes = array();
$microtimes[] = 'start: ' . getmicrotime();
/* * *************************************************************************** */

require_once("defines.inc.php");
include_once(PATH_FUNC."session.php");
include_once(PATH_FUNC."tables.inc.php");
include_once(PATH_FUNC."sql_functions.php");
include_once(PATH_FUNC."connect.php");
include_once(PATH_FUNC."panier.php");
include_once(PATH_FUNC."alertes.php");
include_once(PATH_FUNC."date_functions.php");
include_once(PATH_FUNC."build_get.php");
include_once(PATH_FUNC."translate.php");

error_reporting(E_ALL ^ E_WARNING ^ E_NOTICE);

/* * *********************** MODIFICATION AXEVISION 20130122 *********************
 * 
 *  SITE EN MAINTENANCE
 *
  siteInMaintenance();
  /***************************************************************************** */
//Module a afficher
if ($_SESSION["sess_util_no"] != "") {

    $module = "accueil.php";
    if(isset($_SESSION["sess_module"])){
        $module = $_SESSION["sess_module"].".php";
    }
} else {
    if(isset($_SESSION["sess_module"])) {
        if ($_SESSION["sess_module"] == "infogen" || $_SESSION["sess_module"] == "reglement" || $_SESSION["sess_module"] == "demande_creation_compte") {
            $module = $_SESSION["sess_module"].".php";
        } else {
            // AUTOLOG - Axevision 03/02/2016 temp *******************************************
            $token = $_SESSION["sess_salon_exp_token"];
            if(isset($token) &&!empty($token)){

                $sql = "SELECT * FROM ".TBL_SAL_EXP." ".
                "INNER JOIN ".TBL_EXP." ON sexp_exp_id = exp_id ".
                "LEFT JOIN ".TBL_CIV." ON exp_civ_id = civ_id ".
                "WHERE ".
                "sexp_sal_id = '".$_SESSION["sess_salon"]."' AND ".
                "sexp_token_in = '".$token."' AND ".
                "sexp_desactive = '0' AND ".
                "sexp_valide = '1';";

                $res = sql_query($sql);
                if (sql_num_rows($res) > 0) {
                    $row = sql_fetch_array($res);
                    $nb_conn = $row["sexp_nb_connexion"] + 1;
                    $sql_u = "UPDATE ".TBL_SAL_EXP." SET sexp_nb_connexion = '".$nb_conn."' ".
                    "WHERE sexp_id = '".$row["sexp_id"]."';";
                    $res_u = sql_query($sql_u);
                    $_SESSION["sess_util_no"] = $row["exp_id"];
                    $_SESSION["sess_util_cie"] = $row["exp_societe"];
                    $_SESSION["sess_util_nom"] = $row["exp_prenom"]." ".$row["exp_nom"];
                    $_SESSION["sess_util_nom_home_fr"] = trim($row["civ_nom_fr"]." ".$row["exp_nom"]);
                    $_SESSION["sess_util_nom_home_en"] = trim($row["civ_nom_en"]." ".$row["exp_nom"]);
                    $_SESSION["sess_util_stand"] = $row["sexp_stand_id"];
                    $_SESSION["sess_util_tva_oblig"] = $row["sexp_tva_oblig"];
                    $_SESSION["sess_util_qualite"] = $row["sexp_qual_id"];
					$_SESSION["sess_util_token_in"] = $row["sexp_token_in"];
					$_SESSION["sess_util_token_out"] = $row["sexp_token_out"];
					$_SESSION["sess_util_stand_type"] = "";
                    $_SESSION["sess_util_stand_formule"] = "";

                    if(isset($row["sexp_intro_fr"]) &&!empty($row["sexp_intro_fr"])){
                        $_SESSION["sess_salon_intro_fr"] = $row["sexp_intro_fr"];
                    }else{
                        if(!isset($_SESSION["sess_salon_intro_fr"]) || empty($_SESSION["sess_salon_intro_fr"])){
                            $_SESSION["sess_salon_intro_fr"] = "";
                        }
                    }
                    if(isset($row["sexp_intro_en"]) &&!empty($row["sexp_intro_en"])){
                        $_SESSION["sess_salon_intro_en"] = $row["sexp_intro_en"];
                    }else{
                        if(!isset($_SESSION["sess_salon_intro_en"]) || empty($_SESSION["sess_salon_intro_en"])){
                            $_SESSION["sess_salon_intro_en"] = "";
                        }
                    }

                    if ($row["exp_langue"] == "fr" || $row["exp_langue"] == "en") {
                        $_SESSION["sess_langue"] = $row["exp_langue"];
                    }
                    $sql_std = "SELECT * FROM ".TBL_STAND." WHERE ".
                    "stand_id = '".$row["sexp_stand_id"]."';";
                    $res_std = sql_query($sql_std);
                    if (sql_num_rows($res_std) > 0) {
                        $row_std = sql_fetch_array($res_std);
                        $_SESSION["sess_util_stand_type"] = $row_std["stand_typstd_id"];
                        $_SESSION["sess_util_stand_formule"] = $row_std["stand_for_id"];
                    }
                    header ("location: ".PATH_ROOT.INDEX_PAGE_NAME."?m=accueil&autolog=1");
                } else {
                    $module = "demande_acces.php";
                }
                //*********************************************************************************	
            }else{
                $module = "demande_acces.php";
            }
        }
    } else {
        // AUTOLOG - Axevision 03/02/2016 temp *******************************************
        $token = $_SESSION["sess_salon_exp_token"];
        if(isset($token) &&!empty($token)){
        $sql = "SELECT * FROM ".TBL_SAL_EXP." ".
        "INNER JOIN ".TBL_EXP." ON sexp_exp_id = exp_id ".
        "LEFT JOIN ".TBL_CIV." ON exp_civ_id = civ_id ".
        "WHERE ".
        "sexp_sal_id = '".$_SESSION["sess_salon"]."' AND ".
        "sexp_token_in = '".$token."' AND ".
        "sexp_desactive = '0' AND ".
        "sexp_valide = '1';";

        $res = sql_query($sql);
        if (sql_num_rows($res) > 0) {
        $row = sql_fetch_array($res);
        $nb_conn = $row["sexp_nb_connexion"] + 1;
        $sql_u = "UPDATE ".TBL_SAL_EXP." SET sexp_nb_connexion = '".$nb_conn."' ".
        "WHERE sexp_id = '".$row["sexp_id"]."';";
        $res_u = sql_query($sql_u);
        $_SESSION["sess_util_no"] = $row["exp_id"];
        $_SESSION["sess_util_cie"] = $row["exp_societe"];
        $_SESSION["sess_util_nom"] = $row["exp_prenom"]." ".$row["exp_nom"];
        $_SESSION["sess_util_nom_home_fr"] = trim($row["civ_nom_fr"]." ".$row["exp_nom"]);
        $_SESSION["sess_util_nom_home_en"] = trim($row["civ_nom_en"]." ".$row["exp_nom"]);
        $_SESSION["sess_util_stand"] = $row["sexp_stand_id"];
        $_SESSION["sess_util_tva_oblig"] = $row["sexp_tva_oblig"];
        $_SESSION["sess_util_qualite"] = $row["sexp_qual_id"];
		$_SESSION["sess_util_token_in"] = $row["sexp_token_in"];
        $_SESSION["sess_util_token_out"] = $row["sexp_token_out"];
        $_SESSION["sess_util_stand_type"] = "";
        $_SESSION["sess_util_stand_formule"] = "";

        if(isset($row["sexp_intro_fr"]) &&!empty($row["sexp_intro_fr"])){
        $_SESSION["sess_salon_intro_fr"] = $row["sexp_intro_fr"];
        }else{
        if(!isset($_SESSION["sess_salon_intro_fr"]) || empty($_SESSION["sess_salon_intro_fr"])){
        $_SESSION["sess_salon_intro_fr"] = "";
        }
        }
        if(isset($row["sexp_intro_en"]) &&!empty($row["sexp_intro_en"])){
        $_SESSION["sess_salon_intro_en"] = $row["sexp_intro_en"];
        }else{
        if(!isset($_SESSION["sess_salon_intro_en"]) || empty($_SESSION["sess_salon_intro_en"])){
        $_SESSION["sess_salon_intro_en"] = "";
        }
        }

        if ($row["exp_langue"] == "fr" || $row["exp_langue"] == "en") {
        $_SESSION["sess_langue"] = $row["exp_langue"];
        }
        $sql_std = "SELECT * FROM ".TBL_STAND." WHERE ".
        "stand_id = '".$row["sexp_stand_id"]."';";
        $res_std = sql_query($sql_std);
        if (sql_num_rows($res_std) > 0) {
        $row_std = sql_fetch_array($res_std);
        $_SESSION["sess_util_stand_type"] = $row_std["stand_typstd_id"];
        $_SESSION["sess_util_stand_formule"] = $row_std["stand_for_id"];
        }
        header ("location: ".PATH_ROOT.INDEX_PAGE_NAME."?m=accueil&autolog=2");
        } else {
        $module = "demande_acces.php";
        }
        //*********************************************************************************	
        }else{
        $module = "demande_acces.php";
        }
    }
}

if ($_SESSION["sess_salon"] == "") {
    //echo "Page non trouvee - Vous devez acceder a ce site en entrant le nom du salon dans l'URL";
    echo "";
    exit;
} else {
    //echo $_SESSION["sess_salon_nom"];
}

if ($_GET["famille"] != "") {
}
else {
    if ($_GET["categorie"] != "") {
        $sql_fam = "SELECT * FROM ".TBL_CAT." WHERE ".
        "cat_id = '".$_GET["categorie"]."';";
        $res_fam = sql_query($sql_fam);
        if (sql_num_rows($res_fam) > 0) {
            $row_fam = sql_fetch_array($res_fam);
            $_GET["famille"] = $row_fam["cat_fam_id"];
        }
    }

    if ($_GET["produit"] != "") {
        $sql_fam = "SELECT * FROM ".TBL_PROD." ".
        "INNER JOIN ".TBL_CAT." ON prod_cat_id = cat_id ".
        "WHERE ".
        "prod_id = '".$_GET["produit"]."';";
        $res_fam = sql_query($sql_fam);
        if (sql_num_rows($res_fam) > 0) {
            $row_fam = sql_fetch_array($res_fam);
            $_GET["famille"] = $row_fam["cat_fam_id"];
        }
    }
}

$my_date_format = "dd/mm/yy";
$my_date_long_format = "dd/mm/yyyy";

if ($_SESSION["sess_langue"] == "en") {
    $my_date_format = "yy/mm/dd";
    $my_date_long_format = "yyyy/mm/dd";
}

setcookie("arcance_interface_langue", $_SESSION["sess_langue"]);
?>
<!DOCTYPE html>

<html lang="fr">

    <head>
		<script type="text/javascript" src="//try.abtasty.com/e6079827901f1901552822310d46ff28.js"></script>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="author" content="Arcance Events">    

        <title>
            <?php echo APP_TITLE; ?>
        </title>

        <?php include_once(PATH_CSS."arcance.css.php"); ?>
        <?php include_once(PATH_CSS."form.css.php"); ?>
        <?php include_once(PATH_CSS."bouton.css.php"); ?>
        <?php include_once(PATH_CSS."menu_gauche.css.php"); ?>
        <?php include_once(PATH_CSS."menu_droite.css.php"); ?>

        <link href="css/bootstrap.min.css" rel="stylesheet">
        <link href="css/font-awesome.min.css" rel="stylesheet">
        <link href="css/prettyPhoto.css" rel="stylesheet">
        <link href="css/price-range.css" rel="stylesheet">
        <link href="css/animate.css" rel="stylesheet">
        <link href="css/main.css" rel="stylesheet">
        <link href="css/responsive.css" rel="stylesheet">    
        <link href="css/magnific-popup.css" rel="stylesheet">    
        <link href="css/arcance.css" rel="stylesheet">    

        <link href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.3.0/animate.min.css" rel="stylesheet">    

        <script src="js/fo/jquery.js"></script>
        <script src="js/fo/bootstrap.min.js"></script>
        <script src="js/fo/jquery.scrollUp.min.js"></script>
        <script src="js/fo/price-range.js"></script>
        <script src="js/fo/jquery.prettyPhoto.js"></script>
        <script src="js/fo/main.js"></script>
    <!--    <script src="js/fo/jquery.mobile-1.4.5.min.js"></script>-->

        <script type="text/javascript">

            function addLoadEvent(func) {
                var oldonload = window.onload;
                if (typeof window.onload != 'function') {
                    window.onload = func;
                } else {
                    window.onload = function () {
                        if (oldonload) {
                            oldonload();
                        }
                        func();
                    }
                }
            }

        </script>    

        <?php //includeCss($module); ?>

        <?php printHeaderScript(); ?>

    </head>

    <body onload="javascript:win_onload();">


        <header id="header">

            <!-- HEADER AVEC BANDEAU HAUT -->
            <?php include_once(PATH_INC."header.php"); ?>

            <!-- ONGLETS -->
            <?php include_once(PATH_INC."onglet.php"); ?>

        </header>          

        <section>
            <div class="container">
                <div class="row">


                    <?php if($module != 'panier.php' && $module != 'demande_service.php' && $module != 'ma_com.php'): ?>

                    <!--MENU GAUCHE-->
                    <div class="col-sm-12 col-md-2 col-lg-2 ">


                        <?php if($module != 'demande_acces.php'): ?>


                        <?php $my_serv_type = getServiceType($module); ?>
                        <?php $width = getWidth($module); ?>

                        <?php if ($my_serv_type != 5): ?>
                        <div id="menu_gauche">
                            <?php include_once(PATH_INC."menu_gauche.php"); ?>
                            <?PHP $microtimes[] = 'after menu_gauche: ' . getmicrotime(); ?>        
                        </div>
                        <?php endif; ?>                

                        <?php endif; ?>


                    </div>            
                    <div class="col-sm-12 col-md-8 ">


                        <!-- LE MODULE A AFFICHER -->
                        <?php include_once(PATH_MODULES.$module); ?>


                    </div>            
                    <div class="col-sm-12 col-md-2 col-lg-2">


                        <!--MENU DROITE-->
                        <?php if($module!="panier.php" && $my_serv_type != 5): ?>
                        <div id="menu_droite">
                            <?php include_once(PATH_INC."menu_droite.php"); ?>
                            <?PHP $microtimes[] = 'after menu_droite: ' . getmicrotime(); ?>
                        </div>
                        <?php endif; ?>


                    </div>

                    <?php else: ?>
                    <div class="col-sm-12">
                        <!-- LE MODULE A AFFICHER -->
                        <?php include_once(PATH_MODULES.$module); ?>
                    </div>
                    <?endif; ?>

                </div>
            </div>

        </section>

        <footer id="footer">
            <?php include_once(PATH_INC."footer.php"); ?>
        </footer> 
			
		<script language="JavaScript" type="text/javascript">
        <!--
        function logout() {  
            if (confirm("<?php echo translate("Voulez-vous quitter?", "Do you want to quit?");?>")) {
                window.open("logout.php", "_top");
            }
        }

        function show_ppsps() {
            window.open("show_ppsps.php?exp=<?php echo $_SESSION["sess_util_no"];?>&sal=<?php echo $_SESSION["sess_salon"];?>&stand=<?php echo $_SESSION["sess_util_stand"];?>", "_blank");
        }

        function show_account(){
            
            <?php if ($_SESSION["sess_util_no"] != ""): ?>
                    
                    
                if(document.getElementById('compte_contenu').style.display=='none'){
                    document.getElementById('compte_contenu').style.display='block';
                }else{
                    document.getElementById('compte_contenu').style.display='none';
                }
                
                
            <?php else: ?>
                
                
                window.open("<?php echo PATH_ROOT.INDEX_PAGE_NAME;?>?m=demande_acces", "_top");
                
                
            <?php endif; ?>
        }

        function lost_password() {
            
            window.open("mdp_perdu.php", "_blank", "top=0,left=0,width=415,height=100");
        }

        function valid_form_login() {
            
            var valid = true;
            
            if (document.getElementById("txt_login").value == "") {
                valid = false;
            }
            
            if (document.getElementById("txt_pass").value == "") {
                valid = false;
            }
            
            if (valid) {
                document.frmLogin.submit();
            } else {
                alert("<?php echo translate("Pour vous identifier, merci de remplir votre login et mot de passe.", "To identify yourself, you must fill in your login and password.");?>");
            }
        }
        //-->
		</script>	
        <!-- GOOGLE ANALYTICS -->
        <script type="text/javascript">

            var _gaq = _gaq || [];
            _gaq.push(['_setAccount', 'UA-38320953-1']);
            _gaq.push(['_trackPageview']);

            (function () {
                var ga = document.createElement('script');
                ga.type = 'text/javascript';
                ga.async = true;
                ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                var s = document.getElementsByTagName('script')[0];
                s.parentNode.insertBefore(ga, s);
            })();

        </script>

    </body>

</html>
<?PHP
/* * ****************************** FUNCTIONS ********************************** */

/* * *********************** MODIFICATION AXEVISION 20121204 ******************* */
//foreach ($microtimes as $time) {
//    echo "-------------------->".$time."<br><br><br><br>";
//}
/* * *************************************************************************** */



function includeCss($module){

    switch ($module) {
        case "accueil.php":
        case "infogen.php":
        case "reglement.php":
        case "plan.php":
        case "formule.php":
        case "service.php":
        case "produit.php":
            include_once(PATH_CSS."accueil.css.php");
        break;
        case "demande_acces.php":
        break;
        case "famille.php":
            include_once(PATH_CSS."accueil.css.php");
        break;
        case "categorie.php":
        case "recherche.php":
            include_once(PATH_CSS."categorie.css.php");
        break;
        case "compte_coord.php":
        case "compte_decorateur.php":
        case "compte_valide.php":
        break;
        case "demande_acces.php":
        break;
        case "compte_fact.php":
            include_once(PATH_CSS."factures.css.php");
        break;
        case "compte_fact_det.php":
        case "valid_commande.php":
        case "imprimer_facture.php":
            include_once(PATH_CSS."commande.css.php");
        break;
        case "panier.php":
            include_once(PATH_CSS."panier.css.php");
        break;
        case "partage_fichiers.php":
        case "compte_partage.php":
            include_once(PATH_CSS."fichiers.css.php");
        break;
        case "ppsps.php":
        case "compte_ppsps.php":
        case "valid_ppsps.php":
            include_once(PATH_CSS."ppsps.css.php");
        //echo "<link rel=\"stylesheet\" href=\"".PATH_CSS."ppsps.css\" type=\"text/css\" />";
        break;
    }

}

function getServiceType($module){

    $my_serv_type = 0;

    if ($module == "demande_service.php" || $module == "ma_com.php") {

        $sql_ser = "SELECT * FROM ".TBL_SAL_SER." ".
        "WHERE ".
        "sser_id = '".$_GET["service"]."';";

        $res_ser = sql_query($sql_ser);

        if (sql_num_rows($res_ser) > 0) {
            $row_ser = sql_fetch_array($res_ser);
            $my_serv_type = $row_ser["sser_typs_id"];
        }
    }

    return $my_serv_type;
}

function getWidth($module){

    $my_serv_type = 0;

    if($module=="panier.php"){

        $width = "754";
    }else{

        if ($module == "demande_service.php" || $module == "ma_com.php") {

            $sql_ser = "SELECT * FROM ".TBL_SAL_SER." ".
            "WHERE ".
            "sser_id = '".$_GET["service"]."';";

            $res_ser = sql_query($sql_ser);

            if (sql_num_rows($res_ser) > 0) {
                $row_ser = sql_fetch_array($res_ser);
                $my_serv_type = $row_ser["sser_typs_id"];
            }

            if ($my_serv_type == 5){
                $width = "979";
            } else {
                $width = "568";
            }
        } else {
            $width = "568";
        }
    }

    return $width;
}

function getmicrotime(){
    $format = 'Y-m-d H:i:s:u';
    $timestamp = null;
    if (is_null($utimestamp))
        $utimestamp = microtime(true);

    $timestamp = floor($utimestamp);
    $milliseconds = round(($utimestamp - $timestamp) * 1000000);

    return date(preg_replace('`(?<!\\\\)u`', $milliseconds, $format), $timestamp);
}

function get_client_ip() {
    $ipaddress = '';
    if (getenv('HTTP_CLIENT_IP'))
        $ipaddress = getenv('HTTP_CLIENT_IP');
    else if(getenv('HTTP_X_FORWARDED_FOR'))
        $ipaddress = getenv('HTTP_X_FORWARDED_FOR');
    else if(getenv('HTTP_X_FORWARDED'))
        $ipaddress = getenv('HTTP_X_FORWARDED');
    else if(getenv('HTTP_FORWARDED_FOR'))
        $ipaddress = getenv('HTTP_FORWARDED_FOR');
    else if(getenv('HTTP_FORWARDED'))
        $ipaddress = getenv('HTTP_FORWARDED');
    else if(getenv('REMOTE_ADDR'))
        $ipaddress = getenv('REMOTE_ADDR');
    else
        $ipaddress = 'UNKNOWN';
    return $ipaddress;
}

function siteInMaintenance(){

    if( $_SESSION["sess_salon"] != '71' || $_SESSION["sess_util_no"] != '6082'):
    ?>
    <html>
        <head>
            <title>Le site est en maintenance</title>
        </head>
        <body style="font-family: verdana; font-size:12px; color: #fff; background-color: #000;">
        <center>
            <p style="font-size:1.5em;margin-top:200px;">Le site <b>espace-exposant.com</b> est en cours de maintenance, <br>
                Retour à la normale dès que possible</p>
        </center>
    </body>
    </html>        
    <?php
    endif;
    die();
}

function printHeaderScript(){
        ?>    

        <script type="text/javascript">
            <!--
                function win_onload() {
        <?php
        if ($_GET["errorlogin"] == "1") {
        ?>
                alert("<?php echo display_long_text(translate("Vos identifiants ne sont pas corrects.", "Your login is not valid.")); ?>");
        <?php
        }
        if ($_GET["errorlogin"] == "2") {
        ?>
                alert("<?php echo translate("Il semble que vous soyez déjà dans nos dossiers. Pour vous identifier, merci de remplir votre login et mot de passe.", "It seems your information is already in our files. To identify yourself, you must fill in your login and password"); ?>");
        <?php
        }
        if ($_GET["errorlogin"] == "3") {
        ?>
                alert("<?php echo translate("Merci, nous avons bien reçu votre demande. Vous recevrez un email vous indiquant vos identifiants dès que votre demande aura été validée.", "Thank you, your request was received successfully. We will send you an email when it has been approved."); ?>");
        <?php
        }
        if ($_GET["errorlogin"] == "4") {
        ?>
                alert("<?php echo translate("Un responsable de stand existe déjà pour ce stand.", "A stand manager already exists for this stand."); ?>");
        <?php
        }
        if ($_GET["errorlogin"] == "5") {
        ?>
                alert("<?php echo translate("Un décorateur existe déjà pour ce stand.", "A designer already exists for this stand."); ?>");
        <?php
        }
        if ($_GET["view"] != "") {
        ?>
                //window.open("<?php echo urldecode($_GET["view"]) ?>", "_blank", "top=0,left=0");
        <?php
        }
        if ($_GET["pwc"] == "0") {
        ?>
                alert("<?php echo translate("Votre mot de passe n'a pas été mis à jour car votre mot de passe actuel saisi n'est pas valide.", "Your password was not changed because the current password you specified is invalid."); ?>");
        <?php
        }
        if ($_GET["pwc"] == "1") {
        ?>
                alert("<?php echo translate("Votre mot de passe a été mis à jour.", "Your password has been changed."); ?>");
        <?php
        }
        if ($_GET["postdeco"] == "1") {
        ?>
                alert("<?php echo translate("Un email a été envoyé à votre décorateur avec ses codes.", "An email has been sent to your designer with his codes."); ?>");
        <?php
        }
        if ($_SESSION["addcarterror"] == "YES") {
        ?>
                alert("<?php echo translate("Impossible d'ajouter au panier. La date limite de commande est dépassée.", "Unable to add to cart. Order deadline has passed."); ?>");
        <?php
        }
        $_SESSION["addcarterror"] = "";
        ?>
        if (document.getElementById("comm_box_exposant")) {
            fixH2('comm_box_exposant', 'comm_box_salon', 'comm_box_stand');
        }
    }

    function sortNum(a, b) {
        return b - a;
    }

    function fixH(one, two) {
        if (document.getElementById(one)) {
            var lh = document.getElementById(one).offsetHeight;
            var rh = document.getElementById(two).offsetHeight;
            var nh = Math.max(lh, rh);
            document.getElementById(one).style.height = nh + "px";
            document.getElementById(two).style.height = nh + "px";
        }
    }

    function fixH2(one, two, three) {
        if (document.getElementById(one)) {
            var obj = new Array(3);
            var option = [one, two, three];
            for (var i = 0; i < option.length; i++) {
                document.getElementById(option[i]).style.height = "auto";
                obj[i] = document.getElementById(option[i]).offsetHeight;
                nh = obj.sort(sortNum);
            }
            nh1 = nh.splice(1, 2);
            for (var i = 0; i < option.length; i++) {
                document.getElementById(option[i]).style.height = nh + "px";
            }
        }
    }
    //-->
</script>

<?php
}
?>    


