$(function() {
	var firstpos = $('ul.nav li.first').position().left;
	var parent = $('ul.nav li');
	
	parent.each(function() { 
		 if (($(this).position().left - firstpos + 250)>=960) {
			$(this).addClass('edge');
		 };
		 
		 $(this).has('ul').addClass('parent');
	});


$(".carsl .jCarouselLite").jCarouselLite({
    btnNext: ".nextt",
    btnPrev: ".prevv",
    visible: 1,
    speed: 500,
	auto: 4000
});

$(".carousel").dualSlider({


				autoDelay: 6000,

				durationCarousel: 1000,

				durationDetails: 600

			});



			
var quickmenu = $('#quickMenu');
var bod = $('body');

$("#openMenu").click(function()
    {
        quickmenu.animate({opacity: 'show', height: 'show'}, 'slow', 'easeOutCirc'); 
		bod.addClass('qm');
        return false;
    });

	quickmenu.click(function(e) { 
	  	e.stopPropagation();
	 
	 })

	$("#closeMenu").click(function()
    {
        quickmenu.animate({opacity: 'hide', height: 'hide'}, 'slow', 'easeOutCirc'); 
		bod.removeClass('qm');
        return false;
    });
	
	$(".qm").live('click',function()
	{
		quickmenu.animate({opacity: 'hide', height: 'hide'}, 'slow', 'easeOutCirc'); 
		bod.removeClass('qm');
	});
	
    $.each($('h1, h2, h3, h4, h5, h6'), function(){
        if($(this).text().charAt(($(this).text().length)-1).match(RegExp("\\W"))){ 
            $(this).addClass('no-pn');
        }
    }); 
   
   $("#subscribe").focus(function(){
		if ($(this).val() === "Email Address...") {
			$(this).val("");
			$(this).css("color","#333");
		}
	}).blur(function(){
		if ($(this).val() === "") {
			$(this).val("Email Address...");
			$(this).css("color","#999");
		}
	}).val("Email Address...");
	
	$('h1,h2,h3,h4,h5,h6,div.subnav,div.features,div.uppercontent')
    .filter(function() {
        return $.trim($(this).text()) === ''  && $(this).children().length == 0
    })
    .remove()
});
	
	
