/* Author: PouipouiDesign - 11/10 */

/* FUNCTIONS ON ALL PAGES */
function myInitPages() {
	// smooth scroll to top
	$('#toTop').live('click', function () {
		jQuery('html, body').animate({scrollTop:0}, 'slow');
		return false;
	});
}


/* FUNCTION ON ESTIMATES PAGE */
function cloneContactPush() {
	$('#contactPush').clone().addClass('devis').insertAfter('#container');
	$('#contactPush.devis h1').removeClass('visuallyhidden');
	$('#contactPush.devis ul').wrap('<div class="innerContact"><div class="clearfix"></div></div>');
}


/* FUNCTION ON REFERENCE DETAIL PAGE */
function englishRef() {
	$('.enPost').before('<p class="enToggle">English Description</p>').hide();
	$('.enToggle').live('click', function () {
		$('.enPost').slideToggle();
		$(this).toggleClass('active');
	});
}





/* Only initialize functions for all pages if needed */
jQuery(document).ready(function() {

	initMyInitPages = myInitPages();
	
	// Estimates page
	if ($('body').attr('class') == 'devis') { cloneContactPush(); }
	
	// References page
	if ($('body').hasClass('ref-det')) { englishRef(); }
	
	/* Check we're in IE6 or 7 - see the conditional comments in the <body> */
    if ($(".ie6, .ie7").length > 0) {
        imgResizer();
        $(window).resize(function(){
            imgResizer();
        });
    }

});










