// <!-- <![CDATA[

// Project: Dynamic Date Selector (DtTvB) - 2006-03-16
// Script featured on JavaScript Kit- http://www.javascriptkit.com
// Code begin...
// Set the initial date.
var ds_i_date = new Date();
ds_c_month = ds_i_date.getMonth() + 1;
ds_c_year = ds_i_date.getFullYear();

// Get Element By Id
function ds_getel(id) {
	return document.getElementById(id);
}

// Get the left and the top of the element.
function ds_getleft(el) {
	var tmp = el.offsetLeft;
	el = el.offsetParent
	while(el) {
		tmp += el.offsetLeft;
		el = el.offsetParent;
	}
	return tmp;
}
function ds_gettop(el) {
	var tmp = el.offsetTop;
	el = el.offsetParent
	while(el) {
		tmp += el.offsetTop;
		el = el.offsetParent;
	}
	return tmp;
}

// Output Element
var ds_oe = ds_getel('ds_calclass');

// Container
var ds_ce = ds_getel('ds_conclass');

// Output Buffering
var ds_ob = ''; 
function ds_ob_clean() {
	ds_ob = '';
}
function ds_ob_flush() {
	ds_oe.innerHTML = ds_ob;
	ds_ob_clean();
}
function ds_echo(t) {
	ds_ob += t;
}

var ds_element; // Text Element...


// Mettre ici les sous menus
function ds_template_main_above(rubrique) {
if(rubrique=='produits')
	return '<table class="ds_tbl" width="150" cellpadding="0" cellspacing="0">'
	     + '<tr>'
		 + '<td  id="ssmenu1" height="20" class="ds_head" style="cursor: pointer" onclick="location.href=\'produitsinfo.php\';ds_hi();" onmouseover="ChangeSousMenu(this);" onmouseout="RemetSousMenu(this);">Informatique</td></tr><tr>'
		 + '<td  id="ssmenu2" height="20" class="ds_head" style="cursor: pointer" onclick="location.href=\'produitsmanuel.php\';ds_hi();" onmouseover="ChangeSousMenu(this);" onmouseout="RemetSousMenu(this);">Manuels</td></tr><tr>'
		 + '<td  id="ssmenu3" height="20" class="ds_head" style="cursor: pointer" onclick="location.href=\'produitsprev.php\';ds_hi();" onmouseover="ChangeSousMenu(this);" onmouseout="RemetSousMenu(this);">Cartes Murales</td></tr><tr>'
		 + '<td  id="ssmenu4" height="20" class="ds_head" style="cursor: pointer" onclick="location.href=\'produitsprev.php\';ds_hi();" onmouseover="ChangeSousMenu(this);" onmouseout="RemetSousMenu(this);">Ordre de réparation</td></tr></table>';

if(rubrique=='vehicule')
	return '<table class="ds_tbl" width="150" cellpadding="0" cellspacing="0">'
	     + '<tr>'
		 + '<td  id="ssmenu1" height="20" class="ds_head" style="cursor: pointer" onclick="location.href=\'truck.php\';ds_hi();" onmouseover="ChangeSousMenu(this);" onmouseout="RemetSousMenu(this);">Poids lourds</td></tr><tr>'
		 + '<td  id="ssmenu2" height="20" class="ds_head" style="cursor: pointer" onclick="location.href=\'auto.php\';ds_hi();" onmouseover="ChangeSousMenu(this);" onmouseout="RemetSousMenu(this);">Automobiles</td></tr><tr>'
		 + '<td  id="ssmenu3" height="20" class="ds_head" style="cursor: pointer" onclick="location.href=\'moto.php\';ds_hi();" onmouseover="ChangeSousMenu(this);" onmouseout="RemetSousMenu(this);">2 roues</td></tr></table>';
		 
		 
if(rubrique=='societe')
return '<table class="ds_tbl" width="150" cellpadding="0" cellspacing="0">'
	     + '<tr><td height="20" class="ds_head" style="cursor: pointer" onclick="location.href=\'contact.php\';ds_hi();" onmouseover="ChangeSousMenu(this);" onmouseout="RemetSousMenu(this);">Nous contacter</td></tr></table>';
	
		
}


function ChangeSousMenu(thisid)
{
thisid.style.color='#ffffff';
thisid.style.backgroundImage="url('images/couleursousmenu_clair.jpg')"; 
}

function RemetSousMenu(thisid)
{
thisid.style.color='#ffffff';
thisid.style.backgroundImage="url('images/couleursousmenu.jpg')"; 


}


// This one draws calendar...
function ds_draw_calendar(rubrique) {
	// First clean the output buffer.
	ds_ob_clean();
	// Here we go, do the header
	ds_echo (ds_template_main_above(rubrique));
	ds_ob_flush();
	// Scroll it into view.
	//ds_ce.scrollIntoView();
}

// A function to show the calendar.
// When user click on the date, it will set the content of t.
function ds_sh(t,rubrique) {
	// Set the element to set...
	ds_element = t;
	// Draw the calendar
	ds_draw_calendar(rubrique);
	// To change the position properly, we must show it first.
	ds_ce.style.display = '';
	// Move the calendar container!
	the_left = ds_getleft(t);
	the_top = ds_gettop(t) + t.offsetHeight +1;
	ds_ce.style.left = the_left + 'px';
	ds_ce.style.top = the_top + 'px';
	// Scroll it into view.
	//ds_ce.scrollIntoView();
}

// Hide the calendar.
function ds_hi() {
	ds_ce.style.display = 'none';
}

function ds_block() {
	ds_ce.style.display = 'block';
}


// Moves to the next month...

// And here is the end.

// ]]> -->
