$(document).ready(function(){
	var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
	var is_explorer = navigator.userAgent.toLowerCase().indexOf('msie') > -1;
	
	if(is_chrome || is_explorer){
		//(':header, .button, #navigationPrimary a').css('font-family','"PTN", "Arial Narrow", "Helvetica Condensed", Verdana, Geneva, sans-serif');
	};
	if(is_explorer){
		$('.button, label input, label textarea, label select, form #submit').corner('4px');
	};
	
	$('.bucket>:last-child').css('margin-bottom','0');
	
	$('#sidebarLeft>:last-child, #sidebarRight>:last-child').not('#logo a').css('background-image','none');
	
	$('.t-sub #sidebarRight').css('margin-top',$('#content h1:first').height()+20);
	
	$('#breadcrumb li:first-child a').attr('href','/');
	$('#breadcrumb li:first-child a:contains("Help Now")').html('Home');
	$('#breadcrumb li:first-child a:contains("Site")').html('Home');
	
	$('img.photo').each(function(){
		if($(this).css('float')=="right"){
			$(this).addClass('right')
		}
		if($(this).css('float')=="left"){
			$(this).addClass('left')
		}
	});
	
	$("#contactForm").validate({
		messages: {
			state: "Required"
		}
	});	
	
	$('.testimonial').each(function(){		
		if($(this).parent().hasClass('testimonialWrap').toString()=="false"){
			$(this).nextUntil(':not(.testimonial)').andSelf().wrapAll('<div' + ' ' + 'class="testimonialWrap">');
		}
	});
	
	$('.accordionTitle').each(function(){
		$(this).nextUntil(':not(.accordionContent)').andSelf().wrapAll('<div' + ' ' + 'class="accordion">');
	})
	
	$('.accordionTitle').toggle(function(){
		if($.browser.msie&&(parseInt(jQuery.browser.version)<=8)){
			$(this).siblings('.accordionBody').show();	
		}else{
			$(this).siblings('.accordionBody').slideDown(600,'swing');
		}
		//$(this).css('background-image','url(/images/icon_toggle_down.png)')
		//return false;
	},function(){
		if($.browser.msie&&(parseInt(jQuery.browser.version)<=8)){
			$(this).siblings('.accordionBody').hide();
		}else{
			$(this).siblings('.accordionBody').slideUp(600,'swing');
		}
		//$(this).css('background-image','url(/images/icon_toggle_up.png)')
		//return false;
	});
	
	$('.accordion').each(function(){
		$(this).children('.accordionContent').wrapAll('<div' + ' ' + 'class="accordionBody">');
	});
	$('.accordionBody').slideUp(1);
});
