//<script>
//*****************************************************************************
// SCRIPT:    pickering.js
// PURPOSE:   Contains the javascript used in the Lynette Pickering web.
//*****************************************************************************
var isNav = (navigator.appName.indexOf("Netscape")  != -1);
var isIE  = (navigator.appName.indexOf("Microsoft") != -1);
//switches the passed in image object source with the passed in source.
function switchImage(objImage, strNewImageSrc)
{
	objImage.src = strNewImageSrc;
	objImage.style.cursor="hand";
}

//parses the passed in address and city replacing spaces with "+"
//then creates url to mapquest and opens a new window for mapquest wtih the address information.
function gotoMapQuest(sAddress, sCity, sState)
{
       sAddress += ""; 
       sCity += ""; 
       sState += ""; 

        var strAttrs = "left=20,top=30, status=yes, toolbar=yes, scrollbars=yes, menubar=yes, " +
	     " resizable=yes, width=880,height=650";
	     var sUrl = "http://www.mapquest.com/directions/main.adp?";
    
        sAddress = stringReplace(sAddress, " ", "+"); 
        if (sAddress.length > 0) sUrl += "2a=" + sAddress + "&"; 

        sCity = stringReplace(sCity, " ", "+"); 
        if (sCity.length > 0) sUrl += "2c=" + sCity + "&"; 
        if (sState.length > 0) sUrl += "2s=" + sState + "&"; 
        
        sUrl += "cid=lfddlink"; 
	    window.open(sUrl, "", strAttrs); 
    
}

//find and replace the sFindText with the sReplaceText within the sOrigString
function stringReplace(sOrigString, sFindText, sReplaceText)
{
   var ipos = 0;
   var ilen = sFindText.length;
   var sPreString = "";
   var sPostString = "";
   
   ipos = sOrigString.indexOf(sFindText);
   while (ipos != -1)
   {
     sPreString = sOrigString.substring(0, ipos);
     sPostString = sOrigString.substring(ipos+ilen, sOrigString.length);
     sOrigString = sPreString + sReplaceText + sPostString;
     ipos = sOrigString.indexOf(sFindText); 
   } 

   return sOrigString;
}

//display hidden passed in object
function showObject(id) 
{  
	var obj =  eval("document.all['" + id + "']");
	if (typeof obj == "object")	
   { 
		if (isNav) 
		{ 
			document.layers[id].visibility = "show";
		}
		else if (isIE) 
		{
			obj.style.visibility = "visible"; 
			obj.style.display = "block";
		}
   }
}


//hide product list DIV
function hideObject(id) 
{  
	var obj =  eval("document.all['" + id + "']");
	if (typeof obj == "object")	
   { 
		if (isNav) 
		{ 
			document.layers[id].visibility = "hide";
		}
		else if (isIE) 
		{
			obj.style.visibility = "hidden"; 
			obj.style.display = "none";
		}
   }
}

//show this list of songs associated with this cd
function showSongs(obj)
{
	var objId =  obj.id + "_SONGLIST";
	var objImg =  eval("document.all['" + obj.id + "_IMG']");

	if (typeof obj == "object")	
   { 
		if (obj.DIVOPEN == "NO")
		{
			showObject(objId);
			obj.DIVOPEN="YES";
			switchImage(objImg, "images/arrowup.jpg")
		}
		else
		{
			hideObject(objId);
			obj.DIVOPEN="NO";
			switchImage(objImg, "images/arrowdown.jpg")
		}
	}
}

//play the selected music
function playMusicSongs(obj)
{
	alert("play some tunes")
}

// This function is used to handle to display the specials page(s).
function showCDDetails(strObjId)
{
	var strToUrl = "";
	var strObjId = strObjId.toUpperCase();
	var i = -1;
	var strId = "";
	var strAttrs = "";

	switch (strObjId)
	{
		case "INSIDEOUT":
	    {
	    	strToUrl = "insideout.aspx";
	    	break;
	    }
	    case "LETTINLOOSE":
	    {
	    	strToUrl = "lettinloose.aspx";
	    	break;
		}
	    default:
	    {
			alert("The " + objId.id + " page is currently not available.");
			break;
	    }  
	}
	if (strToUrl != "")
	{
	    //Display the selected picture.
		//window.location.href=strToUrl;
	    strAttrs = "left=50,top=30, status=yes, toolbar=no, scrollbars=yes, menubar=yes, resizable=yes, " +
	    	" width=780,height=550";

		window.open(strToUrl, "", strAttrs);
	}
}

// This function is used to display the lyrics for a specific song in a pop up window.
function showLyrics(strToUrl)
{
	var strAttrs = "";

	if (strToUrl != "")
	{
	    //Display the selected picture.
		//window.location.href=strToUrl;
	    strAttrs = "left=70,top=50, status=yes, toolbar=no, scrollbars=yes, menubar=yes, resizable=yes, " +
	    	" width=800,height=550";

		window.open(strToUrl, "", strAttrs);
	}
}

// Writes out the title of the song
function writeSongTitle(strRequestedSong, strFromCD)
{
	var strSong = strRequestedSong.toUpperCase();
	var strCD = strFromCD.toUpperCase();
	var strTitle = "";
	var strSubTitle = "";


	switch (strSong)
	{
		case "SUPERWOMAN":
	    {
			strTitle = "I'm Super Woman";
			break;
		}
		case "PETPEEVES":
	    {
			strTitle = "My Favorite Pet Peeves";
			break;
		}
		case "IALWAYSTELLMYCHILDREN":
	    {
			strTitle = "I Always Tell My Children";
			break;
		}
		case "THESOUNDOFCHILDREN":
	    {
			strTitle = "The Sound of Children";
			break;
		}
		case "APOEMABOUTMYCAR":
	    {
			strTitle = "A Poem About My Car";
			break;
		}
		case "IENJOYBEINGAMOM":
	    {
			strTitle = "I Enjoy Being A Mom";
			break;
		}
		case "CARPOOLMOM":
	    {
			strTitle = "Take Me Here and There Car Pool Mom";
			break;
		}
		case "SUMMERTIME":
	    {
			strTitle = "Summertime, No Break for Mama";
			break;
		}
		case "BOYSRAP":
	    {
			strTitle = "Boys Rap";
			break;
		}
		case "TAKINGCAREOFCHILDREN":
	    {
			strTitle = "Taking Care of Children";
			break;
		}
		case "ASTRANGERLIVING":
	    {
			strTitle = "A Stranger Living In My House";
			break;
		}
		case "TEENAGERSTHEYWILLBE":
	    {
			strTitle = "Teenagers They Will Be";
			break;
		}
		case "ICOULDHAVECOOKED":
	    {
			strTitle = "I Could Have Cooked All Night";
			break;
		}
		case "IHADABRAIN":
	    {
			strTitle = "If They Thought I Had A Brain";
			break;
		}
		case "COMESATURDAYMORNING":
	    {
			strTitle = "Come Saturday Morning";
			break;
		}
		case "18HOLES":
	    {
			strTitle = "18 Holes";
			break;
		}
		case "CLIMBLAUNDRYMOUNTAIN":
	    {
			strTitle = "Climb Laundry Mountain";
			break;
		}
		case "CRAZY":
	    {
			strTitle = "Crazy For High Fatty Foods";
			break;
		}
		case "JUSTASHOPPER":
	    {
			strTitle = "I'm Just A Shopper Who Can't Say No";
			break;
		}
		case "SOMEWHERE":
	    {
			strTitle = "Somewhere Over The Hill Now";
			break;
		}
		case "WHY":
	    {
			strTitle = "Why?";
			break;
		}
		case "GODESTEEM":
	    {
			strTitle = "God Esteem";
			break;
		}
		case "WHATADEAL":
	    {
			strTitle = "What A Deal, It's A Steal";
			break;
		}
		case "INTHEMIRROR":
	    {
			strTitle = "In The Mirror";
			break;
		}
		case "THISISTHEDAY":
	    {
			strTitle = "This Is The Day (Sing-a-long)";
			break;
		}
		case "DIETSCANT":
	    {
			strTitle = "Diets Can't Keep Us Thinner";
			break;
		}
		case "BLOATED":
	    {
			strTitle = "I Feel Bloated";
			break;
		}
		case "MILDEW":
	    {
			strTitle = "Showers of Mildew";
			break;
		}
		case "ANYOTHERWAY":
	    {
			strTitle = "I Wouldn't Have It Any Other Way";
			break;
		}
		case "SPRINGCLEAN":
	    {
			strTitle = "If Ever I Would Spring Clean";
			break;
		}		
		case "BUNCOBABES":
	    {
			strTitle = "Bunco Babes";
			break;
		}
		//Begin Inside Out
			    
		case "ASTHEDEER":
	    {
			strTitle = "As The Deer Panteth";
	    	break;
	    }
	    case "GRANDPA":
	    {
			strTitle = "Grandpa";
	    	break;
	    }
	    case "MIDNIGHTCRY":
	    {
			strTitle = "Midnight Cry";
	    	break;
	    }
	    case "REBA":
	    {
			strTitle = "Reba";
	    	break;
	    }
	    case "CARRYON":
	    {
			strTitle = "Carry On";
	    	break;
	    }
	    case "INSIDEOUT":
	    {
			strTitle = "Inside Out";
	    	break;
	    }
	    case "IWANTTOKNOWYOUMORE":
	    {
			strTitle = "Oh, I Want To Know You More";
	    	break;
	    }
	    case "YOUARETHERE":
	    {
			strTitle = "You Are There";
	    	break;
	    }
	    case "GODFORBID":
	    {
			strTitle = "God Forbid";
	    	break;
	    }
	    case "LIGHTOFTHEWORLD":
	    {
			strTitle = "Jesus, Light of the World";
	    	break;
	    }
	    case "POURONTHEPOWER":
	    {
			strTitle = "Pour on the Power";
	    	break;
	    }
	    //begin Upward View
		
	    default:
	    {
			strTitle = "";
			break;
	    }  
	}
	
	switch (strCD)
	{
		case "LETTINLOOSE_MOTHERLODE":
	    {
			strSubTitle = "from the <b>Mother Lode</b> disc on the <b>Lettin' Loose</b> CD";
			break;
		}
		case "LETTINLOOSE_IAMWOMAN":
	    {
			strSubTitle = "from the <b>I Am Woman</b> disc on the <b>Lettin' Loose</b> CD";
			break;
		}
		case "INSIDEOUT":
	    {
			strSubTitle = "from the <b>Inside Out</b> CD";
			break;
		}
		case "UPWARDVIEW":
	    {
			strSubTitle = "from the <b>Upward View</b> CD";
			break;
		}
	    default:
	    {
			break;
	    }  
	}

	document.writeln('<div class="songpagetitle">"' + strTitle + '"</div>');
	document.writeln('<div class="songpagesubtitle">' + strSubTitle + '</div>');
}



// This function is used to display the lyrics for a specific song in a pop up window.
function writeSongLyrics(strRequestedSong)
{
	var strSong = strRequestedSong.toUpperCase();
	var strLyrics = "";

	switch (strSong)
	{
		case "SUPERWOMAN":
	    {
			strLyrics = writeSuperwomanlyrics();
	    	break;
	    }
		case "PETPEEVES":
	    {
			strLyrics = writePetPeevesLyrics();
	    	break;
	    }
		case "IALWAYSTELLMYCHILDREN":
	    {
			strLyrics = writeIAlwaysTellMyChildren();
	    	break;
	    }
		case "THESOUNDOFCHILDREN":
	    {
			strLyrics = writeTheSoundofChildren();
	    	break;
	    }
	    case "APOEMABOUTMYCAR":
	    {
			strLyrics = writeAPoemAboutMyCar();
	    	break;
	    }
	    case "IENJOYBEINGAMOM":
	    {
			strLyrics = writeIEnjoyBeingAMom();
	    	break;
	    }
	    case "CARPOOLMOM":
	    {
			strLyrics = writeCarPoolMom();
	    	break;
	    }
	    case "SUMMERTIME":
	    {
			strLyrics = writeSummertime();
	    	break;
	    }
	    case "BOYSRAP":
	    {
			strLyrics = writeBoysRap();
	    	break;
	    }
	    case "TAKINGCAREOFCHILDREN":
	    {
			strLyrics = writeTakingCareofChildren();
	    	break;
	    }
	    case "ASTRANGERLIVING":
	    {
			strLyrics = writeAStrangerLiving();
	    	break;
	    }
	    case "TEENAGERSTHEYWILLBE":
	    {
			strLyrics = writeTeenagersTheyWillBe();
	    	break;
	    }
	    case "ICOULDHAVECOOKED":
	    {
			strLyrics = writeICouldHaveCooked();
	    	break;
	    }
	    case "IHADABRAIN":
	    {
			strLyrics = writeIHadABrain();
	    	break;
	    }
	    case "COMESATURDAYMORNING":
	    {
			strLyrics = writeComeSaturdayMorning();
	    	break;
	    }
	    case "18HOLES":
	    {
			strLyrics = write18Holes();
	    	break;
	    }
	    case "CLIMBLAUNDRYMOUNTAIN":
	    {
			strLyrics = writeClimbLaundryMoutain();
	    	break;
	    }
	    case "CRAZY":
	    {
			strLyrics = writeCrazy();
	    	break;
	    }	    
	    case "JUSTASHOPPER":
	    {
			strLyrics = writeJustAShopper();
	    	break;
	    }
	    case "SOMEWHERE":
	    {
			strLyrics = writeSomewhere();
	    	break;
	    }
	    case "WHY":
	    {
			strLyrics = writeWhy();
	    	break;
	    }
	    case "GODESTEEM":
	    {
			strLyrics = writeGodEsteem();
	    	break;
	    }
	    case "WHATADEAL":
	    {
			strLyrics = writeWhatADeal();
	    	break;
	    }
	    case "INTHEMIRROR":
	    {
			strLyrics = writeInTheMirror();
	    	break;
	    }
	    case "THISISTHEDAY":
	    {
			strLyrics = writeThisIsTheDay();
	    	break;
	    }
	    case "DIETSCANT":
	    {
			strLyrics = writeDietsCant();
	    	break;
	    }
	    case "BLOATED":
	    {
			strLyrics = writeBloated();
	    	break;
	    }
	    case "MILDEW":
	    {
			strLyrics = writeMildew();
	    	break;
	    }
	    case "ANYOTHERWAY":
	    {
			strLyrics = writeAnyOtherWay();
	    	break;
	    }
	    case "SPRINGCLEAN":
	    {
			strLyrics = writeSpringClean();
	    	break;
	    }
	    case "BUNCOBABES":
	    {
			strLyrics = writeBuncoBabes();
	    	break;
	    }
	    //Begin Inside Out
	    case "ASTHEDEER":
	    {
			strLyrics = writeAsTheDeer();
	    	break;
	    }
	    case "GRANDPA":
	    {
			strLyrics = writeGrandpa();
	    	break;
	    }
	    case "MIDNIGHTCRY":
	    {
			strLyrics = writeMidnightCry();
	    	break;
	    }
	    case "REBA":
	    {
			strLyrics = writeReba();
	    	break;
	    }
	    case "CARRYON":
	    {
			strLyrics = writeCarryOn();
	    	break;
	    }
	    case "INSIDEOUT":
	    {
			strLyrics = writeInsideOut();
	    	break;
	    }
	    case "IWANTTOKNOWYOUMORE":
	    {
			strLyrics = writeIWantToKnowYouMore();
	    	break;
	    }
	    case "YOUARETHERE":
	    {
			strLyrics = writeYouAreThere();
	    	break;
	    }
	    case "GODFORBID":
	    {
			strLyrics = writeGodForbid();
	    	break;
	    }
	    case "LIGHTOFTHEWORLD":
	    {
			strLyrics = writeLightOfTheWorld();
	    	break;
	    }
	    case "POURONTHEPOWER":
	    {
			strLyrics = writePourOnThePower();
	    	break;
	    }
	    //begin Upward View
   
	    default:
	    {
			alert("The requested song is currently not available.");
			break;
	    }  
	}
	
	
	if (strLyrics != "")
	{
			document.writeln('<div class="musicbox">');
			document.writeln('<div class="songwords">');
			document.writeln(strLyrics);
			document.writeln('</div>');
			document.writeln('</div>');
	}

}

// This function is used to display the copyright information for a specific song in a pop up window.
function writeSongCopyright(strRequestedSong)
{
	var strSong = strRequestedSong.toUpperCase();
	var strYear = "";

	switch (strSong)
	{
		case "SUPERWOMAN":
	    {
			strYear = "1997";
	    	break;
	    }
		case "PETPEEVES":
	    {
			strYear = "1997";
	    	break;
	    }
		case "IALWAYSTELLMYCHILDREN":
	    {
			strYear = "2003";
	    	break;
	    }		
	    case "THESOUNDOFCHILDREN":
	    {
			strYear = "1998";
	    	break;
	    }
	    case "APOEMABOUTMYCAR":
	    {
			strYear = "2003";
	    	break;
	    }
	    case "IENJOYBEINGAMOM":
	    {
			strYear = "1997";
	    	break;
	    }
	    case "CARPOOLMOM":
	    {
			strYear = "1997";
	    	break;
	    }
	    case "SUMMERTIME":
	    {
			strYear = "1997";
	    	break;
	    }
	    case "BOYSRAP":
	    {
			strYear = "1998";
	    	break;
	    }
	    case "TAKINGCAREOFCHILDREN":
	    {
			strYear = "1997";
	    	break;
	    }
	    case "ASTRANGERLIVING":
	    {
			strYear = "2003";
	    	break;
	    }
	    case "TEENAGERSTHEYWILLBE":
	    {
			strYear = "2003";
	    	break;
	    }
	    case "ICOULDHAVECOOKED":
	    {
			strYear = "2003";
	    	break;
	    }
	    case "IHADABRAIN":
	    {
			strYear = "2004";
	    	break;
	    }
	    case "COMESATURDAYMORNING":
	    {
			strYear = "1997";
	    	break;
	    }
	    case "18HOLES":
	    {
			strYear = "1997";
	    	break;
	    }
	    case "CLIMBLAUNDRYMOUNTAIN":
	    {
			strYear = "1997";
	    	break;
	    }
	    case "CRAZY":
	    {
			strYear = "1997";
	    	break;
	    }
	    case "JUSTASHOPPER":
	    {
			strYear = "1997";
	    	break;
	    }
	    case "SOMEWHERE":
	    {
			strYear = "1999";
	    	break;
	    }
	    case "WHY":
	    {
			strYear = "2003";
	    	break;
	    }
	    case "GODESTEEM":
	    {
			strYear = "1997";
	    	break;
	    }
	    case "WHATADEAL":
	    {
			strYear = "2003";
	    	break;
	    }
	    case "INTHEMIRROR":
	    {
			strYear = "2003";
	    	break;
	    }
	    case "THISISTHEDAY":
	    {
			strYear = "1998";
	    	break;
	    }
	    case "DIETSCANT":
	    {
			strYear = "2004";
	    	break;
	    }
	    case "BLOATED":
	    {
			strYear = "1997";
	    	break;
	    }
	    case "MILDEW":
	    {
			strYear = "1997";
	    	break;
	    }
	    case "ANYOTHERWAY":
	    {
			strYear = "2003";
	    	break;
	    }
	    case "SPRINGCLEAN":
	    {
			strYear = "1997";
	    	break;
	    }
	    case "BUNCOBABES":
	    {
			strYear = "2003";
	    	break;
	    }
	    case "GRANDPA":
	    {
			document.writeln('<div class="songfooter">');
			document.writeln('&copy 1985 by Cross Keys Publishing Co., Inc.');
			document.writeln('</div>');
			
			strYear = "";
			break;
	    }
	    case "REBA":
	    {
			strYear = "1997";
	    	break;
	    }
	    case "INSIDEOUT":
	    {
			strYear = "1997";
	    	break;
	    }
	    case "IWANTTOKNOWYOUMORE":
	    {
			document.writeln('<div class="songfooter">');
			document.writeln('&copy 1983 Brdwing Music/Cherry Lane Music Publishing Co., Inc');
			document.writeln('</div>');
			
			strYear = "";
			break;
	    }
	    case "YOUARETHERE":
	    {
			document.writeln('<div class="songfooter">');
			document.writeln('&copy 1983 by Belwin-Mills Publishing Corp. 25 Deshon Drive, Melville, N.Y. 11747');
			document.writeln('</div>');
			
			strYear = "";
			break;
	    }
	    case "GODFORBID":
	    {
			document.writeln('<div class="songfooter">');
			document.writeln('&copy 1996 Careers/BMG Music Publishing, Inc. (Gospel Div.)Final Four Music/BMG Songs, Inc.');
			document.writeln('</div>');
			
			strYear = "";
			break;
	    }
	    case "LIGHTOFTHEWORLD":
	    {
			strYear = "1997";
	    	break;
	    }
	    case "POURONTHEPOWER":
	    {
			document.writeln('<div class="songfooter">');
			document.writeln('&copy 1984, 1985 Paragon Music Corp./ASCAP Bug and Bear Music/ASCAP, and Word Music (a div. of WORD. INC.)');
			document.writeln('</div>');
			
			strYear = "";
			break;
	    }
	    default:
	    {
			strYear = "";
			break;
	    }  
	}
	
	if (strYear != "")
	{
			document.writeln('<div class="songfooter">');
			document.writeln('LynettePickering &copy ' + strYear);
			document.writeln('</div>');
	}

}

// This function is used to display a new page with a slide show of gastric bypass photos.
function showGBSPhotos()
{
	var strAttrs = "left=50,top=30, status=yes, toolbar=no, scrollbars=yes, menubar=yes, " +
	  " resizable=yes, width=780,height=780";

	window.open('gbs.aspx', "", strAttrs);
}

function getCurrentFlashVerision()
{
    var version = deconcept.SWFObjectUtil.getPlayerVersion();

    if (document.getElementById && (version['major'] > 0)) {
        document.getElementById('flashversion').innerHTML = "You have Flash player " + version['major'] + "." + version['minor'] + "." + version['rev'] + " installed.";
	}
}
