﻿function debug(msg) {

    if ((_console == null) || (_console.closed)) {
        _console = window.open("","console","width=800,height=600,resizable");
        _console.document.open("text/plain");
    }
    
    _console.focus();
    _console.document.writeln(msg);
}

// BEGIN HOME PAGE FUNCTIONS

function nextBlog(next){
    if(next)
    {currentBlogIndex++;}
    else{currentBlogIndex--;}			
			
    switch (currentBlogIndex) 
    {
        case 0:
            $("#divBlogPrev").hide();
            break;
        case lastBlogIndex:
            $("#divBlogPrev").show();
			$("#divBlogNext").hide();
            break;      
        default:
            $("#divBlogPrev").show();
			$("#divBlogNext").show();
            break;
    }
        
    $("#spanBlogDate").animate({"opacity":"toggle"},500);
    $("#spanBlogTitle").animate({"opacity":"toggle"},500);
    $("#divBlogDesc").animate({"opacity":"toggle"},500,function(){
        loadBlogData(currentBlogIndex);
        $("#spanBlogDate").animate({"opacity":"toggle"},500);
        $("#spanBlogTitle").animate({"opacity":"toggle"},500);
        if ($("#divBlogDesc").css("display") == "none"){$("#divBlogDesc").animate({"opacity":"toggle"},500);}
    });
    
}

function loadBlogData(blogIndex){
//    var blogPost = blogPosts[blogIndex];
//    $("#spanBlogDate").html(new Date(blogPost.getElementsByTagName("pubDate")[0].childNodes[0].nodeValue).toDateString());
//    $("#spanBlogTitle").html(blogPost.getElementsByTagName("title")[0].childNodes[0].nodeValue);
//    $("#divBlogDesc").html(blogPost.getElementsByTagName("description")[0].childNodes[0].nodeValue);
//    $("#aBlogLink").attr("href",blogPost.getElementsByTagName("link")[0].childNodes[0].nodeValue);

    $("#spanBlogDate").html(blogDate[blogIndex]);
    $("#spanBlogTitle").html(blogTitle[blogIndex]);
    $("#divBlogDesc").html(blogDesc[blogIndex]);
    $("#aBlogLink").attr("href",blogLink[blogIndex]);
}

/* function loadTwitterData(){
  
    var twitterPost;
    var strX;
    var intX;
    
    twitterPost = twitterPosts[0];
    strX = twitterPost.getElementsByTagName("title")[0].childNodes[0].nodeValue;
    intX = strX.indexOf(":");
    $("#divTwitName1").html(strX.substring(0, intX));
    $("#divTwitDate1").html(new Date(twitterPost.getElementsByTagName("pubDate")[0].childNodes[0].nodeValue).toDateString());
    $("#divTwitDesc1").html(linkify(strX.substring(intX + 2)));
    
    twitterPost = twitterPosts[1];
    strX = twitterPost.getElementsByTagName("title")[0].childNodes[0].nodeValue;
    intX = strX.indexOf(":");
    $("#divTwitName2").html(strX.substring(0, intX));
    $("#divTwitDate2").html(new Date(twitterPost.getElementsByTagName("pubDate")[0].childNodes[0].nodeValue).toDateString());
    $("#divTwitDesc2").html(linkify(strX.substring(intX + 2)));
    
    twitterPost = twitterPosts[2];
    strX = twitterPost.getElementsByTagName("title")[0].childNodes[0].nodeValue;
    intX = strX.indexOf(":");
    $("#divTwitName3").html(strX.substring(0, intX));
    $("#divTwitDate3").html(new Date(twitterPost.getElementsByTagName("pubDate")[0].childNodes[0].nodeValue).toDateString());
    $("#divTwitDesc3").html(linkify(strX.substring(intX + 2)));
    
    twitterPost = twitterPosts[3];
    strX = twitterPost.getElementsByTagName("title")[0].childNodes[0].nodeValue;
    intX = strX.indexOf(":");
    $("#divTwitName4").html(strX.substring(0, intX));
    $("#divTwitDate4").html(new Date(twitterPost.getElementsByTagName("pubDate")[0].childNodes[0].nodeValue).toDateString());
    $("#divTwitDesc4").html(linkify(strX.substring(intX + 2)));
    
} */

function linkify(strX){

//    var strY;
//    
//    txtArray = new Array();

//    strX.indexOf("http://")
//    txtArray.push(marker.safeName);

//    strX = txtArray.join("");
//    txtArray = null;

    return strX;
    
}

function whatWeDoClick(){
    if ($("#divWhatWeDoInner").css("display") == "none")
    {
        blogHider();
        $("#divWhatWeDoInner").slideDown("slow");
        $("#divBlog").animate(
            {"top": "+=161px"}, 600
        );
		//$("#imgWhatWeDoMinus").show();
		$("#imgAboutUsMinus").hide();
		
		DisplayTweets(false);
		
		$("#spanWhatWeDoMore").hide();		
		$("#spanAboutUsMore").show();		
        booBlogMovedDown = true;
        handleAboutArea();
        handleInquiriesArea();
    }
}

function DisplayTweets(expand){
	if (expand) {
        $("#imgTwitterMinus").show();
        //$("#divTwitterInner").slideDown("slow");
        $("#divTweetsStatic").animate({"height":"+=162px"}, 600);
        $("#divTweetsAbsolute").animate({"height":"+=162px"}, 600);
        $("#divTweets").animate({"height":"+=162px"}, 600);
        $("#divMoreTweets").animate({"top":"+=162px"}, 600);
	}
	else {
		$("#divTweetsStatic").animate({"height":"136px"}, 600);
        $("#divTweetsAbsolute").animate({"height":"136px"}, 600);
        $("#divTweets").animate({"top":"0px"}, 600);
		$("#divTweets").animate({"height":"400px"}, 600);
        $("#divMoreTweets").animate({"top":"160px"}, 600);
		$("#imgTwitterMinus").hide();
	}
}

function moreTweets(){

	if ($("#divAboutInner").css("display") != "none") {
		$("#divTweets").animate({"top":"-=200px"}, 600);
		$("#divTweets").animate({"height":"+=200px"}, 600);
	}
}

function aboutClick(){
    if ($("#divAboutInner").css("display") == "none")
    {
        blogHider();
        $("#divWhatWeDoInner").slideUp("slow");
        $("#divOurWorkInner").slideUp("slow");
        $("#imgOurWorkPlus").show();
        $("#divOurWorkImg").animate({"height":"98px"}, 600);
        $("#divAboutInner").slideDown("slow");
		DisplayTweets(true);
        if ($("#divInquiriesInner").css("display") != "none")
        {
            $("#divInquiriesInner").slideUp("slow");
            $("#ctl00_txtInquiryMessage").animate({"height":"37px"}, 600);
            $("#divOurWork").animate(
                {"top": "-=162px"}, 600
            );
        }
        $(".twitAbout").animate(
            {"top": "-=162px"}, 600
        );
		//$("#imgWhatWeDoMinus").hide();
		$("#spanWhatWeDoMore").show();		
		$("#imgAboutUsMinus").show();
		$("#spanAboutUsMore").hide();		
        booAboutMovedUp = true;
        handleBlogArea();
    }
}

function locationClick(){
    if ($("#divLocationInner").css("display") == "none")
    {
        $("#divLocationInner").slideDown("slow");
        $("#divTestimonialsInner").slideUp("slow");
        $("#divTeamLeadsInner").slideUp("slow");
        
        $("#divTestimonials").animate(
            {"top": "+=158px"}, 600
        );
        $("#divTeamLeads").animate(
            {"top": "+=53px"}, 600
        );
        
        $("divMapHider").hide();
        $("#divMap").removeClass("lesserIndex").slideDown("slow");
        
        //var strX = "<div style="font-weight:bold;font-size:12px;">200 S. MICHIGAN AVE<br/>SUITE 500<br/>CHICAGO, IL<br/>60604</div>";
        //setTimeout("marker.openInfoWindowHtml(\"" + strX +"\");",600);
    }    
}

function testimonialsTeamLeadsClick(){
    if ($("#divTestimonialsInner").css("display") == "none")
    {
        $("#divLocationInner").slideUp("slow");
        $("#divTestimonialsInner").slideDown("slow");
        $("#divTeamLeadsInner").slideDown("slow");
        $("#divTestimonials").animate(
            {"top": "-=158px"}, 600
        );
        $("#divTeamLeads").animate(
            {"top": "-=53px"}, 600
        );
        $("#divMap").slideUp("slow");
    }
}

function handleBlogArea(){
    if (booBlogMovedDown == true)
    {
        $("#divBlog").animate(
            {"top": "-=161px"}, 600
        );
        booBlogMovedDown = false;
    }
}

function handleAboutArea(){
    if (booAboutMovedUp == true)
    {
        $(".twitAbout").animate(
            {"top": "+=162px"}, 600
        );
        $("#divAboutInner").slideUp("slow");
        //$("#divTwitterInner").slideUp("slow");
        booAboutMovedUp = false;
    }
}

function handleInquiriesArea(){
    if ($("#divInquiriesInner").css("display") == "none")
    {
        $("#divOurWorkInner").slideDown("slow");
        $("#divOurWorkImg").animate({"height":"260px"}, 600);
        $("#imgOurWorkPlus").hide();
    }
}

function blogXpander(){
    $("#divBlogInner").slideDown("slow");
    $("#imgBlogPlus").hide();
	//$("#imgBlogMinus").show();  //
	$("#imgWhatWeDoPlus").show(); //

}

function blogHider(){
    $("#divBlogInner").slideUp("slow");
    $("#imgBlogPlus").show();
	$("#imgBlogMinus").hide();  //
	$("#imgWhatWeDoPlus").hide(); //
}

function blogClick(){
    if ($("#divBlogInner").css("display") == "none")
    {
        $("#divWhatWeDoInner").slideUp("slow");
        blogXpander();
        handleBlogArea();
        handleAboutArea();
        handleInquiriesArea();
		//$("#imgWhatWeDoMinus").hide();
		$("#imgAboutUsMinus").hide();
		$("#imgBlogMinus").show();
		$("#imgWhatWeDoPlus").show();

		DisplayTweets(false);
		
		$("#spanWhatWeDoMore").show();		
		$("#spanAboutUsMore").show();		
    }
}

function doHomePageMagic(boxID,innerBoxID){
    if(expand0r != boxID){
        switch (expand0r) {
            case "#divClientMeetings":
				$("#divClientMeetingsInner").slideUp("slow");
				$("#spanMinimizePuzzle").hide();
				$("#divClientMeetings").animate({width:218,top:641,left:8}, 1000);
				$("#divClientMeetingsInnerMini").show();
				$("#divFooter").animate({"top": "+=100px"},1000);
				
				break;
            case "#divEmailsSent":
					$("#divEmailsSentInner").slideUp("slow");
					$("#spanMinimizeEmailsSent").hide();
					$("#divEmailsSent").animate({width:218,top:1168,left:254}, 1000);
					$("#divEmailsSentInnerMini").show();
					$("#divEmailsSent").addClass("boxem");
					
                break;
            default:
                break;
        } 
		$("html").animate({scrollTop:0}, 1000);
        $(boxID).removeClass("boxem");
        if(innerBoxID!=""){$(innerBoxID).slideDown("slow");}
		
		switch (boxID) {
			case "#divClientMeetings":
				$("#divClientMeetingsInnerMini").hide();
				$("#spanMinimizePuzzle").show();
				$("#divFooter").animate({"top": "-=100px"},1000);
				break;
			case "#divEmailsSent":
				$("#spanMinimizeEmailsSent").show(); 
				break;
		}
		
        if(!boxemMovedDown){$(".boxem").animate({"top": "+=527px"},1000);boxemMovedDown=true;}
        $(boxID).animate({width:710,top:8,left:254}, 1000);
        expand0r = boxID; 
    }
}

function MinimizeFlash(flashType){

	switch (flashType) {
		case "puzzle" :
			$("#divClientMeetingsInner").slideUp("slow");
			$("#spanMinimizePuzzle").hide();
			$("#divClientMeetings").animate({width:218,top:641,left:8}, 1000);
			$("#divClientMeetingsInnerMini").show();
			$(".boxem").animate({"top": "-=527px"},1000);
			$("#divFooter").animate({"top": "+=100px"},1000);
			boxemMovedDown=false;
			expand0r = "";	
			break;
		case "email" :
			$("#divEmailsSentInner").slideUp("slow");
			$("#spanMinimizeEmailsSent").hide();
			$("#divEmailsSent").animate({width:218,top:641,left:254}, 1000);
			$("#divEmailsSentInnerMini").show();
			$(".boxem").animate({"top": "-=527px"},1000);
			$("#divEmailsSent").addClass("boxem");
			boxemMovedDown=false;
			expand0r = "";	
			break;
		case "quote" :
			$("#divQuoteInner").slideUp("slow");
			$("#spanMinimizeQuote").hide();
			$("#divQuote").animate({width:218,top:641,left:746}, 1000);
			$("#divQuoteInnerMini").show();
			$("#divQuote").removeClass("boxem");
			$(".boxem").animate({"top": "-=527px"},1000);
			$("#divQuote").addClass("boxem");
			boxemMovedDown=false;
			expand0r = "";	
			break;
		default:
			break;
	}
}

function viewOurWork(){
	//$("#ctl00_divOurWorkImg").attr("opacity:0.3");
	//$("#ctl00_divOurWorkImg").attr("filter:alpha(opacity=30)");
	window.location = "http://www.magnani.com/Our_Work/index.aspx";
}

function switchOurWork(){
	
	if (booFirstCreativeVisible) {
		$("#ctl00_divOurWorkImg2").css("left", "-238px");
		$("#ctl00_divOurWorkImg").animate({"left":"238px"}, 1000);
		$("#ctl00_divOurWorkImg2").animate({"left":"0px"}, 1000);
		//alert(0);
		var t=setTimeout("$('#ctl00_divOurWorkImg').css('background-image', arrOurWork[currOurWorkCreative])", 3000);
		if (currOurWorkCreative == (numOurWorkCreatives - 1)){currOurWorkCreative = 0;}else{currOurWorkCreative++;}
		booFirstCreativeVisible = false;
	}
	else
	{
		$("#ctl00_divOurWorkImg").css("left", "-238px");
		$("#ctl00_divOurWorkImg2").animate({"left":"238px"}, 1000);
		$("#ctl00_divOurWorkImg").animate({"left":"0"}, 1000);
		var t=setTimeout("$('#ctl00_divOurWorkImg2').css('background-image', arrOurWork[currOurWorkCreative])", 3000);
		if (currOurWorkCreative == (numOurWorkCreatives - 1)){currOurWorkCreative = 0;}else{currOurWorkCreative++;}
		booFirstCreativeVisible = true;
	}
}
// END HOME PAGE FUNCTIONS

// BEGIN SUBMASTER FUNCTIONS

function inquiriesClick(){
    if ($("#divInquiriesInner").css("display") == "none")
    {
        if ($("#divWhatWeDoInner").css("display") == "none"){blogXpander();}
        $("#divOurWorkInner").slideUp("slow");
        $("#imgOurWorkPlus").show();
        $("#divInquiriesInner").slideDown("slow");
		$("#ctl00_txtInquiryMessage").animate({"height":"135px"}, 600); //ASP.net renames the control if using runat=Server
        $("#divOurWork").animate({"top": "+=162px"}, 600);
        $("#divOurWorkImg").animate({"height":"98px"}, 600);
		$("#imgAboutUsMinus").hide();
        $("#imgInquiryMinus").show();
		handleAboutArea();
    }
}

function inquiriesClickOurProcess(){
    if ($("#divInquiriesInner").css("display") == "none"){
		$("#divContent").animate({"top": "+=38px"}, 600);
        $("#divInquiriesInner").slideDown("slow");
		$("#ctl00_txtInquiryMessage").animate({"height":"135px"}, 600); //ASP.net renames the control if using runat=Server
    }
}

function inquiriesClickSearch(){
    if ($("#divInquiriesInner").css("display") == "none"){
		$("#divContent").animate({"top": "+=134px"}, 600);
        $("#divInquiriesInner").slideDown("slow");
		$("#ctl00_txtInquiryMessage").animate({"height":"135px"}, 600); //ASP.net renames the control if using runat=Server
        $("#txtInquiryMessage").animate({"height":"135px"}, 600);
    }
}

function ourWorkClick(){
    if ($("#divOurWorkInner").css("display") == "none")
    {
        $("#divOurWorkInner").slideDown("slow");
        $("#imgOurWorkPlus").hide();
		$("#imgAboutUsMinus").hide();
		$("#imgInquiryMinus").hide();
        $("#divOurWorkImg").animate({"height":"260px"}, 600);
        $("#divInquiriesInner").slideUp("slow");
		DisplayTweets(false);
        $("#ctl00_txtInquiryMessage").animate({"height":"37px"}, 600);
        if (booAboutMovedUp)
        {
            handleAboutArea();
            blogXpander();
        }
        else{$("#divOurWork").animate({"top": "-=162px"}, 600);}
    }
}

function inquiryTextClick(){
	$("#ctl00_txtInquiryMessage").html("");  //ASP.net renames the conrol using runat=Server
}

// END SUBMASTER FUNCTIONS

// BEGIN TEAM LEAD FUNCTIONS
function nextBlogTeamLead(next){
    
    if(next)
    {currentBlogIndex++;}
    else{currentBlogIndex--;}
			
    switch (currentBlogIndex) 
    {
		case 0:
            $("#divBlogPrev").hide();
            break;   
        case lastBlogIndex:
			$("#divBlogPrev").show();
            $("#divBlogNext").hide()
            break;    
        default:
            $("#divBlogPrev").show();
			$("#divBlogNext").show();
            break;
    }
        
   // $("#spanBlogDate").animate({"opacity":"toggle"},500);
    $("#divBlogTitle").animate({"opacity":"toggle"},500,function(){
        loadBlogDataTeamLead(currentBlogIndex);
       // $("#spanBlogDate").animate({"opacity":"toggle"},500);
        $("#divBlogTitle").animate({"opacity":"toggle"},500);
    });
    
}

function loadBlogDataTeamLead(blogIndex){
    $("#spanBlogDate").html(blogDate[blogIndex]);
    $("#spanBlogTitle").html(blogTitle[blogIndex]);
    $("#aBlogLink").attr("href",blogLink[blogIndex]);
	$("#spanBlogCounter").html(blogIndex+1);
	if (lastBlogIndex == 0) {$("#divBlogNext").hide();} 
}
// END TEAM LEAD FUNCTIONS

// BEGIN OUR WORK FUNCTIONS

function getTopValue(x){if(filterExpanded){return x+103;}else{return x}}

function ourWorkMouseOver(boxID){
	$(boxID).fadeTo("fast", 1);
}
function ourWorkMouseOut(boxID){
	$(boxID).fadeTo("fast", .3);
}

function filterClientClick(){
    if (!filterExpanded)
    {
        $(".OurWorkBoxem").animate(
            {"top": "+=103px"}, 600
        );
        $("#divFilterInner").slideDown("slow");
		filterExpanded = true;
    }
	if ($("#divFilterIndustryList").css("display") != "none"){
		$("#divFilterIndustryList").hide();
		$("#spanIndustry").removeClass("yellFore");
	}
	if ($("#divFilterClientList").css("display") == "none"){
		$("#divFilterClientList").animate({"opacity":"toggle"},500);
		$("#spanClient").addClass("yellFore");
	}
}
function filterIndustryClick(){
    if (!filterExpanded)
    {
        $(".OurWorkBoxem").animate(
            {"top": "+=103px"}, 600
        );
        $("#divFilterInner").slideDown("slow");
		filterExpanded = true;
    }
	
	if ($("#divFilterClientList").css("display") != "none"){
		$("#divFilterClientList").hide();
		$("#spanClient").removeClass("yellFore");
	}
	if ($("#divFilterIndustryList").css("display") == "none"){
		$("#divFilterIndustryList").animate({"opacity":"toggle"},500);
		$("#spanIndustry").addClass("yellFore");
	}
}

function doOurWorkMagic(mediumType){
	currMediumType = mediumType;
	loadCreativeMainBox();
	$("#divContent").hide();
	if (countMedium == 1) {
		//$("#imgWhatWeDoMinus").hide();
	} 
	else {
		//$("#imgWhatWeDoMinus").show();
	}
}  
function loadCreativeMainBox(){
	$("#ctl00_ContentPlaceHolder1_divMainBox").animate({width:956,height:612}, 500, function() {
		switch (currMediumType){
			case "brandDev": 		
//	$("#ctl00_ContentPlaceHolder1_imgCreative").animate({"opacity":"toggle"},500);
//	$("#spanCreativeCopy").animate({"opacity":"toggle"},500,function(){
//        loadCaseStudyCreative(currCreative);
//		$("#spanCreativeCopy").animate({"opacity":"toggle"},500);
//		$("#ctl00_ContentPlaceHolder1_imgCreative").animate({"opacity":"toggle"},500);
//    });
				//$("#ctl00_ContentPlaceHolder1_imgMainBox").animate({"opacity":"toggle"},500, function() {
				//	$("#ctl00_ContentPlaceHolder1_imgMainBox").attr("src", imgURLPrefix + arrBrandDev[currBrandDev][6]);
				//	$("#ctl00_ContentPlaceHolder1_imgMainBox").animate({"opacity":"toggle"},500);				
				//});


				$("#ctl00_ContentPlaceHolder1_imgMainBox").attr("src", imgURLPrefix + arrBrandDev[currBrandDev][6]);
				$("#spanMainBoxClient").html(arrBrandDev[currBrandDev][7]);
				$("#spanMainBoxCaption").html(arrBrandDev[currBrandDev][2]);
				$("#spanMainBoxName").html(arrBrandDev[currBrandDev][1]);
				$("#spanCurrentMainBox").html(currBrandDev+1);
				$("#spanNumMainBox").html(numBrandDev);
				$("#spanMainBoxTitle").html("Brand Development");
				if($("#ctl00_ContentPlaceHolder1_divTitle").html() != arrBrandDev[currBrandDev][7]) {$("#spanMainBoxClientURL").html("<a href='http://www.magnani.com/Our_Work/Clients/Chicago_Marketing/" + arrBrandDev[currBrandDev][8] + "/index.aspx'>View more from this client</a>");}
				preloadImages(currMediumType, currBrandDev, numBrandDev-1);
				break;
				
			case "broadcast":
				$("#ctl00_ContentPlaceHolder1_imgMainBox").attr("src", imgURLPrefix + arrBroadcast[currBroadcast][6]);
				$("#spanMainBoxClient").html(arrBroadcast[currBroadcast][7]);
				$("#spanMainBoxCaption").html(arrBroadcast[currBroadcast][2]);
				$("#spanMainBoxName").html(arrBroadcast[currBroadcast][1]);
				$("#spanCurrentMainBox").html(currBroadcast+1);
				$("#spanNumMainBox").html(numBroadcast);
				$("#spanMainBoxTitle").html("Broadcast");
				if($("#ctl00_ContentPlaceHolder1_divTitle").html() != arrBroadcast[currBroadcast][7]) {$("#spanMainBoxClientURL").html("<a href='http://www.magnani.com/Our_Work/Clients/Chicago_Marketing/" + arrBroadcast[currBroadcast][8] + "/index.aspx'>View more from this client</a>");}
				preloadImages(currMediumType, currBroadcast, numBroadcast-1);
				break;
			
			case "digital": 
				$("#ctl00_ContentPlaceHolder1_imgMainBox").attr("src", imgURLPrefix + arrDigital[currDigital][6]);
				$("#spanMainBoxClient").html(arrDigital[currDigital][7]);
				$("#spanMainBoxCaption").html(arrDigital[currDigital][2]);
				$("#spanMainBoxName").html(arrDigital[currDigital][1]);
				$("#spanCurrentMainBox").html(currDigital+1);
				$("#spanNumMainBox").html(numDigital);
				$("#spanMainBoxTitle").html("Digital");
				if($("#ctl00_ContentPlaceHolder1_divTitle").html() != arrDigital[currDigital][7]) {$("#spanMainBoxClientURL").html("<a href='http://www.magnani.com/Our_Work/Clients/Chicago_Marketing/" + arrDigital[currDigital][8] + "/index.aspx'>View more from this client</a>");}
				preloadImages(currMediumType, currDigital, numDigital-1);
				break;
				
			case "direct": 
				$("#ctl00_ContentPlaceHolder1_imgMainBox").attr("src", imgURLPrefix + arrDirect[currDirect][6]);
				$("#spanMainBoxClient").html(arrDirect[currDirect][7]);
				$("#spanMainBoxCaption").html(arrDirect[currDirect][2]);
				$("#spanMainBoxName").html(arrDirect[currDirect][1]);
				$("#spanCurrentMainBox").html(currDirect+1);
				$("#spanNumMainBox").html(numDirect);
				$("#spanMainBoxTitle").html("Direct Response");
				if($("#ctl00_ContentPlaceHolder1_divTitle").html() != arrDirect[currDirect][7]) {$("#spanMainBoxClientURL").html("<a href='http://www.magnani.com/Our_Work/Clients/Chicago_Marketing/" + arrDirect[currDirect][8] + "/index.aspx'>View more from this client</a>");}
				preloadImages(currMediumType, currDirect, numDirect-1);
				break;
				
			case "home": 
				$("#ctl00_ContentPlaceHolder1_imgMainBox").attr("src", imgURLPrefix + arrHome[currHome][6]);
				$("#spanMainBoxClient").html(arrHome[currHome][7]);
				$("#spanMainBoxCaption").html(arrHome[currHome][2]);
				$("#spanMainBoxName").html(arrHome[currHome][1]);
				$("#spanCurrentMainBox").html(currHome+1);
				$("#spanNumMainBox").html(numHome);
				$("#spanMainBoxTitle").html("Out-Of-Home");
				if($("#ctl00_ContentPlaceHolder1_divTitle").html() != arrHome[currHome][7]) {$("#spanMainBoxClientURL").html("<a href='http://www.magnani.com/Our_Work/Clients/Chicago_Marketing/" + arrHome[currHome][8] + "/index.aspx'>View more from this client</a>");}
				preloadImages(currMediumType, currHome, numHome-1);
				break;
			case "print":
				$("#ctl00_ContentPlaceHolder1_imgMainBox").attr("src", imgURLPrefix + arrPrint[currPrint][6]);
				$("#spanMainBoxClient").html(arrPrint[currPrint][7]);
				$("#spanMainBoxCaption").html(arrPrint[currPrint][2]);
				$("#spanMainBoxName").html(arrPrint[currPrint][1]);
				$("#spanCurrentMainBox").html(currPrint+1);
				$("#spanNumMainBox").html(numPrint);
				$("#spanMainBoxTitle").html("Print");
				if($("#ctl00_ContentPlaceHolder1_divTitle").html() != arrPrint[currPrint][7]) {$("#spanMainBoxClientURL").html("<a href='http://www.magnani.com/Our_Work/Clients/Chicago_Marketing/" + arrPrint[currPrint][8] + "/index.aspx'>View more from this client</a>");}
				//preloadImages(currMediumType, currPrint, numPrint-1);
				break;
				
			case "promotion": 
				$("#ctl00_ContentPlaceHolder1_imgMainBox").attr("src", imgURLPrefix + arrPromotion[currPromotion][6]);
				$("#spanMainBoxClient").html(arrPromotion[currPromotion][7]);
				$("#spanMainBoxCaption").html(arrPromotion[currPromotion][2]);
				$("#spanMainBoxName").html(arrPromotion[currPromotion][1]);
				$("#spanCurrentMainBox").html(currPromotion+1);
				$("#spanNumMainBox").html(numPromotion);
				$("#spanMainBoxTitle").html("Promotion");
				if($("#ctl00_ContentPlaceHolder1_divTitle").html() != arrPromotion[currPromotion][7]) {$("#spanMainBoxClientURL").html("<a href='http://www.magnani.com/Our_Work/Clients/Chicago_Marketing/" + arrPromotion[currPromotion][8] + "/index.aspx'>View more from this client</a>");}
				preloadImages(currMediumType, currPromotion, numPromotion-1);
				break;			
				
			case "sales": 
				$("#ctl00_ContentPlaceHolder1_imgMainBox").attr("src", imgURLPrefix + arrSales[currSales][6]);
				$("#spanMainBoxClient").html(arrSales[currSales][7]);
				$("#spanMainBoxCaption").html(arrSales[currSales][2]);
				$("#spanMainBoxName").html(arrSales[currSales][1]);
				$("#spanCurrentMainBox").html(currSales+1);
				$("#spanNumMainBox").html(numSales);
				$("#spanMainBoxTitle").html("Sales");
				if($("#ctl00_ContentPlaceHolder1_divTitle").html() != arrSales[currSales][7]) {$("#spanMainBoxClientURL").html("<a href='http://www.magnani.com/Our_Work/Clients/Chicago_Marketing/" + arrSales[currSales][8] + "/index.aspx'>View more from this client</a>");}
				preloadImages(currMediumType, currSales, numSales-1);
				break;
			default: 
				break;
		}
	});
}
function preloadImages(mediumType, currentImageIndex, lastImageIndex){
	var imageIndex = currentImageIndex;
	
	if (imageIndex == lastImageIndex) {imageIndex=0;} else {imageIndex++;}
	$("imgPreloadNext1").attr("src", getContent(mediumType,imageIndex));
	
	if (imageIndex == lastImageIndex) {imageIndex=0;} else {imageIndex++;}
	$("imgPreloadNext2").attr("src", getContent(mediumType,imageIndex));

	if (imageIndex == lastImageIndex) {imageIndex=0;} else {imageIndex++;}
	$("imgPreloadNext3").attr("src", getContent(mediumType,imageIndex));	

	imageIndex = currentImageIndex;
	if (imageIndex == 0) {imageIndex=lastImageIndex;} else {imageIndex--;}
	$("imgPreloadPrev1").attr("src", getContent(mediumType,imageIndex));	
	
	if (imageIndex == 0) {imageIndex=lastImageIndex;} else {imageIndex--;}
	$("imgPreloadPrev2").attr("src", getContent(mediumType,imageIndex));
	
	if (imageIndex == 0) {imageIndex=lastImageIndex;} else {imageIndex--;}
	$("imgPreloadPrev3").attr("src", getContent(mediumType,imageIndex));
}
function getContent(mediumType, index){
	var imageSrc = "";
	var imgURLPrefix3 = "/assets";
	
	switch (mediumType){
			case "brandDev": 	
				//imageSrc = imgURLPrefix3 + arrBrandDev[index][6]; 
				//alert(arrBrandDev[index][6]);
				break;
			case "broadcast": 	imageSrc = imgURLPrefix3 + arrBroadcast[index][6]; break;
			case "digital": 	imageSrc = imgURLPrefix3 + arrDigital[index][6]; break;
			case "direct": 		imageSrc = imgURLPrefix3 + arrDirect[index][6]; break;
			case "home": 		imageSrc = imgURLPrefix3 + arrHome[index][6]; break;
			case "print":		imageSrc = imgURLPrefix3 + arrPrint[index][6]; break;
			case "promotion": 	imageSrc = imgURLPrefix3 + arrPromotion[index][6]; break;		
			case "sales": 		imageSrc = imgURLPrefix3 + arrSales[index][6]; break;
			default: 			break;
	}
	return imageSrc;
}
function nextCreative(next){
        switch (currMediumType) 
        {
			case "brandDev":
				if (currBrandDev >= 0){
					if(next){if (currBrandDev == numBrandDev - 1){currBrandDev = 0;}else{currBrandDev++;}}
					else{if (currBrandDev == 0){currBrandDev = numBrandDev - 1}else{currBrandDev--;}}
				}	
				break;
			case "broadcast":
				if (currBroadcast >= 0){
					if(next){if (currBroadcast == numBroadcast - 1){currBroadcast = 0;}else{currBroadcast++;}}
					else{if (currBroadcast == 0){currBroadcast = numBroadcast - 1}else{currBroadcast--;}}
				}	
				break;
			case "digital":
				if (currDigital >= 0){
					if(next){if (currDigital == numDigital - 1){currDigital = 0;}else{currDigital++;}}
					else{if (currDigital == 0){currDigital = numDigital - 1}else{currDigital--;}}
				}	
				break;
			case "direct":
				if (currDirect >= 0){
					if(next){if (currDirect == numDirect - 1){currDirect = 0;}else{currDirect++;}}
					else{if (currDirect == 0){currDirect = numDirect - 1}else{currDirect--;}}
				}	
				break;
			case "Sales":
				if (currSales >= 0){
					if(next){if (currSales == numSales - 1){currSales = 0;}else{currSales++;}}
					else{if (currSales == 0){currSales = numSales - 1}else{currSales--;}}
				}	
				break;
			case "home":
				if (currHome >= 0){
					if(next){if (currHome == numHome - 1){currHome = 0;}else{currHome++;}}
					else{if (currHome == 0){currHome = numHome - 1}else{currHome--;}}
				}	
				break;
			case "print":
				if (currPrint >= 0){
					if(next){if (currPrint == numPrint - 1){currPrint = 0;}else{currPrint++;}}
					else{if (currPrint == 0){currPrint = numPrint - 1}else{currPrint--;}}
				}	
				break;			
			case "promotion":
				if (currPromotion >= 0){
					if(next){if (currPromotion == numPromotion - 1){currPromotion = 0;}else{currPromotion++;}}
					else{if (currPromotion == 0){currPromotion = numPromotion - 1}else{currPromotion--;}}
				}	
				break;
			case "sales":
				if (currSales >= 0){
					if(next){if (currSales == numSales - 1){currSales = 0;}else{currSales++;}}
					else{if (currSales == 0){currSales = numSales - 1}else{currSales--;}}
				}	
				break;				
			default:
                break;
		}
		loadCreativeMainBox();
}
function hideMainMediumBox(){
	$("#ctl00_ContentPlaceHolder1_divMainBox").animate({width:0,height:0}, 500, function() {
		$("#spanMainBoxClient").html("");
		$("#spanMainBoxCaption").html("");
		$("#spanMainBoxName").html("");
		$("#spanCurrentMainBox").html("");
		$("#spanNumMainBox").html("");
		$("#spanMainBoxTitle").html("");
		$("#spanMainBoxClientURL").html("");
	});
	$("#divContent").slideDown("slow");
	$("#ctl00_ContentPlaceHolder1_imgMainBox").attr("src", "http://www.magnani.com/images/white.png");
}

function inquiriesOurWorkClick(){
    if ($("#divInquiriesInner").css("display") == "none")
    {
		contactMovedDown = true;
	    $(".OurWorkBoxem").animate({"top": "+=213px"}, 600);
	    $("#divFilter").animate({"top": "+=213px"}, 600);
        $("#divInquiriesInner").slideDown("slow");
    }
}
//delete inquiryOurWorkTextClick
function inquiryOurWorkTextClick(){ 
	$("#ctl00_ContentPlaceHolder1_txtInquiryMessage").html("");  //ASP.net renames the conrol using runat=Server
}
// END OUR WORK FUNCTIONS

// BEGIN JOB FUNCTIONS 
function doJobMagic(boxID,innerBoxID){
	if(expand0r != boxID){
		if (expand0r != ""){
			switch(expand0r){
				case "#divJob1": $("#divJob1inner").slideUp("slow"); break;
				case "#divJob2": $("#divJob2inner").slideUp("slow"); break;
				case "#divJob3": $("#divJob3inner").slideUp("slow"); break;
				case "#divJob4": $("#divJob4inner").slideUp("slow"); break;
				case "#divJob5": $("#divJob5inner").slideUp("slow"); break;
				case "#divJob6": $("#divJob6inner").slideUp("slow"); break;
				case "#divJob7": $("#divJob7inner").slideUp("slow"); break;
			} 
		}
		
		switch(boxID) {
			case "#divJob1": $("#divJob1inner").slideDown("slow"); $("html").animate({scrollTop:300}, 1000);break;
			case "#divJob2": $("#divJob2inner").slideDown("slow"); $("html").animate({scrollTop:300}, 1000);break;
			case "#divJob3": $("#divJob3inner").slideDown("slow"); $("html").animate({scrollTop:400}, 1000);break;
			case "#divJob4": $("#divJob4inner").slideDown("slow"); $("html").animate({scrollTop:500}, 1000);break;
			case "#divJob5": $("#divJob5inner").slideDown("slow"); $("html").animate({scrollTop:600}, 1000);break;
			case "#divJob6": $("#divJob6inner").slideDown("slow"); $("html").animate({scrollTop:700}, 1000);break;
			case "#divJob7": $("#divJob7inner").slideDown("slow"); $("html").animate({scrollTop:800}, 1000);break;
		}	
        expand0r = boxID;  		
	}
}
// END JOB FUNCTIONS

// BEGIN CASE STUDY FUNCTIONS
function processClick(){
	if (closeProcess == false) {
		if ($("#ctl00_ContentPlaceHolder1_divProcessInner").css("display") == "none")  //divProcessInner: runat="Server" causes the control to be renamed
		{
			if(booCreativeMovedDown == false){
				//slide all sections underneath down
				$("#ctl00_ContentPlaceHolder1_divProcessInner").slideDown("slow");	//$("#divProcessInner").slideDown("slow");
				$("#imgBlogPlus").hide();
				//$("#imgBlogMinus").show();
				$("#divCreative").animate({top:337+divProcessHeight}, 1000);	//843top : 506 height =  337 : 0 height
				$("#divResultsLogo").animate({top:337+divProcessHeight}, 1000);
			}
			else
			{	
				//minimize Creative section, slide all sections underneath down
				$("#divCreative").animate({top:337+divProcessHeight,left:500,width:218}, 1000);
				$("#imgCreativeMinus").hide();
				$("#divRelatedMaterials").animate({"opacity":"toggle"},1000);
				$("#divRelatedMaterialsRight").animate({"opacity":"toggle"},1000);		

				$("#divCreative").animate({top:337+divProcessHeight}, 1000);
				$("#divResultsLogo").animate({top:337+divProcessHeight}, 1000);
				$("#ctl00_ContentPlaceHolder1_divProcessInner").slideDown("slow");
				$("#imgBlogPlus").hide();
				$("#imgBlogMinus").show();
				$("#divCreativeCopy").animate({"opacity":"toggle"},1000);
				booCreativeMovedDown = false;
			}
		}
	}
	else {closeProcess = false;}
}

function processClickClose() {
	if(booCreativeMovedDown == false){
		//slide all sections underneath down
		$("#ctl00_ContentPlaceHolder1_divProcessInner").slideUp("slow");	//$("#divProcessInner").slideDown("slow");
		$("#imgBlogPlus").show();
		$("#imgBlogMinus").hide();
		$("#divCreative").animate({top:321}, 750);	//843top : 506 height =  337 : 0 height
		$("#divResultsLogo").animate({top:321}, 750);
		closeProcess = true;
	}
}
function creativeClick(){
	if (closeCreative == false) {
		if (booCreativeMovedDown == false)
		{
			if ($("#ctl00_ContentPlaceHolder1_divProcessInner").css("display") != "none")		//divProcessInner
			{
				$("html").animate({scrollTop:150}, 1000);
				$("#ctl00_ContentPlaceHolder1_divProcessInner").slideUp("slow");
				$("#imgBlogPlus").show()
				$("#imgBlogMinus").hide()
			}
			//move up and expand Creative section, slide sections underneath
			$("#divResultsLogo").animate({top:829}, 1000);	//949
			$("#divRelatedMaterials").animate({"opacity":"toggle"},1000);
			$("#divRelatedMaterialsRight").animate({"opacity":"toggle"},1000);
			$("#divCreative").animate({top:321,left:254,width:464}, 1000); 
			$("#divCreativeCopy").animate({"opacity":"toggle"},1000); 
			$("#imgCreativeMinus").show()
			booCreativeMovedDown = true;
		}
	}
	else {closeCreative = false;}
}

function creativeClickClose() {
	closeCreative = true;
	$("#divResultsLogo").animate({top:321}, 1000);	//949
	$("#divRelatedMaterials").animate({"opacity":"toggle"},1000);
	$("#divRelatedMaterialsRight").animate({"opacity":"toggle"},1000);
	$("#divCreative").animate({top:321,left:500,width:218}, 1000); 
	$("#divCreativeCopy").animate({"opacity":"toggle"},1000); 
	$("#imgCreativeMinus").hide()
	booCreativeMovedDown = false;
}

function nextCaseStudyCreative(next){	
	if (next){currCreative++;}else{currCreative--;}
	
    switch (currCreative) 
    {
		case 0:
            $("#divCreativePrev").hide();
            break;   
        case numCreative - 1:
			$("#divCreativePrev").show();
            $("#divCreativeNext").hide()
            break;    
        default:
            $("#divCreativePrev").show();
			$("#divCreativeNext").show();
            break;
    }
	
	$("#ctl00_ContentPlaceHolder1_imgCreative").animate({"opacity":"toggle"},500);
	$("#spanCreativeCopy").animate({"opacity":"toggle"},500,function(){
        loadCaseStudyCreative(currCreative);
		$("#spanCreativeCopy").animate({"opacity":"toggle"},500);
		$("#ctl00_ContentPlaceHolder1_imgCreative").animate({"opacity":"toggle"},500);
    });
}

function loadCaseStudyCreative(index){
    $("#ctl00_ContentPlaceHolder1_imgCreative").attr("src", "../../../../../assets/Case_Study/" + arrCreative[index]);
	$("#spanCreativeCopy").html("");
	if (currCreative == (numCreative - 1)) {$("#divCreativeNext").hide();} 
}

// END CASE STUDY FUNCTIONS

function loadURLs(level){
	var prefix = "";
	
	switch(level){
		case 0: prefex = ""; break;
		case 1: prefix = "../"; break;
		case 2: prefix = "../../"; break;
		case 3: prefix = "../../../"; break;
		case 4: prefix = "../../../../"; break;
		case 5: prefix = "../../../../../"; break;
		case 6: prefix = "../../../../../../"; break;
		default:
			break;
	}
	
	$("#aHome").attr("href", prefix + "index.aspx");
	$("#imgChat").attr("src", prefix + "images/icons/chat_icon.png");
	$("#imgSearch").attr("src", prefix + "images/icons/search_icon.png");
	$("#ctl00_btnSubmit").attr("src", "/" + prefix + "Images/submit.png");
	$("#imgOurWorkPlus").attr("src", prefix + "images/icons/plus_sign_white.png");
	$("#aOurWorkImg").attr("href", prefix + "Our_Work/index.aspx");
	$("#aTeamLeads").attr("href", prefix + "Who_We_Are/Team_Leads/index.aspx");
	$("#aSiteMap").attr("href", prefix + "sitemap.aspx");

}

function loadStylesheetHome(newStylesheet){
	loadStylesheet(newStylesheet);
	loadStylesheetImages(newStylesheet);	
}
function loadStylesheet(newStylesheet) {
	defaultSheet = document.getElementById("cssDefault"); 
	blueSheet = document.getElementById("cssBlue"); 
	orangeSheet = document.getElementById("cssOrange"); 
	greenSheet = document.getElementById("cssGreen"); 
	graySheet = document.getElementById("cssGray"); 
	
	switch(newStylesheet) {
	
		case "cssDefault":
			defaultSheet.disabled = false;
			blueSheet.disabled = true;
			orangeSheet.disabled = true;
			greenSheet.disabled = true;
			graySheet.disabled = true;

			break;
		
		case "cssBlue":
			blueSheet.disabled = false;
			defaultSheet.disabled = true;
			orangeSheet.disabled = true;
			greenSheet.disabled = true;
			graySheet.disabled = true;
			break;
			
		case "cssOrange":
			orangeSheet.disabled = false;
			defaultSheet.disabled = true;
			blueSheet.disabled = true;
			greenSheet.disabled = true;
			graySheet.disabled = true;
			break;
			
		case "cssGreen":
			greenSheet.disabled = false;
			defaultSheet.disabled = true;
			blueSheet.disabled = true;
			orangeSheet.disabled = true;
			graySheet.disabled = true;
			break;

		case "cssGray":
			graySheet.disabled = false;
			defaultSheet.disabled = true;
			blueSheet.disabled = true;
			orangeSheet.disabled = true;
			greenSheet.disabled = true;
			break;
			
		default:
			break;
	}
	createCookie("cookieStyle",newStylesheet,1)
	//loadNiftyCorners();
}
function loadStylesheetImages(newStylesheet) {
	switch(newStylesheet) {
	
		case "cssDefault": $("#imgMapOverlay").attr("src", "images/home_overlay_map.jpg"); break;
		case "cssBlue": $("#imgMapOverlay").attr("src", "images/home_overlay_mapBlue.jpg"); break;			
		case "cssOrange": $("#imgMapOverlay").attr("src", "images/home_overlay_mapOrange.jpg"); break;	
		case "cssGreen": $("#imgMapOverlay").attr("src", "images/home_overlay_mapGreen.jpg"); break;	
		case "cssGray":$("#imgMapOverlay").attr("src", "images/home_overlay_mapGray.jpg"); break;
		default: break;
	}
}
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(";");
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==" ") c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

//BEGIN TESTIMONIALS FUNCTIONS
function ExpandTestimonial(id) {
	
	var currID = currTestimonial;
	
	//close open testimonial, if any
	if (currTestimonial != 0 ) {
		switch (currTestimonial) {
			case 1:
				$("#divTest1Inner").animate({height:70}, 1000); 
				$("#ctl00_ContentPlaceHolder1_divT1Copy").animate({height:20}, 1000); 
				$("#divT1More").show(); 
				$("#spanT1More").show(); 
				currTestimonial = 0;
				break;
			case 2:
				$("#divTest2Inner").animate({height:115}, 1000); 
				$("#ctl00_ContentPlaceHolder1_divT2Copy").animate({height:60}, 1000); 
				$("#divT2More").show(); 
				$("#spanT2More").show(); 
				currTestimonial = 0;
				break;
			case 3:
				$("#divTest3Inner").animate({height:70}, 1000); 
				$("#ctl00_ContentPlaceHolder1_divT3Copy").animate({height:20}, 1000); 
				$("#divT3More").show(); 
				$("#spanT3More").show(); 
				currTestimonial = 0;
				break;
			case 4:
				$("#divTest4Inner").animate({height:115}, 1000); 
				$("#ctl00_ContentPlaceHolder1_divT4Copy").animate({height:60}, 1000); 
				$("#divT4More").show(); 
				$("#spanT4More").show(); 
				currTestimonial = 0;
				break;
		}
	}
	
	//open testimonial
	if (id != currID) {
		switch (id) {
			case 1:
				$("#divTest1Inner").animate({height:30 + t1height}, 1000); 
				$("#ctl00_ContentPlaceHolder1_divT1Copy").animate({height:t1height}, 1000); 
				$("#divT1More").hide(); 
				$("#spanT1More").hide(); 
				currTestimonial = 1;
				break;
			case 2:
				$("#divTest2Inner").animate({height:30 + t2height}, 1000); 
				$("#ctl00_ContentPlaceHolder1_divT2Copy").animate({height:t2height}, 1000); 
				$("#divT2More").hide(); 
				$("#spanT2More").hide(); 
				currTestimonial = 2;
				break;
			case 3:
				$("#divTest3Inner").animate({height:30 + t3height}, 1000); 
				$("#ctl00_ContentPlaceHolder1_divT3Copy").animate({height:t3height}, 1000); 
				$("#divT3More").hide(); 
				$("#spanT3More").hide(); 
				currTestimonial = 3;
				break;
			case 4:
				$("#divTest4Inner").animate({height:30+t4height}, 1000); 
				$("#ctl00_ContentPlaceHolder1_divT4Copy").animate({height:t4height}, 1000); 
				$("#divT4More").hide(); 
				$("#spanT4More").hide(); 
				currTestimonial = 4;
				break;
		}
	}
}



//END TESTIMONIALS FUNCTIONS

	function ValidateInquiryForm(source, arguments)
	{
		var booValid=new Boolean(true);
		var entryMsg = document.getElementById("ctl00_txtInquiryMessage").value;
		var entryName = document.getElementById("ctl00_txtInquiryName").value;
		var entryEmail = document.getElementById("ctl00_txtInquiryEmail").value;
		
		if (entryMsg=="Type here"){ booValid = false;}
		if (entryName=="NAME") {booValid = false;}
		if (entryEmail=="E-MAIL") {booValid = false;}
		
		if (!booValid) {
			jAlert('Please complete all fields.', 'Magnani Continuum Marketing');
		}
		arguments.IsValid = booValid;	
	}
	function ValidateInquiryFormOurWork(source, arguments)
	{
		var booValid=new Boolean(true);
		var entryMsg = document.getElementById("ctl00_ContentPlaceHolder1_txtInquiryMessage").value;
		var entryName = document.getElementById("ctl00_ContentPlaceHolder1_txtInquiryName").value;
		var entryEmail = document.getElementById("ctl00_ContentPlaceHolder1_txtInquiryEmail").value;
		
		if (entryMsg=="Type here"){ booValid = false;}
		if (entryName=="NAME") {booValid = false;}
		if (entryEmail=="E-MAIL") {booValid = false;}
		
		if (!booValid) {
			jAlert('Please complete all fields.', 'Magnani Continuum Marketing');
		}
		arguments.IsValid = booValid;	
	}
	function TextBoxExit(controlID, msg)
	{
		var controlBox = document.getElementById(controlID)
		if (controlBox.value==""){controlBox.value = msg;}			
	}
	function TextBoxEnter(controlID, msg)
	{
		var controlBox = document.getElementById(controlID)
		if (controlBox.value==msg){controlBox.value = "";}			
	}	
