var du_debug=true;
if(typeof window.getElement != 'function'){
	function getElement(id){if(document.getElementById){getElement = function(id){ return document.getElementById(id); }}else if(document.all){getElement = function(id){ return document.all[id]; };}else if(document.layers){getElement = function(id){ return document.layers[id]; };}else{getElement = function() { return null; }}return getElement(id);}
}
function du_getContributionAttribute(attr,obj){
	try{
		if(obj!=null && obj.length > 0){
			tmpObj=obj.split(attr+'="');
			if(tmpObj.length > 0){
				tmpObj1=tmpObj[1].split('"');
				return tmpObj1[0];
			}else{return '';}
		}else{return '';}
	} catch (e) {
		if(du_debug){alert("Error:" + '\n\n' + e);}else{alert('An error has occured.\n\nPlease try again.\n\nIf this continues please notify webmaster@du.edu.');}
	}			
}
function du_videoLoad_jw(stTgt,stWidth,stHeight,stServer,stPath,stVideo,stImage) {
	try{
		if(stWidth=='' || stWidth==null)stWidth = "700";
		if(stHeight=='' || stHeight==null)stHeight = "394";
		if((stTgt!='' && stTgt!=null)&&(stServer!='' && stServer!=null)&&(stVideo!='' && stVideo!=null)&&(stPath!='' && stPath!=null)){
			var vidID = 'vid'+stTgt;
			var vidRTMP = 'rtmp://'+stServer+'/'+stPath;
			var vidImg = du_getContributionAttribute("src",stImage);
			var so = new SWFObject("/display/swf/video/player.swf", vidID, stWidth, stHeight, "9", "#FFFFFF");
			so.useExpressInstall('/display/swf/expressInstall.swf');
			so.addParam("allowfullscreen","true");
			so.addParam("allownetworking","all");
			so.addParam("allowscriptaccess","always");
			so.addVariable("author", "University of Denver");
			so.addVariable("file", stVideo);
			so.addVariable("image", vidImg);
 			so.addVariable("title", "");
			so.addVariable("type", "rtmp");
			so.addVariable("height", stHeight);
			if(skinUrl != undefined){so.addVariable("skin", skinUrl);}
			so.addVariable("width", stWidth);
			so.addVariable("bufferlength", "10");
			so.addVariable("stretching", "fill");
			so.addVariable("id", vidID);
			so.addVariable("plugins", "googlytics-1,viral-1");
			so.addVariable("streamer", vidRTMP);
			so.write(stTgt);
		}
	} catch (e) {
		if(du_debug){alert("Error:" + '\n\n' + e + '\n\nTgt: '+stTgt+'\nWidth: '+stWidth+'\nHeight: '+stHeight+'\nServer: '+stServer+'\nPath: '+stPath+'\nVideo: '+stVideo+'\nImage: '+stImage);}else{alert('An error has occured.\n\nPlease try again.\n\nIf this continues please notify webmaster@du.edu.');}
	}
}
