function slidethingy1 () {	
	
	$("li#slide2").css("display", "block");
	$("li#slide2").show("slide", { direction: "up" }, 800);
	$("li#slide2").height($("li#slide2").height());

}
function about_down (){
	$("div#about_down").css("display", "block");
	$("div#about_down").show("blind", { direction: "vertical" }, 1000);
	$("div#contact_down").hide();
}
function about_bye (){
	$("div#about_down").hide("blind", { direction: "vertical" }, 1000);
}
function contact_down (){
	$("div#contact_down").css("display", "block");
	$("div#contact_down").show("blind", { direction: "vertical" }, 1000);
	$("div#about_down").hide();
}
function contact_bye (){
	$("div#contact_down").hide("blind", { direction: "vertical" }, 1000);
}
function sample_down (){
	$("div#sample_down").show("blind", { direction: "vertical" }, 1000);
	$("div#contact_down").hide();
	$("div#about_down").hide();
}
function sample_bye (){
	$("div#sample_down").hide("blind", { direction: "vertical" }, 1000);
}



$(document).ready(function() {

    var slideLI = document.createElement("li");
    slideLI.setAttribute("class", "slide2");
    slideLI.setAttribute("id", "slide2");
    $('li.selectedtab ~ li.childitem1').wrapAll(slideLI).wrapAll(document.createElement("ul"));
    var dropdown = $('li.selectedtab ~ li.slide2');

    dropdown.hide();


    $("div#about_down").hide();
    $("div#contact_down").hide();
    $("div#sample_down").hide();
    function filterPath(string) {
        return string
 		.replace(/^\//, '')
 		.replace(/(index|default).[a-zA-Z]{3,4}$/, '')
 		.replace(/\/$/, '');
    }
    var locationPath = filterPath(location.pathname);

    $('li.slide2 a').each(function() {
        var thisPath = filterPath(this.pathname) || locationPath;
        //alert(thisPath);
        thisPath = thisPath.replace(locationPath, "");
        thisPath = thisPath.replace("/", "#");
        $(this).attr("href", thisPath);
        $(this).click(function(event) {
            event.preventDefault();
            var $target = $(this.hash), target = this.hash;
            var targetOffset = $target.offset().top;
            $('html, body').animate({ scrollTop: targetOffset }, 1000, function() {
                location.hash = target;
            });
            });
    });
    setTimeout("slidethingy1()", 1000);

    //Automatically Check AddToMailList checkboxes
    $('input[type="checkbox"]').each(function(){
        var id = $(this).attr("id");
        if (id.indexOf('AddToMailingList') != -1)
        {
            $(this).attr("checked",true);
        }
    });
});