jQuery(document).ready(function() {
    initCufon();
    
    jQuery("#pageflip").hover(function() { 
        jQuery("#pageflip img , .msg_block").stop()
                .animate({ 
                        width: '473px',
                        height: '463px'
                        
                }, 500);
        } , function() {
        jQuery("#pageflip img").stop()
                .animate({
                        width: '125px',
                        height: '125px'
                }, 220);
        jQuery(".msg_block").stop() 
                .animate({
                        width: '125px',
                        height: '120px'
                }, 200); 
    });
    
});


function initCufon() {
    Cufon.set('fontFamily', 'snotour');
    Cufon.replace('#slideshow #slidesong li h3');
    Cufon.replace('#eadv')('#eadv1')('#nav ul li a')('#main-l #main-moteur h2')('#main-l #main-map h2')('#engasno h2')('#affinage h2');
    Cufon.replace('#nav ul .glow a');
    Cufon.replace('#toptensta h2')('.sblocinfo h2')('#ft-agence h5');
    Cufon.replace('.ftbtn .ftbttxt')('#ft-brochures h5')('#ft-news h5')('#selectionsno h2')('#aide h2');
    Cufon.replace('.mrproduit .rspinfosheb .rspinfoshebl li a strong')('ul.rspinfoshebl li strong')('.mrproduit .rspinfosheb .rspinfoshebar .rspinfosresid li strong');
    Cufon.replace('#pdetail #ong li a')('#pdetail #ongbot li a')('#ongcontent .pinfoshebar .pinfosresid li strong');
    Cufon.replace('#pdevis h2')('#ongcontent .descgstation .descl .ptmap strong');
    Cufon.replace('#pdetail #ong li a.on')('#pdetail #ongbot li a.on');
    Cufon.replace('h2.process')('.logb h1')('#slideshowlog #slidesong li h3')('.font_snotour');
    Cufon.replace('.inst h1')('#menuinstit a')('#menuinstit div');

}

function getURLParam()
{
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
 
for(var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
 
return vars;
}

function getCalendar_Calendar1()
{
	var oCalendar = $('Calendar_Frame_Calendar1');
	if(oCalendar)
	{
		if(oCalendar.style.display=="none" || oCalendar.style.display=="")
		{
			var date = $$('input.date2cal')[0].value;
			var src = oCalendar.src;
			var reg = new RegExp("&today=.*$", "g");
			src = src.replace(reg,"");
			src = src + '&today=' + date;
			oCalendar.src = src;
			oCalendar.style.display = "block";
		}
		else
			oCalendar.style.display = "none";
	}
}
