
function ImageBox(image,width,height,credit,caption) {
	var i = document.getElementById("inlineBox");
	i.style.display = "block";
	document.write('<img src="'+image+'" alt="'+caption+'" width="'+width+'" height="'+height+'" credit="'+credit+'" xwidth="'+width+'" xheight="'+height+'" />');
}

function PullQuote(quote,quoter) {	
	var i = document.getElementById("inlineBox");
	i.style.display = "block";
	
	var b = i.appendChild(document.createElement("div"));
	b.id = "pullquoteBox";
	
	var q = b.appendChild(document.createElement("div"));
	q.id = "pullquote";
	q.innerHTML = "&quot;"+quote+"&quot;";
	
	if ( quoter != "" ) {
		var r = b.appendChild(document.createElement("div"));
		r.id = "pullquoter";
		r.innerHTML = "-"+quoter+"";
	}
}

function InfoBox(headline,text) {	
	var i = document.getElementById("inlineBox");	
	i.style.display = "block";
		
	var b = i.appendChild(document.createElement("div"));
	b.id = "infoBox";
	
	var h = b.appendChild(document.createElement("div"));
	h.id = "infoBoxHeadline";
	h.innerHTML = ""+headline+"";
	
	var t = b.appendChild(document.createElement("div"));
	t.id = "infoBoxText";	
	if ( text.length > 700 ) {		
		t.style.height = 350;	
		t.style.display = "block";
		t.style.overflow = "auto";
	}
	t.innerHTML = ""+text+"";
}

function FlashVideoBox(vUrl,x,y,credit,cutline) {	
	var i = document.getElementById("inlineBox");
	i.style.display = "block";
	
	var b = i.appendChild(document.createElement("div"));
	b.id = "flashVideoBox";

	var v = b.appendChild(document.createElement("div"));
	v.id = "flashVideo";
	var vidHTML = "";
	
	vidHTML = vidHTML+"<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"252\" height=\"240\" id=\"FLVPlayer\" vspace=\"0\" hspace=\"0\">";
  	vidHTML = vidHTML+"<param name=\"movie\" value=\"/media/flash/wdVideoPlayer.swf\" />";
  	vidHTML = vidHTML+"<param name=\"salign\" value=\"lt\" />";
  	vidHTML = vidHTML+"<param name=\"quality\" value=\"high\" />";
  	vidHTML = vidHTML+"<param name=\"scale\" value=\"exactfit\" />";
  	vidHTML = vidHTML+"<param name=\"FlashVars\" value=\"&streamName="+vUrl+"&autoPlay=false&autoRewind=false&vwidth=250\" />";
  	vidHTML = vidHTML+"<embed src=\"/media/flash/wdVideoPlayer.swf\" flashvars=\"&streamName="+vUrl+"&autoPlay=false&autoRewind=false&vwidth=250\" width=\"252\" height=\"240\" quality=\"high\" scale=\"exactfit\" name=\"FLVPlayer\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />";
	vidHTML = vidHTML+"</object>";

	v.innerHTML = vidHTML;
	
	//vidHTML = vidHTML+"<param name=\"FlashVars\" value=\"&streamName="+vUrl+"&autoPlay=false&autoRewind=false&vwidth="+x+"&vheight="+y+"\" />";
	// vidHTML = vidHTML+"<embed src=\"/media/flash/wdVideoPlayer.swf\" flashvars=\"&streamName="+vUrl+"&autoPlay=false&autoRewind=false&vwidth="+x+"&vheight="+y+"\" width=\"252\" height=\"240\" quality=\"high\" scale=\"exactfit\" name=\"FLVPlayer\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />";

	if ( cutline != null ) {
		var c = b.appendChild(document.createElement("div"));
		c.id = "flashVideoCredit";
		c.innerHTML = credit;
	
		var cut = b.appendChild(document.createElement("div"));
		cut.id = "flashVideoCaption";
		cut.innerHTML = cutline;
	}
	i.style.width = "252";
	maxWidth = 252;
}

function SoundBox(sUrl,credit,cutline) {

	var i = document.getElementById("inlineBox");
	i.style.display = "block";
	
	var b = i.appendChild(document.createElement("div"));
	b.id = "soundBox";

	var s = b.appendChild(document.createElement("div"));
	s.id = "sound";
	var soundHTML = "";
	
	soundHTML = soundHTML+"<div id='downloadableAudio'><a href='http://durangoherald.com/"+sUrl+"'>Download this audio clip</a></div>";
	soundHTML = soundHTML+"<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"252\" height=\"82\" id=\"SoundPlayer\" vspace=\"0\" hspace=\"0\">";
  	soundHTML = soundHTML+"<param name=\"movie\" value=\"/media/flash/wdMP3Player.swf\" />";
  	soundHTML = soundHTML+"<param name=\"salign\" value=\"lt\" />";
  	soundHTML = soundHTML+"<param name=\"quality\" value=\"high\" />";
  	soundHTML = soundHTML+"<param name=\"scale\" value=\"exactfit\" />";
  	soundHTML = soundHTML+"<param name=\"FlashVars\" value=\"&streamName="+sUrl+"&autoPlay=false&autoRewind=true\" />";
  	soundHTML = soundHTML+"<embed src=\"/media/flash/wdMP3Player.swf\" flashvars=\"&streamName="+sUrl+"&autoPlay=false&autoRewind=true\" width=\"252\" height=\"82\" quality=\"high\" scale=\"exactfit\" name=\"SoundPlayer\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />";
	soundHTML = soundHTML+"</object>";
	

	s.innerHTML = soundHTML;

	if ( cutline != null ) {
		var c = b.appendChild(document.createElement("div"));
		c.id = "soundCredit";
		c.innerHTML = credit;
	
		var cut = b.appendChild(document.createElement("div"));
		cut.id = "soundCaption";
		cut.innerHTML = cutline;
	}
	i.style.width = "252";
	maxWidth = 252;
}

function sizeInlineBox() {

	var dis;
	if ( document.getElementById("imageContainer") ) {
		if ( imageObjArray.length > 0 ) {
			dis = 'block';
			if ( maxWidth < 200 ) { document.getElementById("inlineBox").style.width = 200; }
		} else if ( document.getElementById("flashVideoBox") ) {
			dis = 'block';
			document.getElementById("inlineBox").style.width = 252;
		} else if ( document.getElementById("soundBox") ) {
			dis = 'block';
			document.getElementById("inlineBox").style.width = 252;
		} else if ( document.getElementById("infoBox") || document.getElementById("pullquoteBox") ) {
			dis = 'block';
			document.getElementById("inlineBox").style.width = 200;
		} else {
			dis = 'none';
		}
	} else if ( document.getElementById("flashVideoBox") ) {
		dis = 'block';
		document.getElementById("inlineBox").style.width = 252;
	} else if ( document.getElementById("infoBox") || document.getElementById("pullquoteBox") ) {
		dis = 'block';
		document.getElementById("inlineBox").style.width = 200;
	} else {
		dis = 'none';
	}
	document.getElementById("inlineBox").style.display = ''+dis+'';
	return 0;
}
