// Clear input text and darken color on Sign Up form
	function clearAndColor(el) {
		if (el.defaultValue==el.value) el.value = ""
		if (el.style) el.style.color = "#222"
		}
    
// entire block link clickable		   
$(document).ready(function(){
						   
	$(".double li").click(function(){
    	window.location=$(this).find("a").attr("href");return false;
	});
	
	$(".blogDouble li").click(function(){
    	window.location=$(this).find("a").attr("href");return false;
	});
		
// fading nav
$(function() {
	// Add the divs to the list items - this way they're not in the actual markup
	$("#nav li a").append("<div class='navBackground'>");
	$("#nav li a").hover(function() {
		// Set the height so they're visible (this keeps them hidden if JS is disabled), then fade in
		$(this).children().css('height','51px').fadeTo(150,1.0);
	}, function() {
		$(this).children().fadeTo(300,0.0);
	});
});

// sliding links on hover
var fadeDuration = 100; //time in milliseconds
      
    $('.single li a').hover(function() {
        $(this).animate({ paddingLeft: '7px' }, fadeDuration)
        .animate({ paddingLeft: '4px' }, 50 );
      }, function() {
        $(this).animate({ paddingLeft: '0px' }, fadeDuration);
      });
     
    $('.double li').hover(function() {
        $(this).animate({ paddingLeft: '7px' }, fadeDuration)
        .animate({ paddingLeft: '4px' }, 50 );
      }, function() {
        $(this).animate({ paddingLeft: '0px' }, fadeDuration);
      });
      
    $('.shift').hover(function() {
        $(this).animate({ paddingLeft: '49px' }, fadeDuration)
        .animate({ paddingLeft: '46px' }, 50 );
      }, function() {
        $(this).animate({ paddingLeft: '0px' }, fadeDuration);
      });
      
      $('.blogSingle li a').hover(function() {
        $(this).animate({ paddingLeft: '19px' }, fadeDuration)
        .animate({ paddingLeft: '16px' }, 50 );
      }, function() {
        $(this).animate({ paddingLeft: '13px' }, fadeDuration);
      });
      
      $('.blogDouble li').hover(function() {
        $(this).animate({ paddingLeft: '7px' }, fadeDuration)
        .animate({ paddingLeft: '4px' }, 50 );
      }, function() {
        $(this).animate({ paddingLeft: '0px' }, fadeDuration);
      });
      
// dim sharing icons in footer with hover
    $('.footerMiddle ul li a').animate({ opacity: 0.7 }, 1);
    $('.footerMiddle ul li a').hover(function() {
        $(this).animate({ opacity: 1 }, 50);
      }, function() {
        $(this).animate({ opacity: 0.7 }, 50);
      });
      
     $('ul.awards li a').animate({ opacity: 0.7 }, 1);
    $('ul.awards li a').hover(function() {
        $(this).animate({ opacity: 1 }, 50);
      }, function() {
        $(this).animate({ opacity: 0.7 }, 50);
      });
      
// form fields
    $('.inputGeneral').focus(function() {
       $(this).parent('span').addClass("focusField");
   	}); 
   $('.inputGeneral').blur(function() {  
       $(this).parent('span').removeClass("focusField"); 
    });
    
    $('.contactTa').focus(function() {
       $(this).parent('span').addClass("focusFieldTextarea");
   	}); 
   $('.contactTa').blur(function() {  
       $(this).parent('span').removeClass("focusFieldTextarea"); 
    });
    
    $('.inputSearch').focus(function() {
       $(this).parent('span').addClass("focusField");
   	}); 
   $('.inputSearch').blur(function() {  
       $(this).parent('span').removeClass("focusField"); 
    });
    
     $('.inputBlog').focus(function() {
       $(this).parent('span').addClass("focusField");
   	}); 
   $('.inputBlog').blur(function() {  
       $(this).parent('span').removeClass("focusField"); 
    });
    
    $('.blogTa').focus(function() {
       $(this).parent('span').addClass("focusFieldTextarea");
   	}); 
   $('.blogTa').blur(function() {  
       $(this).parent('span').removeClass("focusFieldTextarea"); 
    });
    
// "more" and "less" toggle for blog archives in right sidebar
	
	  	$(".archives-list li").addClass('hide');
	  	$(".archives-list li.more").removeClass('hide');
	  	$(".archives-list li").eq(0).removeClass('hide');
	  	$(".archives-list li").eq(1).removeClass('hide');
	    $(".archives-list li").eq(2).removeClass('hide');
	    $(".archives-list li").eq(3).removeClass('hide');
		$(".archives-list li").eq(4).removeClass('hide');
	$(".archives-list li.more a").toggle(function(){
  	    $(this).parent().parent().find('li').removeClass('hide');
  	    $(this).html('Less...');
	},function(){
  	    $(this).parent().parent().find('li').addClass('hide');
  	    $(".archives-list li.more").removeClass('hide');
        $(".archives-list li").eq(0).removeClass('hide');
        $(".archives-list li").eq(1).removeClass('hide');
        $(".archives-list li").eq(2).removeClass('hide');
        $(".archives-list li").eq(3).removeClass('hide');
        $(".archives-list li").eq(4).removeClass('hide');
  	    $(this).html('More...');
  	});

});
// end jQuery







//newsletter form...
var xmlHttp
function news() {
    xmlHttp = GetXmlHttpObject();
    if (xmlHttp == null) {
        alert("Your browser does not support AJAX!");
        return;
    } else {

        obj = document.getElementById('frmNewsletter');
        var getstr = "?";
        for (i = 0; i < obj.getElementsByTagName("input").length; i++) {
            //alert(obj.getElementsByTagName("input")[i].tagName);
            if (obj.getElementsByTagName("input")[i].name == "email") {
                getstr += obj.getElementsByTagName("input")[i].name + "=" + encodeURIComponent(obj.getElementsByTagName("input")[i].value) + "&";
            }
        }

        inID = "frmNewsletter";
        inProcessing = "";
        var url = "newsletter.asp" + getstr + "sid=" + Math.random();
        xmlHttp.onreadystatechange = stateChanged;
        xmlHttp.open("GET", url, true);
        xmlHttp.send(null);

    }
};


function stateChanged() {
    var setID = document.getElementById(inID);
    if (xmlHttp.readyState == 4) {
        setID.innerHTML = xmlHttp.responseText;
    } else {
        setID.innerHTML = inProcessing;
    }
}

function GetXmlHttpObject() {
    var xmlHttp = null;
    try
  { xmlHttp = new XMLHttpRequest(); }
    catch (e) {
        try
    { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); }
        catch (e)
    { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); }
    }
    return xmlHttp;
}