$(document).ready(function() {
	get_red1();
	slide_tip();
	helps();
	if(screen.width<=1280){
	showHide();
	toggleHide();
	pkShow();	
	}
});

function get_red1(){
	$(".sub-col input:checkbox").each(function(){
			if($(this).attr("checked")==true){

				$(this).parent().addClass("red1");
			}											   
		$(this).click(function(){
			if($(this).attr("checked")==true){

				$(this).parent().addClass("red1");
			}
			else{ $(this).parent().removeClass("red1");

			}
		})

	})
}

function slide_tip(){
	var s = document.body.offsetWidth;
	if(s<1030){$(".comparebox").css("left","910px")};
	
	$(".pk").each(function del_tip(){
		$(this).click(function(){
			$(".phone i:first").fadeIn();
			$(".phone span a").hover(function(){$(this).prev().fadeOut();})
		});
	});
	
	
}

function helps(){
	$(".help-i").click(function(){
		if( $(".help").css("display") == "none"){						
			$(".help").show("fast");
		}
		else{
			$(".help").hide("fast");
		}
	})
	
	$("em.close").click(function(){
		$(".help").hide("fast");						 
	})
}
function toggleHide(){
			$("#togglebox").animate({width:"5"},"fast");
			$(".comparebox").animate({left:"+=60"},"fast");
			$(".compare img").hide();
			$(".pk-toggle em").removeClass("on");
			return false;
		}

function showHide(){
	$(".pk-toggle").click(function(){
		if($(".comparebox").width()<60){
			$("#togglebox").animate({width:"68"},"fast");
			$(".comparebox").animate({left:"-=60"},"fast");
			$(".compare img").show();
			$(".pk-toggle em").addClass("on");
		}
		else{
			$("#togglebox").animate({width:"5"},"fast");
			$(".comparebox").animate({left:"+=60"},"fast");
			$(".compare img").hide();
			$(".pk-toggle em").removeClass("on");
		}
	})
}

function pkShow(){
		if($(".comparebox").width()<60){	
			$("#togglebox").animate({width:"68"},"fast");
			$(".comparebox").animate({left:"-=60"},"fast");
			$(".compare img").show();
			$(".pk-toggle em").addClass("on");
			return false;			
		}

}







