function Callcontent(incontent,section)
{
//Temporary function - until we can include the access credential within the flash file
// this function is used by case study 1. It catches the 'Finish' button click and returns the user to the home /main page

var vAuth = document.FrmRunCourse.hiAuth.value;
var vTimeFrame = document.FrmRunCourse.hiTimeFrame.value;
var vCourse = document.FrmRunCourse.hiCourse.value;	
var vUserServiceEnrolmentID =document.FrmRunCourse.hiUserServiceEnrolmentID.value
location.href = 'GUI_mainmenu.asp?UserServiceEnrolmentID=' + vUserServiceEnrolmentID + '&Course=' + vCourse + '&AUTH=' + vAuth + '&TimeFrame=' + vTimeFrame;

}
function load(middle){
parent.middle.location.href=middle;
}

//Stephens - 3 November 2005
function MM_openBrWindow(theURL,winName,features) { //v2.0  
	//alert(theURL + ":" + "MM_openBrWindow" + ' ' + features+',resizable=yes');
	window.open(theURL,winName,features+',resizable=yes');
	//return false;
}
function openSearchWindow(theURL,winName,features) { //v2.0  
	//alert(theURL + ":" + "openWindow");
	window.open(theURL,winName,'resizable=yes,scrollbars=yes');
	//return false;
}
function openWindow(theURL,winName,features) { //v2.0  
	//alert(theURL + ":" + "openWindow");
	window.open(theURL,winName,features+',resizable=yes');
	//return false;
}
//Stephens - 3 November 2005

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function stopswf_DoFSCommand(command, args)
{
	if(args=="<%=gsGoToNext%>"){
		WhichOption("<%=gsGoToNext%>");
	}
}
function prepareToOpenWindow(inOption,inPage,inProperties,inWindowName){
	//document.FrmRunCourse.hiChosenOption.value = inOption;
	OpenWindow(inPage,inProperties,inWindowName);
	
}
function prepareToOpenWindow_frames(inOption,inPage,inProperties,inWindowName){
	parent.middle.document.FrmRunCourse.hiChosenOption.value = inOption;
	OpenWindow(inPage,inProperties,inWindowName);
	
}
function WhichOption(val){
	if(val!=0){
		document.FrmRunCourse.hiChosenOption.value=val;
		document.FrmRunCourse.submit();
	}
}
function checkSelection(){
	var QuestionType = document.FrmRunCourse.QT.value;
	var bIsSelected = false;
	var selectedAnswer = "";	
	
	if((QuestionType=="radio")||(QuestionType=="checkbox")){		
		var nrRdos = document.FrmRunCourse.inputAnswer.length;
		for(i=0;i<nrRdos;i++){
			if(document.FrmRunCourse.inputAnswer[i].checked){
				bIsSelected = bIsSelected||true;
				selectedAnswer = document.FrmRunCourse.inputAnswer[i].value;
			}
		}
	}else if((QuestionType=="select")||(QuestionType=="multiselect")){

		var nrOpts = document.FrmRunCourse.inputAnswer.length;
		for(i=0;i<nrOpts;i++){
			if((document.FrmRunCourse.inputAnswer[i].selected)&&(document.FrmRunCourse.inputAnswer[i].value!="")){
				bIsSelected = bIsSelected||true;
				selectedAnswer = document.FrmRunCourse.inputAnswer[i].value;				
			}
		}
	
	}
	else if(QuestionType=="composite"){
		
		//if ((document.FrmRunCourse.cboSubAnswers0.value =="") || (document.FrmRunCourse.cboSubAnswers1.value =="") || (document.FrmRunCourse.cboSubAnswers2.value =="") || (document.FrmRunCourse.cboSubAnswers3.value =="")) 
		if ((document.FrmRunCourse.cboSubAnswers0.value =="") || (document.FrmRunCourse.cboSubAnswers1.value =="")) 
		{
			bIsSelected = false;
		} else {
			bIsSelected = true;
		}
	}
	
	
	if(bIsSelected==true){
		document.FrmRunCourse.submit();		
	}else{
		alert('Please select an answer for this question');
	}
}
function checkAnswerSelection(){
	var QuestionType = document.FrmRunCourse.QT.value;
	var bIsSelected = false;
	var selectedAnswer = "";	
	
	if((QuestionType=="1")||(QuestionType=="2")){		
		var nrRdos = document.FrmRunCourse.inputAnswer.length;
		for(i=0;i<nrRdos;i++){
			if(document.FrmRunCourse.inputAnswer[i].checked){
				bIsSelected = bIsSelected||true;
				selectedAnswer = document.FrmRunCourse.inputAnswer[i].value;
			}
		}
	}else if((QuestionType=="select")||(QuestionType=="multiselect")){

		var nrOpts = document.FrmRunCourse.inputAnswer.length;
		for(i=0;i<nrOpts;i++){
			if((document.FrmRunCourse.inputAnswer[i].selected)&&(document.FrmRunCourse.inputAnswer[i].value!="")){
				bIsSelected = bIsSelected||true;
				selectedAnswer = document.FrmRunCourse.inputAnswer[i].value;				
			}
		}
	
	}
	else if(QuestionType=="composite"){
		
		//if ((document.FrmRunCourse.cboSubAnswers0.value =="") || (document.FrmRunCourse.cboSubAnswers1.value =="") || (document.FrmRunCourse.cboSubAnswers2.value =="") || (document.FrmRunCourse.cboSubAnswers3.value =="")) 
		if ((document.FrmRunCourse.cboSubAnswers0.value =="") || (document.FrmRunCourse.cboSubAnswers1.value =="")) 
		{
			bIsSelected = false;
		} else {
			bIsSelected = true;
		}
	}
	
	
	if(bIsSelected==true){
		document.FrmRunCourse.submit();		
	}else{
		alert('Please select an answer for this question');
	}
}
function CheckInput(){
	var vUsername = document.FrmMain.txtUsername.value;
	var vPassword = document.FrmMain.txtPassword.value;
	
	if(vUsername==""){
		alert("Username is not valid");
		document.FrmMain.txtUsername.focus();
	}else if(vPassword==""){
		alert("Password is not valid");
		document.FrmMain.txtPassword.focus();
	}else{
		document.FrmMain.submit();
	}
}
function appendEncryptedAuth(inLink,inProperties,inWindowName){
	var vAuth = document.FrmMain.hiAuth.value;
	var vTimeFrame = document.FrmMain.hiTimeFrame.value;
	OpenWindow(inLink + "&AUTH=" + vAuth + "&TimeFrame=" + vTimeFrame,inProperties,inWindowName);
}

function assFinished(in_bGetOut){
	//alert("Assessment finished");
	//parent.dummy.location.href="cscode.asp?finished=true";
	if(in_bGetOut==true){	
		window.close();
		parent.window.close();
	}
}

var WinContent;
function MM_openWindow_HTML(sFileName, sFileType, sServiceType, swindowTitle, features)  
{
	if (sFileType.toUpperCase() == "HTML")
	{ 
	//var UrlPath = "http://dev.admin.coastlinesolutions.com/courses/arbitration/Media/htm/lessons/";
	var UrlPath = "http://admin.coastlinesolutions.com/courses/Mentor600/Media/htm/other/";
	}
	if (sFileType.toUpperCase() == "HTM_OTHER")
	{ 
	//var UrlPath = "http://localhost/training/courses/Mentor600/Media/htm/other/";
	var UrlPath = "http://admin.coastlinesolutions.com/courses/Mentor600/Media/htm/other/";
	}

	if (sFileType.toUpperCase() == "HTML_LESSONS")
	{
	var UrlPath = "http://admin.coastlinesolutions.com/courses/dcmaster/Media/htm/lessons/";
	}
	
	if (sFileType == "HTM_ISBP") 
	{ 
	var UrlPath = "http://admin.coastlinesolutions.com/courses/Mentor600/Media/htm/ISBP/";
	//var UrlPath = "http://localhost/training/courses/Mentor600/Media/htm/ISBP/";
	}
	if (sFileType == "HTM_UCP600") 
	{
	UrlPath = "http://admin.coastlinesolutions.com/courses/Mentor600/Media/htm/UCP600/";
	//UrlPath = "http://localhost/training/courses/Mentor600/Media/htm/UCP600/";
	}
	if (sFileType.toUpperCase() == "HTM_URDG") 
	{
	//UrlPath = "http://localhost/training/courses/URDGMaster/Media/htm/URDG/";
	//UrlPath = "http://dev.admin.coastlinesolutions.com/courses/URDGMaster/Media/htm/URDG/";
	UrlPath = "http://admin.coastlinesolutions.com/courses/URDGMaster/Media/htm/URDG/";

}
if (sFileType.toUpperCase() == "HTML_EBRD") {
    //UrlPath = "http://localhost/training/courses/URDGMaster/Media/htm/URDG/";
    //UrlPath = "http://dev.admin.coastlinesolutions.com/courses/ES/Media/swf/Lessons/links/";
    UrlPath = "http://admin.coastlinesolutions.com/courses/ES/Media/swf/Lessons/links/";

}
if (sFileType.toUpperCase() == "HTM_URDG_OTHER") {
    //UrlPath = "http://localhost/training/courses/URDGMaster/Media/htm/URDG/";
    
    //UrlPath = "http://dev.admin.coastlinesolutions.com/courses/URDGMaster/Media/htm/other/";
    UrlPath = "http://admin.coastlinesolutions.com/courses/URDGMaster/Media/htm/other/";

}
	var urlPathToFile = UrlPath + sFileName; // full path to file
	
	window.open(urlPathToFile, 'swindowTitle', features);  
	//WinContent.focus();
}
