
jQuery.noConflict();
i = 0;
ip = 0;

jQuery(document).ready(function() {

	jQuery('#enq3-renewaldate').datepicker();
    	jQuery('#news_main_right ul li').eq(3).css('background-image','none');

jQuery.each(jQuery.browser, function(i, val) {
  if(i=="mozilla" && jQuery.browser.version.substr(0,3)=="1.9")
    	jQuery('#news_main_right ul li').eq(3).css('padding-bottom','9px');
	
});

pn = jQuery('#enq1-name').attr('value');
if(jQuery(pn).length > 0  ){
jQuery('#enq1-name').attr('value','Name');
}



if(jQuery('#product_brown .error_feedback li').length > 0  ){
	jQuery('#product_info').hide();
	jQuery('#product').hide();
	jQuery('#testimonials').hide();
	jQuery('#product_brown').show();
}

if(jQuery('h1.special').length > 0  ){
	jQuery('#product_info').hide();
	jQuery('#product').hide();
	jQuery('#testimonials').hide();
	jQuery('#product_brown').show();
}

namet = jQuery('#enq1-name').val();

clickname = false;

jQuery('#enq1-name').click( function() { 

if((namet == "Name")&&(clickname == false)){

	jQuery('#enq1-name').attr('value',''); 
clickname = true;

}
	
	
	} 

);




pe = jQuery('#enq1-email').attr('value');
if(jQuery(pe).length > 0  ){
jQuery('#enq1-email').attr('value','Email');
}
clickpostedemail = false;
jQuery('#enq1-email').click( function() { 


if(clickpostedemail == false){

jQuery('#enq1-email').attr('value',''); 

clickpostedemail = true;	

}

});

pp = jQuery('#enq1-phone').attr('value');
if(jQuery(pp).length > 0  ){
	jQuery('#enq1-phone').attr('value','Tel');
}
posphone = false;	
jQuery('#enq1-phone').click( function() { 
if(posphone == false){

jQuery('#enq1-phone').attr('value',''); 
 posphone = true;
}
} );

jQuery('#gallery h1 form select').show();
jQuery('.request_a_quote').hover(function(){
jQuery(this).find('img').attr('src','/images/moorhouse_x_broker_roll.jpg');

},function(){
jQuery(this).find('img').attr('src','/images/moorhouse_x_broker.jpg');

});
jQuery('.brands').hover(function(){
jQuery(this).find('img').attr('src','/images/moorhouse_brands_roll.jpg');

},function(){

jQuery(this).find('img').attr('src','/images/moorhouse_brands.jpg');
});
jQuery('.construction').hover(function(){
jQuery(this).find('img').attr('src','/images/logo_constructaquote_h.gif');

},function(){
jQuery(this).find('img').attr('src','/images/logo_constructaquote.gif');

});

jQuery('#posted button').hover(function(){

jQuery(this).find('img').attr('src','/images/tick_hover.gif');



},function(){


jQuery(this).find('img').attr('src','/images/tick.gif');


});


jQuery('#we_call_you button').hover(function(){

jQuery(this).find('img').attr('src','/images/tick_hover.gif');



},function(){


jQuery(this).find('img').attr('src','/images/tick.gif');


});

jQuery('.product_button').hover(function(){

jQuery(this).find('img').attr('src','/images/go_prod_hover.gif');



},function(){


jQuery(this).find('img').attr('src','/images/go_prod.gif');


});

jQuery('#quoter').hover(function(){

jQuery(this).find('img').attr('src','/images/get_a_quote_hover.gif');



},function(){


jQuery(this).find('img').attr('src','/images/get_a_quote.gif');


});

jQuery('a#quote').hover(function(){

jQuery(this).attr('style','background:url(/images/get_a_quote_hover.jpg) no-repeat;');


},function(){


jQuery(this).attr('style','background:url(/images/get_a_quote.jpg) no-repeat;');


});

jQuery('#quote').click(function(){
	if(jQuery(this).attr('href') == '#nogo'){	
	jQuery('#product_info').hide();
	jQuery('#product').hide();
	jQuery('#testimonials').hide();
	jQuery('#product_brown').show();
}

});

jQuery('#product #link a').click(function(){
	if(jQuery(this).attr('href') == '#nogo'){	
	jQuery('#product_info').hide();
	jQuery('#product').hide();
	jQuery('#testimonials').hide();
	jQuery('#product_brown').show();
}

});

jQuery('#quoter').click(function(){
if(jQuery(this).attr('href') == '#nogo'){		
	jQuery('#product_info').hide();
	jQuery('#product').hide();
	jQuery('#testimonials').hide();
	jQuery('#product_brown').show();
}

});
jQuery('#insurance_product').click(function(){

if(jQuery(this).attr('href') == '#nogo'){	
	
	jQuery('#product_info').show();
	jQuery('#product').show();
	jQuery('#testimonials').show();
	jQuery('#product_brown').hide();


}

});
jQuery('#gal').change( function() {

test = jQuery(this).attr('value');

window.location = test;
	

});
newslist = jQuery('#news_main_right li');
newsimglist = jQuery('#news_main_left li');
intrem = '#news_main_right';
		//construction method for news ids handy
    for( var ip = 0, n = newslist.length;  ip < n;  ++ip ) {
		//eq means position in list
      jQuery(newslist).eq(ip).attr('id','newsart'+ip);
			jQuery(newsimglist).eq(ip).attr('id','news_img'+ip);
		}
		
	 jQuery(newslist).each(
	 
		function(){
		  
			jQuery(this).click(function(){

			ikey = jQuery(this).attr('id');
			
			          window.location = jQuery("#"+ikey+" a").attr('href');
								
			 }); 
	if(jQuery(this).attr('class') == 'selected_news'){
		jQuery(this).mouseover( function() {ikey2 = jQuery(this).attr('id'); if("newsart"+i  == ikey2){}else{  jQuery("#"+ikey2).addClass("selected_newse");} } );
		jQuery(this).mouseout( function() {ikey2 = jQuery(this).attr('id'); if("newsart"+i == ikey2){}else{  jQuery("#"+ikey2).removeClass("selected_newse");} } );
	}else{
	jQuery(this).mouseover( function() {ikey2 = jQuery(this).attr('id'); if("newsart"+i  == ikey2){}else{  jQuery("#"+ikey2).addClass("selected_newse");} } );
	jQuery(this).mouseout( function() {ikey2 = jQuery(this).attr('id'); if("newsart"+i == ikey2){}else{  jQuery("#"+ikey2).removeClass("selected_newse");} } );


	}
	
 });
});


intremq = "#newsart";
ld= "#news_img";
displayTime = 15; 
displayTimeset = 15;
    countDown = function(message){
        displayTime--; 
		      if (displayTime == 1){
					jQuery(intremq+i).removeClass("selected_news");
					jQuery(ld+i).hide();
					if (i == 3){
					i=0;
					}else{
					i++;
					}
					displayTime = displayTimeset;
					jQuery(intremq+i).removeClass("selected_newse");
					jQuery(intremq+i).addClass("selected_news");
					jQuery(ld+i).fadeIn();

				}





} 
    timer = setInterval(countDown, 400);

function localwind(id1,id2){

}