//Writes out the generic video embed code on the main page - should make this encompass the second script as well
function writeFlash(swfType, filepath, thumbnail, strHeight, strWidth){

	var strEmbed="<embed src='"+swfType+"' width='"+strWidth+"' height='"+strHeight+"' allowfullscreen='true' bgcolor='#000000' flashvars='&file="+filepath+"&height="+strHeight+"&image="+thumbnail+"&width="+strWidth+"&location="+swfType+"&background-color=#000000' />";
	var flashDiv=document.getElementById("flashcontent");

	flashDiv.innerHTML=strEmbed;
}

//Writes out the generic video embed code on the main page - should make this encompass the second script as well
function writeNewFlash(swfType, filepath, thumbnail, strHeight, strWidth){

	var strEmbed="<embed src='"+swfType+"' width='"+strWidth+"' height='"+strHeight+"' allowfullscreen='true' bgcolor='#000000' autostart='true' flashvars='&file="+filepath+"&height="+strHeight+"&image="+thumbnail+"&width="+strWidth+"&location="+swfType+"&background-color=#000000&autostart=true' />";
	var flashDiv=document.getElementById("flashcontent");

	flashDiv.innerHTML=strEmbed;
}

//Writes out the second video embed code on the main page
function writeNewFlashMain(swfType, filepath, thumbnail, strHeight, strWidth, divID){
	var strEmbed="<embed src='"+swfType+"' width='"+strWidth+"' height='"+strHeight+"' allowfullscreen='true' bgcolor='#000000' autostart='true' flashvars='&file="+filepath+"&height="+strHeight+"&image="+thumbnail+"&width="+strWidth+"&location="+swfType+"&background-color=#000000&autostart=true' />";
	var flashDiv=document.getElementById(divID);

	flashDiv.innerHTML=strEmbed;
}


//Writes out the second video embed code on the main page
function writeFlashMain(swfType, filepath, thumbnail, strHeight, strWidth, divID){
	var strEmbed="<embed src='"+swfType+"' width='"+strWidth+"' height='"+strHeight+"' allowfullscreen='true' bgcolor='#000000' flashvars='&file="+filepath+"&height="+strHeight+"&image="+thumbnail+"&width="+strWidth+"&location="+swfType+"&background-color=#000000' />";
	var flashDiv=document.getElementById(divID);

	flashDiv.innerHTML=strEmbed;
}

//opens a URL to the parent window
function openParent (url) {
if (window.opener &&!window.opener.closed){
window.opener.location = url;
window.close();
}
} 


//checks to see if the link clicked is inside a popoup or not if it's in the popoup, tells to go to parent window
function sendURL(strURL){
	if (isPopup==true){
			openParent(strURL);
	}else{
	 window.location.href = strURL;

	}
}

function openFrontlineBlog(x){

	var newwindow = '';
	var url="frontline_blog_pop.html?blogID="+x;
	var name="frontline_popup";
	var props="width=610,height=600,left=200,top=50,toolbar=no,alwayRaised=yes,resizable=yes,scrollbars=yes";

	if (isPopup==true)
	{
		window.location.href=url;
	}else{
			if (!newwindow.closed && newwindow.location) {
				newwindow.location.href = url;
			}
			else {
				newwindow=window.open(url,name,props);
				if (!newwindow.opener) newwindow.opener = self;
			}
			if (window.focus) {newwindow.focus();}
	}
}

