<?php
    require('meniuri.php');
    
    $suprima_meniu_stanga = 0;
    $arata_medici_colaboratori = 0;
    $margine = '0px';

    function writepagetitle($title = "")
    {
        global $scriptroot, $imagesroot, $imagine_antet;
        if (!isset($title)) $title = "BizMedica";
        if (strlen($title) == 0) $title = "BizMedica";
        if (!isset($imagine_antet)) $imagine_antet = 'fundal_sus.png';
        ?>
        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
        <html>
        <head>
            <title><?php echo $title; ?></title>
            <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2;">
            <link href="<?=$scriptroot?>main.css.php?imagine_antet=<?=$imagine_antet?>" rel="stylesheet">
            <link rel="shortcut icon" href="<?=$imagesroot?>bizmedica.ico" type="image/x-icon">
            <script type="text/javascript" src="js/mootools.js"></script>
	        <script type="text/javascript" src="js/slimbox.js"></script>
	        <link rel="stylesheet" href="css/slimbox.css" type="text/css" media="screen" /> 
            <!--[if lt IE 7.]>
                <script defer type="text/javascript" src="pngfix.js"></script>
            <![endif]-->
        </head>
        <body>
        <?php
    }

    function writepagetop()
    {
        global $scriptroot, $imagesroot, $authenticated, $id_meniu, $imagine_meniu, $margine;
        $q = mysql_query("SELECT * FROM optiuni LIMIT 0, 1");
        $r = mysql_fetch_assoc($q);
        ?>
		<div id="pagina" class="box">
  			<div id="antet">
  			    <div class="motto"><? echo $r['motto']?></div>
  			    <div id="meniu_sus">
  			        <div class="stanga"></div>
  			        <div class="centru"><? meniu_sus() ?></div>
  			        <div class="dreapta"></div>
  			    </div>
  			    <div id="submeniu_sus"><div style='float: right; <? echo "margin-right: $margine"; ?>'>
  			    	<div class="stanga"></div>
  			    	<div class="centru"><? submeniu_sus() ?></div>
  			    	<div class="dreapta"></div>
  			      </div>
  			    </div>
  			    <div class="imagine_stanga"></div>
  			    <div class="oferta"><a href='index.php?id_meniu=9'>BizMedica mulțumește doamnei Dr. Doina Mihailă, Președintele Patronatului Medicilor de Familie pentru contribuția și implicarea în dezvoltarea acestui program !</a></div>
  			    <div class="imagine_dreapta"><a href='index.php?id_meniu=9'><img src="<?=$imagesroot?>mihaila.jpg" width="70" height="78" border="0" alt="Dr. Doina Mihaila"></a></div>
  			</div>
			  
			<div id="continut" class="box">
				<div class="articol">
        <?
    }
    
    function writepagebottom($detalii = '')
    {
        global $scriptroot, $imagesroot, $id_meniu;
        ?>
        		<div class="meniu_stanga"><? meniu_stanga(); ?></div>
        		<div class="meniu_colaboratori"><? meniu_colaboratori(); ?></div>
				</div>
				<div class="meniu_dreapta"><? meniu_dreapta(); ?>
				    <div style="height: 10px">&nbsp;</div>
				</div>

<object width="350" height="270" style="float: right; padding: 0px; margin: 0px; display: block; clear: right">
                    <param name="movie" value="http://www.youtube.com/v/FQkYqo3ZzFQ&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/FQkYqo3ZzFQ&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="350" height="270"></embed>
</object><br><br>
<object width="350" height="270" style="float: right; padding: 0px; margin: 0px; display: block; clear: right"><param name="movie" value="http://www.youtube.com/v/1KWEqNDKEoU&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/1KWEqNDKEoU&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="350" height="270"></embed></object>

</div>
			<div id="subsol" class="box"><? meniu_jos(); ?></div>

      	</div>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-7584421-4");
pageTracker._trackPageview();
} catch(err) {}</script>
        </body>
        </html>
        <?php
    }
    
    function writeinfolayer()
    {
        global $imagesroot;
        ?>        
        <script type='text/javascript'>
        
        function openInfo(id_articol)
        {
            document.getElementById("info_text").src = "about:blank";
            document.getElementById("info_text").src = "gettext.php?id_articol=" + id_articol;
            document.getElementById("info").style.left = parseInt((document.body.clientWidth - 790) / 2) + "px"; 
            document.getElementById("info").style.display = "inline";
            centerDiv(document.getElementById("info"));
        }
            
        function closeInfo()
        {
            document.getElementById("info").style.display = "none";
        }
            
        function openNews(id_noutate)
        {
            document.getElementById("info_text").src = "about:blank";
            document.getElementById("info_text").src = "gettext.php?id_noutate=" + id_noutate;
            document.getElementById("info").style.left = parseInt((document.body.clientWidth - 790) / 2) + "px"; 
            document.getElementById("info").style.display = "inline";
            centerDiv(document.getElementById("info"));
        }
            
        function scrollInfoTop()
        {
            document.getElementById("info_text").contentWindow.scrollTop = 0;
        }
            
        
        function centerDiv(obj)
        {
			// First, determine how much the visitor has scrolled

            var scrolledX, scrolledY;
            if (window.pageYoffset)
            {
                scrolledX = window.pageXoffset;
                scrolledY = window.pageYoffset;
            }
            else if( document.documentElement && document.documentElement.scrollTop ) 
            {
                scrolledX = document.documentElement.scrollLeft;
                scrolledY = document.documentElement.scrollTop;
            }
            else if( document.body ) 
            {
                scrolledX = document.body.scrollLeft;
                scrolledY = document.body.scrollTop;
            }

            // Next, determine the coordinates of the center of browser's window

            var centerX, centerY;
            if (self.innerHeight)
            {
                centerX = self.innerWidth;
                centerY = self.innerHeight;
            }
            else if( document.documentElement && document.documentElement.clientHeight ) 
            {
                centerX = document.documentElement.clientWidth;
                centerY = document.documentElement.clientHeight;
            }
            else if( document.body ) 
            {
                centerX = document.body.clientWidth;
                centerY = document.body.clientHeight;
            }

            // Xwidth is the width of the div, Yheight is the height of the
            // div passed as arguments to the function:
            var leftoffset = scrolledX + (centerX - obj.offsetWidth) / 2;
            var topoffset = scrolledY + (centerY - obj.offsetHeight) / 2;
            // The initial width and height of the div can be set in the
            // style sheet with display:none; divid is passed as an argument to // the function
            var r = obj.style;
            r.position = 'absolute';
            r.top = topoffset + 'px';
            r.left = leftoffset + 'px';
            //r.display = "block";           
        }
        </script>
        <?
        echo "<div class='info' id='info' style='display: none'>";
        echo "<div style='background: url({$imagesroot}news_header.gif) top left no-repeat; width: 295px; height: 82px; float: left; clear: left; margin-bottom: 1.5em;'>&nbsp</div>";
        echo "<div style='width: 18px; height: 17px; float: right; clear: right; margin-right: 20px; margin-top: 20px;'>";
        echo "<a href='#peloc' class='link_inchide' onClick='closeInfo()'>&nbsp</a></div>";
        echo "<iframe class='text' id='info_text' frameborder='0'></iframe>";
        echo "</div>";
        ?>
        <div id='img_layer' style='vertical-align: middle'>
            <table style='background-color: #FFFFD4; width: auto; height: auto'><tr><td>
		        <img id='imagine' src='#' onLoad='afterImageLoad(this)' onClick='hideimage()'>
	        </td></tr></table>
	    </div>
	    <div id='loading_layer' style='vertical-align: middle'>
	        <p>Asteptați, se încarcă imaginea...</p>
	    </div>
	    <iframe name='img_frame' id='img_frame' style='display: none'></iframe>
        <? 
    }
    
    function gettextfromdb($id_articol)
    {
        $text = "<span class='articol'>";
        if (!$connected)
            $text .= 'Ne pare rău, dar momentan nu se poate accesa baza de date. Vă rugăm să reveniti.';
        else
        {
            if ($id_articol)
            {
                $q = mysql_query("SELECT * FROM articole WHERE id = $id_articol");
                if ($r = mysql_fetch_assoc($q))
                    $text .= $r['articol'];
                else
                    $text .= 'Ne pare rău, dar articolul solicitat de dumneavoastră nu mai există în baza de date.';
            }
        }
        $text .= "</span>";
        //$text = "cucu";
        return $text;//addslashes($text);
    }
?>
