﻿
var stwFormRecipientCount = 1;

function setup_navigation( wlrOpen ){

	if ( $("#stWhatisNav").length > 0 ) {
		$("#stWhatisNav").hover(function(){
			$(this).addClass('stWhatisNav-hover');
		},function(){
			$(this).removeClass('stWhatisNav-hover');
		});

		$("#stWhatisNav").click(function(){
			window.location = 'WhatIsStayTrue.aspx';
		});
	}

	if ( $("#stWhatsYourNav").length > 0 ) {
		$("#stWhatsYourNav").hover(function(){
			$(this).addClass('stWhatsYourNav-hover');
		},function(){
			$(this).removeClass('stWhatsYourNav-hover');
		});

		$("#stWhatsYourNav").click(function(){
			window.location = 'WhatsYourBioTherapie.aspx';
		});
	}
	
	if ( $("#stSpreadNav").length > 0 ) {
		$("#stSpreadNav").hover(function(){
			$(this).addClass('stSpreadNav-hover');
		},function(){
			$(this).removeClass('stSpreadNav-hover');
		});

		$("#stSpreadNav").click(function(){
			window.location = 'SpreadTheWord.aspx';
		});
	}

	if ( $("#stConnectedNav").length > 0 ) {
		$("#stConnectedNav").hover(function(){
			$(this).addClass('stConnectedNav-hover');
		},function(){
			$(this).removeClass('stConnectedNav-hover');
		});

		$("#stConnectedNav").click(function(){
			window.location = 'StayConnected.aspx';
		});
	}

	setup_wlr_widget( wlrOpen );
}

function wlr_widget_hover( flag ){
	if( flag ){
		$("#stWLRNavTop").addClass('stWLRNavTop-hover');
		$("#stWLRNavExp").addClass('stWLRNavExp-hover');
		$("#stWLRNavBot").addClass('stWLRNavBot-hover');
	}else{
		$("#stWLRNavTop").removeClass('stWLRNavTop-hover');
		$("#stWLRNavExp").removeClass('stWLRNavExp-hover');
		$("#stWLRNavBot").removeClass('stWLRNavBot-hover');
	}
}

function setup_wlr_widget( wlrOpen ){
    $("#stWLRNavWidget").hoverIntent(function() {
		wlr_widget_hover( true );
		if( wlrOpen == false ){
			$("#stWLRNavExp").animate(
				{
					height: "116px"
				},
				400
			);
		}
	},function(){
		if( wlrOpen == false ){
			$("#stWLRNavExp").animate(
				{
					height: "1px"
				},
				400
			);	
		}
		wlr_widget_hover( false );
	});

	if( wlrOpen ){
		$("#stWLRNavExp").height("116px");
	}

	$("#stWLRNavWidget").click(function(){
		window.location = 'WatchLaughRepeat.aspx';
	});
}

function setup_home(){

	$("#staytrueHomeLogo").hide();
	$("#biolageHomeLogo").hide();

	swfobject.embedSWF(
		"support/swf/gallery.swf", 
		"homeFlashPrimer", 
		"935", 
		"649", 
		"9.0.0",
		false,
		{
		    xmlURL: "support/xml/gallery.xml"
		},
		{
			wmode: "opaque",
			allowScriptAccess: "always"
		},
		false
	);

	if ( $("#shHomeDontBite").length > 0 ) {
		$("#shHomeDontBite").click(function(){
			window.location = 'WhatIsStayTrue.aspx';
		});
	}

	$("#stBody").addClass('stHome-body-adjust');
	$("#stPrimer").addClass('stHome-primer-adjust');

	show_topreasons();

	return true;
}

function setup_whatis(){
	$("#stPrimer").addClass('stWhatIs-primer-adjust');
	
	if ( $("#whatIsContentSpreadSendButton").length > 0 ) {
		$("#whatIsContentSpreadSendButton").hover(function(){
			$(this).addClass('whatIsContentSpreadSendButton-hover');
		},function(){
			$(this).removeClass('whatIsContentSpreadSendButton-hover');
		});
		
		$("#whatIsContentSpreadSendButton").click(function(){
			// alert("Send to friend");
		    window.location = 'SpreadTheWord.aspx';
		});
	}

	if ( $("#whatIsContentExposedWatchButton").length > 0 ) {
		$("#whatIsContentExposedWatchButton").hover(function(){
			$(this).addClass('whatIsContentExposedWatchButton-hover');
		},function(){
			$(this).removeClass('whatIsContentExposedWatchButton-hover');
		});
		
		$("#whatIsContentExposedWatchButton").click(function(){
			window.location = 'Investigative.aspx';
		});
	}	
	
	$("#stWhatisNav").addClass('stWhatisNav-down');
	show_topreasons();
}

function spreadtheword_add_recipient() {
    var buf;
    if (stwFormRecipientCount < 5) {
        buf = "#swtForm-recipient-" + (stwFormRecipientCount + 1);
        $(buf).removeClass("hidethis");
        stwFormRecipientCount = stwFormRecipientCount + 1;
    }

    if (stwFormRecipientCount == 5) {
        $("#stwForm-addanother").addClass("hidethis");
    }
}

function spreadtheword_go_salon() {
    $(".swtFormNormalVersion").addClass("hidethis");
    $(".swtFormSalonVersion").removeClass("hidethis");
}

function spreadtheword_go_normal(){
    $(".swtFormNormalVersion").removeClass("hidethis");
    $(".swtFormSalonVersion").addClass("hidethis");
}

function spreadtheword_simplethanks() {
    //tb_remove();
    tb_show("Thank You", "forms/ThankYou.aspx?TB_iframe=true&width=580&height=250&modal=true", false);
}

function sharevideo_simplethanks() {
    //tb_remove();
    tb_show("Thank You", "forms/ShareVideo_ThankYou.aspx?TB_iframe=true&width=580&height=250&modal=true", false);
}

function spreadtheword_offersample() {
    //tb_remove();
    $.cookie('sender_name', $("#stwForm_sourcename").val());
    $.cookie('sender_email', $("#stwForm_sourceemail").val());
    tb_show("Thank You", "forms/FreeSampleSignup.aspx?TB_iframe=true&height=605&width=713&modal=true", false);
}

function showloading() {
    //tb_remove();
    tb_show("Thank You", "forms/ThankYou.aspx?TB_iframe=true&width=300&height=200&modal=true", false);
}

function spreadtheword_submit() {
    var ajaxurl = "";
    var salonflag = $("#stwForm_iwork").attr('checked');

    tb_remove();

    $.cookie('sender_name', $("#stwForm_sourcename").val());
    $.cookie('recipient_name', $("#stwForm_destinationname_1").val());
    $.cookie('sender_message', $("#stwForm_messaging").val());
    if ( salonflag ) {
        ajaxurl = "services/Submit_SalonToClient.aspx";
    } else {
        ajaxurl = "services/Submit_ClientToClient.aspx";
    }

    var data = $("#aspnetForm")
                .find("input,textarea,select,hidden")
                .not("#__VIEWSTATE,#__EVENTVALIDATION")
                .serialize();

    $.ajax({
        type: "POST",
        url: ajaxurl,
        data: data,
        dataType: "xml",
        success: function(xml) {
            if (salonflag) {
                spreadtheword_simplethanks();
            } else {
                spreadtheword_offersample();
            }
        },
        error: function(XMLHttpRequest, textStatus, errorThrown) {
            //alert("Boo! - " + XMLHttpRequest.statusText + " - " + textStatus + " - " + errorThrown);
        }
    });
}

function has_value(id) {
    if ($(id).val().length > 0) {
        return true;
    } else {
        return false;
    }
}

function setup_spreadtheword(){
	$("#stPrimer").addClass('stSpreadTheWord-primer-adjust');

    // in case we hit this page with some saved state (back button and so on )
    if ($("#stwForm_iwork").attr('checked')) {
        spreadtheword_go_salon();
    }

    // and now wire it up for the future
	if ($("#stwForm_iwork").length > 0) {
	    $("#stwForm_iwork").click(function() {
	        if (this.checked) {
	            spreadtheword_go_salon();
	        } else {
                spreadtheword_go_normal();
	        }
	    });
	}

	if ( $("#stwForm-send").length > 0 ) {
		$("#stwForm-send").hover(function() {
		    $(this).addClass('stwForm-send-hover');
		}, function() {
		    $(this).removeClass('stwForm-send-hover');
		});

		$("#stwForm-send").click(function() {
		    $("#aspnetForm").submit();
		});
	}	

	if ( $("#stwForm-preview").length > 0 ) {
		$("#stwForm-preview").hover(function(){
			$(this).addClass('stwForm-preview-hover');
		},function(){
			$(this).removeClass('stwForm-preview-hover');
		});

		$("#stwForm-preview").click(function() {
		    if ($("#aspnetForm").valid()) {
		        $.cookie('sender_name', $("#stwForm_sourcename").val());
		        $.cookie('recipient_name', $("#stwForm_destinationname_1").val());
		        $.cookie('sender_message', $("#stwForm_messaging").val());
		        if ($("#stwForm_iwork").attr('checked')) {
		            tb_show("Preview", "forms/SalonToClientPreview.aspx?TB_iframe=true&height=615&width=610&modal=true", false);
		        } else {
		            tb_show("Preview", "forms/ClientToClientPreview.aspx?TB_iframe=true&height=615&width=610&modal=true", false);
		        }   
		    }
		});
	}	
	
	if ( $("#stwForm-addanother").length > 0 ) {
		$("#stwForm-addanother").click(function(){
			spreadtheword_add_recipient();
		});
	}

	$("#aspnetForm").validate({
	    errorContainer: "#stwForm-validation-billboard",
	    errorLabelContainer: "#stwForm-validation-messages",
	    errorClass: "invalid",
	    wrapper: "li",
	    ignoreTitle: true,
	    submitHandler: spreadtheword_submit,
	    highlight: function(element, errorClass){
	      $(element.form).find("label[for=" + element.id + "]").addClass(errorClass);
        },
        unhighlight: function(element, errorClass) {
            $(element).removeClass(errorClass);
            $(element.form).find("label[for=" + element.id + "]")
                    .removeClass(errorClass);
        },
        rules: {
            stwForm_destinationemail_2: {
                required: function(element) {
                    return has_value("#stwForm_destinationname_2");
                }
            },
            stwForm_destinationemail_3: {
                required: function(element) {
                    return has_value("#stwForm_destinationname_3");
                }
            },
            stwForm_destinationemail_4: {
                required: function(element) {
                    return has_value("#stwForm_destinationname_4");
                }
            },
            stwForm_destinationemail_5: {
                required: function(element) {
                    return has_value("#stwForm_destinationname_5");
                }
            }
        }
	});
	
	$("#stSpreadNav").addClass('stSpreadNav-down');
}

function show_topreasons() {
    swfobject.embedSWF(
		"support/swf/reasons.swf",
		"topReasonsFlashPrimer",
		"216",
		"155",
		"9.0.0",
		false,
		{
		    xmlURL: "support/xml/reasons.xml"
		},
		{
		    wmode: "transparent",
		    allowScriptAccess: "always"
		},
		false
	);
}

function setup_othervideos() {
    swfobject.embedSWF(
		"support/swf/videolist.swf",
		"wlrothervideosWidget",
		"355",
		"120",
		"9.0.0",
		false,
		{
		    playlistId: "DD417250F92EE9E0"
		},
		{
		    wmode: "opaque",
		    base: ".",
		    allowScriptAccess: "always",
		    quality: "high",
		    scale: "noscale",
		    bgcolor: "#EBEBEB"
		},
		false
	);
}

function setup_sitefooter() {

}

function setup_watchlaughrepeat(){
	if ( $(".wlrContentBodyShare").length > 0 ) {
		$(".wlrContentBodyShare").hover(function(){
			$(this).addClass('wlrContentBodyShare-hover');
		},function(){
			$(this).removeClass('wlrContentBodyShare-hover');
		});

		$(".wlrContentBodyShare").click(function() {
			tb_show("Lights. Camera. Action.","forms/ShareVideo.aspx?TB_iframe=true&height=453&width=661&modal=true",false);
		});
	}	
	
	if ( $("#wlrContentBodySubmit").length > 0 ) {
		$("#wlrContentBodySubmit").hover(function(){
			$(this).addClass('wlrContentBodySubmit-hover');
		},function(){
			$(this).removeClass('wlrContentBodySubmit-hover');
		});
		
		$("#wlrContentBodySubmit").click(function(){
			tb_show("Lights. Camera. Action.","forms/LightsCameraAction.aspx?TB_iframe=true&height=655&width=670&modal=true",false);
        });

        $("#wlrHotLink").click(function() {
            tb_show("Lights. Camera. Action.", "forms/LightsCameraAction.aspx?TB_iframe=true&height=655&width=670&modal=true", false);
        });
	}
	
	$("#stWLRNavTop").addClass('stWLRNavTop-down');
	$("#stWLRNavExp").addClass('stWLRNavExp-down');
	$("#stWLRNavBot").addClass('stWLRNavBot-down');

	var videoid = String($.query.get('id'));
	if (videoid.length > 0) {
	    wlrLoadVideo(videoid);
	} else {
	    wlrLoadVideo("default");
	}

	setup_othervideos();
}


function wlrPopulateVideo(xml) {

    var videoid = "";
    var author = "";
    var title = "";
    var desc = "";

    // assumes a valid xml message...
    $(xml).find("Video").each(function() {
        videoid = $(this).find("videoid").text();
        author = $(this).find("name").text();
        title = $(this).find("videoname").text();
        desc = $(this).find("videodesc").text();
    });

    var yturl = "http://www.youtube.com/v/" + videoid + "&showinfo=0&enablejsapi=1&rel=0&hl=en&fs=1&ap=%2526fmt%3D18";
    var code = "<object width=\"480\" height=\"295\">";
    code += "<param name=\"movie\" value=\"" + yturl + "&hl=en&fs=1\"></param>"
    code += "<param name=\"allowFullScreen\" value=\"true\"></param>";
    code += "<param name=\"allowscriptaccess\" value=\"always\"></param>";
    code += "<embed src=\"" + yturl + "\" type=\"application/x-shockwave-flash\" ";
    code += "allowscriptaccess=\"always\" allowfullscreen=\"true\" ";
    code += "width=\"640\" height=\"385\"></embed></object>";

    if (videoid == "") {
        $("#wlrContentBodyTheatrePlayer").html("<p>Unknown video requested.</p>");
    } else {
        $("#wlrContentBodyTheatrePlayer").html(code);
    }

    if (title == "") {
        $("#wlrContentBodyNowPlayingBodyTitle").html("Unknown");
    } else {
        $("#wlrContentBodyNowPlayingBodyTitle").html(title);
    }

    if (desc == "") {
        $("#wlrContentBodyNowPlayingBodyDescription").html("Unknown");
    } else {
        $("#wlrContentBodyNowPlayingBodyDescription").html(desc);
    }

    if (author == "") {
        $("#wlrContentBodyNowPlayingBodyAuthor").html("Unknown");
    } else {
        $("#wlrContentBodyNowPlayingBodyAuthor").html(author);
    }
}


function onSelectNewVideo(videoid) {
    wlrLoadVideo(videoid);
}

function wlrLoadVideo(videoid) {

    //wlrPopulateVideo(null);
    $.ajax({
        type: "GET",
        url: "/services/GetYTMeta.aspx",
        //url: "/services/test.xml",
        data: "id=" + videoid,
        dataType: "xml",
        success: function(xml) {
            $.cookie('ckvideoid', videoid);
            wlrPopulateVideo(xml);
        },
        error: function(XMLHttpRequest, textStatus, errorThrown) {
            //alert("Boo! - " + XMLHttpRequest.statusText + " - " + textStatus + " - " + errorThrown );
        }
    });  
  
}

function svProcessShareForm(svdata) {
    tb_remove();

    $.cookie('sender_name', $("#svForm_yourname").val());
    $.cookie('sender_email', $("#svForm_youremail").val());

    $.ajax({
        type: "POST",
        url: "/services/Submit_ShareVideo.aspx",
        data: svdata,
        dataType: "xml",
        success: function(xml) {
            sharevideo_simplethanks();
            //tb_show("Thank You", "forms/ThankYou.aspx?TB_iframe=true&width=580&height=250&modal=true", false);
            // wlrPopulateVideo(xml);
        },
        error: function(XMLHttpRequest, textStatus, errorThrown) {
            //alert("Boo! - " + XMLHttpRequest.statusText + " - " + textStatus + " - " + errorThrown);
        }
    });
}


function page_common(){
	/* if( $("#topreasonsCarousel").is(':visible') ) {
		setup_topreasons();
	}*/

	if( $("#siteFooter").length > 0 ) {
		setup_sitefooter();
	}

	if( $("#wtbGo").length > 0 ) {
	    $("#wtbGo").click(function() {
	        var gotourl;

	        gotourl = 'WhereToBuy.aspx?zip=' + $("#wtbZipCode").val();
	        window.location = gotourl;
	        // window.location = '#';
	    });
	}

	
	if ( $("#staytrueHomeLogo").length > 0 ) {
		$("#staytrueHomeLogo").click(function(){
			window.location = 'default.aspx';
		});
	}

	if ($("#biolageHomeLogo").length > 0) {
	    $("#biolageHomeLogo").click(function() {
	    window.open("http://www.biolage.com", "stexternal", "menubar=1,resizable=1,scrollbars=1,width=800,height=600");
	    });
	}

	if ($("#siteFooterMatrixBadge").length > 0) {
	    $("#siteFooterMatrixBadge").click(function() {
	        window.open("http://www.matrix.com", "stexternal", "menubar=1,resizable=1,scrollbars=1,width=800,height=600");
	    });
	}

	if ($("#wtbZipCode").length > 0) {
	    $("#wtbZipCode").example("Zip");
	}
	
	try { document.execCommand('BackgroundImageCache', false, true); } catch(e) {} 

	$(window).load(function () {
		/* $.preloadCssImages(); */
		/* try { $.preloadCssImages();	} catch(e) {}; */
    });

    
    $("a[rel=external]").click(function() {
        window.open($(this).attr('href'), "stexternal", "menubar=1,resizable=1,scrollbars=1,width=800,height=600");
        return false;
    });
}

function setup_whatsyourbiotherapie(){
	if ( $("#whatsYourBiotherapieContentBodyFlash").length > 0 ) {
	    swfobject.embedSWF(
			"support/swf/products.swf",
			"whatsYourBiotherapieContentBodyFlash",
			"680",
			"500",
			"9.0.0",
			false,
			{
			    xmlURL: "support/xml/products.xml"
			},
			{
			    wmode: "opaque"
			},
			false
		);
	}

	$("#stWhatsYourNav").addClass('stWhatsYourNav-down');
}

function setup_wheretobuy(){
	if ( $(".wtbResultsTableSendMobile").length > 0 ) {
		$(".wtbResultsTableSendMobile").hover(function(){
			$(this).addClass('wtbResultsTableSendMobile-hover');
		},function(){
			$(this).removeClass('wtbResultsTableSendMobile-hover');
		});
		
		$(".wtbResultsTableSendMobile").click(function(){
			// alert("Sent to Mobile");
			// window.location = '#';
		});
	}

	if ( $(".wtbResultsTableMapIt").length > 0 ) {
		$(".wtbResultsTableMapIt").hover(function(){
			$(this).addClass('wtbResultsTableMapIt-hover');
		},function(){
			$(this).removeClass('wtbResultsTableMapIt-hover');
		});
		
		$(".wtbResultsTableMapIt").click(function(){
			// alert("Map It");
			// window.location = '#';
		});
	}
	
	if ( $("#wtbUpdateSubmit").length > 0 ) {
		$("#wtbUpdateSubmit").hover(function(){
			$(this).addClass('wtbUpdateSubmit-hover');
		},function(){
			$(this).removeClass('wtbUpdateSubmit-hover');
		});

		$("#wtbUpdateSubmit").click(function() {
		    zipparam = $("#wtbUpdateZipField").val();
		    wtbLoadResults(zipparam);
		});
	}

	$("#wtbUpdateZipField").example("Zip");

	var zipparam = String($.query.get('zip'));
	if (zipparam.length > 0) {
	    wtbLoadResults(zipparam);
	}
}

function wtbLoadResults(zipparam) {
    if (zipparam.length < 5) {
        zipparam = "0" + zipparam;
    }

    var targeturl = '/services/WhereToBuyProxy.aspx';

    $.ajax({
        type: "GET",
        url: targeturl,
        data: "zip=" + zipparam,
        dataType: "html",
        success: function(html) {
            $("#whereToBuyContentBodyBody").html(html);
             tb_init('a.thickbox, area.thickbox, input.thickbox');
        },
        error: function(XMLHttpRequest, textStatus, errorThrown) {
            //alert("Boo! - " + XMLHttpRequest.statusText + " - " + textStatus + " - " + errorThrown);
        }
    });
}

function stayconnected_thanks() {
    $('#aspnetForm').resetForm();
    tb_show("Thank You", "forms/StayConnected_ThankYou.aspx?TB_iframe=true&width=580&height=250&modal=true", false);
}

function stayconnected_submit() {
    var ajaxurl = "";

    tb_remove();

    ajaxurl = "services/Submit_StayConnected.aspx";

    var data = $("#aspnetForm")
                .find("input,textarea,select,hidden")
                .not("#__VIEWSTATE,#__EVENTVALIDATION")
                .serialize();

    $.ajax({
        type: "POST",
        url: ajaxurl,
        data: data,
        dataType: "xml",
        success: function(xml) {
            stayconnected_thanks();
        },
        error: function(XMLHttpRequest, textStatus, errorThrown) {
            //alert("Boo! - " + XMLHttpRequest.statusText + " - " + textStatus + " - " + errorThrown);
        }
    });
}

function setup_stayconnected(){

    $("#stPrimer").addClass('stStayConnected-primer-adjust');

	if ($("#scForm-submit").length > 0) {
	    $("#scForm-submit").hover(function() {
	        $(this).addClass('scForm-submit-hover');
	    }, function() {
	        $(this).removeClass('scForm-submit-hover');
	    });

	    $("#scForm-submit").click(function() {
    	    $("#aspnetForm").submit();
	    });
	}

	$("#aspnetForm").validate({
	    errorContainer: "#scForm-validation-billboard",
	    errorLabelContainer: "#scForm-validation-messages",
	    errorClass: "invalid",
	    wrapper: "li",
	    ignoreTitle: true,
	    submitHandler: stayconnected_submit,
	    highlight: function(element, errorClass) {
	        $(element.form).find("label[for=" + element.id + "]").addClass(errorClass);
	    },
	    unhighlight: function(element, errorClass) {
	        $(element).removeClass(errorClass);
	        $(element.form).find("label[for=" + element.id + "]")
                    .removeClass(errorClass);
	    },
	    rules: {
	        scForm_mobilephone: {
	            required: "#scForm_smsme:checked"
	        }
	    }
	});

	$("#scForm_mobilephone").example("");
	
	$("#stConnectedNav").addClass('stConnectedNav-down');
}

function setup_investigative(){
	if ( $("#idvContentBodyTheatreShare").length > 0 ) {
		$("#idvContentBodyTheatreShare").hover(function(){
			$(this).addClass('idvContentBodyTheatreShare-hover');
		},function(){
			$(this).removeClass('idvContentBodyTheatreShare-hover');
		});
		
		$("#idvContentBodyTheatreShare").click(function(){
			// alert("Share This");
			// window.location = '#';
		});
	}

	if ( $("#idvContentBodySeeMore").length > 0 ) {
		$("#idvContentBodySeeMore").hover(function(){
			$(this).addClass('idvContentBodySeeMore-hover');
		},function(){
			$(this).removeClass('idvContentBodySeeMore-hover');
		});
		
		$("#idvContentBodySeeMore").click(function(){
			// alert("See More");
		    window.location = 'WatchLaughRepeat.aspx';
		});
	}
	
	show_topreasons();
}

function show_product_detail(newPageEscaped) {
    newPage = unescape(newPageEscaped);
    window.open(newPage, "stexternal", "menubar=1,resizable=1,scrollbars=1,width=800,height=600");
}

function submit_form() {
    tb_remove();
    $("#aspnetForm").submit();
}

function page_customizations( page ){
	switch( page ){
		case "":
		case "default.aspx":
			setup_home();
			setup_navigation( true );
			break;
		case "WhatIsStayTrue.aspx":
			setup_whatis();
			setup_navigation( false );
			break;
		case "SpreadTheWord.aspx":
			setup_spreadtheword();
			setup_navigation( false );
			break;
		case "WatchLaughRepeat.aspx":
			setup_watchlaughrepeat();
			setup_navigation( false );
			break;
		case "WhatsYourBioTherapie.aspx":
			setup_whatsyourbiotherapie();
			setup_navigation( false );
			break;
		case "WhereToBuy.aspx":
			setup_wheretobuy();
			setup_navigation( false );
			break;
		case "StayConnected.aspx":
			setup_stayconnected();
			setup_navigation( false );
			break;
		case "Investigative.aspx":
			setup_investigative();
			setup_navigation( false );
			break;
		default:
			setup_navigation( false );
	}
}

$(document).ready(function(){
	pathBase = "";	
	if( document.location.hostname == "localhost" ){
	    // $pathBase = "/biolage_staytrue/";
	    pathBase = "/";
	}else{
		pathBase = "/";
	}
	page = document.location.pathname;
	page = page.substring( pathBase.length );
	
	page_customizations( page );
	page_common();

	$.preload(prelist, {
	    base: '/support/images/',
	    ext: ''
	});
}); // close document.ready

