function findTheQuery() {
	var getBack = String (document.location.href).split ('?')[1];
	//window.alert(getBack);
	return getBack;
}

function findTheID() {
	var getBack = String (document.location.href).split ('?')[1];
	var justID = getBack.substring(3);
	//window.alert(justID);
	return justID;
}

function getFlashMovieObject(movieName) {
  	if (navigator.appName.indexOf("Microsoft Internet")==-1)
  	{
		return document.embeds[movieName];
	}
  	else //if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  	{
		return document.forms[0][movieName];
  	}
}

function sspLoadStory(storyID) {
	getFlashMovieObject("thePics").sspLoadStory(storyID);
}

function sspLoadFeaturePic(picID) {
	getFlashMovieObject("featurePics").sspLoadPic(picID);
}

function sspLoadPic(picID) {
	getFlashMovieObject("thePics").sspLoadPic(picID);
}

function loadNewXML(thetype) {
	getFlashMovieObject("thePics").loadNewXML(thetype);
}

function playAudio(audioName,audioTitle) {
	$("#newMediaPlayer").animate({height:"86px"}, 500);
	getFlashMovieObject("theAudio").playAudio(audioName,audioTitle);
}

function playBulletin(audioName,audioTitle) {
	$("#newMediaPlayer").animate({height:"86px"}, 500);
	getFlashMovieObject("theAudio").playBulletin(audioName,audioTitle);
}
	
function playVideo(videoName,videoTitle) {
	getFlashMovieObject("theAudio").playVideo(videoName,videoTitle);
}

function playVideoFull(videoName,videoTitle) {
	$("#newMediaPlayer").animate({height:"386px"}, 500);
	getFlashMovieObject("theAudio").playVideo(videoName,videoTitle);
}

function resizeMediaDiv(size) {
	$("#newMediaPlayer").animate({height:size}, 500);	
}

function headlineListLoad(theQuery) {
	$("#headlinesList").fadeOut(200, 
		function() {
			$("#headlinesList").load('headlines.asp?'+theQuery,
				function() {
					$("#headlinesList").fadeIn(200); 
				}
			);
		}
	)
}

function mediaListLoad(whichType) {
	var startHeight = $("#audioList").height();
	$("#audioList").fadeOut(200, 
		function() {
			$("#audioListFaker").css("height",startHeight)
			$("#audioList").load('multimedia.asp?type='+whichType,
				function() {
					$("#audioListFaker").css("height","auto")
					$("#audioList").fadeIn(200);
				}
			);
		}
	)
}

function IWListLoad(whichType) {
	var IWstartHeight = $("#iwitnessList").height();
	$("#iwitnessList").fadeOut(200, 
		function() {
			$("#iWitnessFaker").css("height",IWstartHeight)
			$("#iwitnessList").load('iwitness.asp?type='+whichType,
				function() {
					$("#iWitnessFaker").css("height","auto")
					$("#iwitnessList").fadeIn(200);
				}
									
			);
			
		}
	)
}

function tagLoad(whichTag) {
	$("#otherNews").fadeOut(200, 
		function() {
			$("#otherNews").load('headlines.asp?type='+whichType,
				function() {
					$("#otherNews").fadeIn(200);
				}
			);
		}
	)
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function tagcloud(whichTerm) {
	//var startHeight = $("#othernewsList").height();
	$("#othernewsList").fadeOut(200, 
		function() {
			//$("#othernewsList").css("height",startHeight)
			$("#othernewsList").load('tagcloud.asp?term='+whichTerm,
				function() {
					//$("#audioListFaker").css("height","auto")
					$("#othernewsList").fadeIn(200);
				}
			);
		}
	)
}

 function showStory(whichPicture,location,caption) {
		$('#rotateImg').attr("src",whichPicture); $('.ic_text').html('<h3>'+location+'</h3>'+caption); return false;   
}
