function popUpWindow(theFile, winName, winWidth, winHeight, stretch, scrolling) {

	// setup default values for the script, for lazy programming - Rory added
	if(winWidth==undefined || winWidth=='' || winWidth==''){ winWidth=780;}
	if(winHeight==undefined || winHeight=='' || winHeight==''){ winHeight=540;}
	if(stretch==undefined || stretch=='' || stretch==1){ stretch='yes';}//elseif(stretch==0){stretch='no';}
	if(scrolling==undefined || scrolling=='' || scrolling==1){ scrolling='yes';}//elseif(scrolling==0){scrolling='no';}
	if(winName==undefined || winName==''){ winName='popUp';}
	
	var ScreenWidth=window.screen.width-10;
    var ScreenHeight=window.screen.height-10;
    placementx=(ScreenWidth/2)-((winWidth)/2);
    placementy=(ScreenHeight/2)-((winHeight)/2);

    var popWindow=open(theFile,winName,'location=no,toolbar=no,menubar=no,directories=no,status=no,resizable='+stretch+',scrollbars='+scrolling+',width='+winWidth+',height='+winHeight+',left='+placementx+',top='+placementy+',screenX='+placementx+',screenY='+placementy+',');
 popWindow.focus();
}

/* This function is only here because parts of the DB and some SWF files still use this function to launch pop-up windows */
function popUpSmall(theFile,winName, winHeight, winWidth){
	popUpWindow(theFile,winName,winHeight,winWidth,'yes','yes');
}

/* Pop up scripts for Digital Resources used in My Courses */
function launchDR_Resource(path) {
	var resource_window = window.open(path, "Resource");
	window.location = location.href + "&survey=true&LOpath=" + path + "&endVal=true";
	resource_window.focus();
};

function launchDR_Video(video_id, course_id) {
	var url = '/cfmx/COU/video/course_video.cfm?course_id=' + course_id + '&video_id=' + video_id + '&';
	popUpWindow(url,'courseVideo',520, 285);
	//video_window.focus();
};

function launchDR_PDF(path, name) {
	var pdf_window = window.open(path, "PDF");
	pdf_window.focus();
};

function launchDR_WebIt(path, name) {
	var webit_window = window.open(path, "WebIT");
	window.location = location.href + "&survey=true&LOpath=" + name;
	webit_window.focus();
};

function launchDR_Merlo() {
	var merlo_window = window.open("/cfmx/concepedia/start.html", "Merlo");
	window.location = location.href + "&survey=trues";
	merlo_window.focus();
}

