// JavaScript Document

function loadVideo(myVideo, myFolder)
{
	var flashCode = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="248" height="210">\n';
	flashCode += '\t<param name="movie" value="http://www.greeneconsults.com/topclass/video/flash/newPlayerFolder.swf"> \n';
	flashCode += '\t<param name="quality" value="high"> \n';
	flashCode += '\t <param name="wmode" value="transparent" > \n';
	flashCode += '\t<param NAME=FlashVars VALUE="myVideo='+myVideo+'&myFolder='+myFolder+'"> \n';
	flashCode += '\t<embed src="http://www.greeneconsults.com/topclass/video/flash/newPlayerFolder.swf" wmode="transparent" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="248" height="210" FlashVars="myVideo='+myVideo+'&myFolder='+myFolder+'"> \n';
	flashCode += '\t</embed> \n';
	flashCode += '</object> \n';
	document.write(flashCode);

}

//First row table images

function row1headerimages() 
	{
		document.write("<IMG SRC='http://www.greeneconsults.com/topclass/custom/uga/images/logo.gif' align='left'>");
		document.write("<img src='http://www.greeneconsults.com/topclass/custom/uga/images/greeneLogoBlk.gif' align='right'>");
	} 

function mycourseworkbar()
	{
		document.write("<img src='http://www.greeneconsults.com/topclass/custom/uga/images/mycoursework.gif' align='left'>");
		
	}
	
function myadvisorbar()
	{
		document.write("<img src='http://www.greeneconsults.com/topclass/custom/uga/images/advisortools.gif' align='left'>");
	}
function myhistorybar()
	{
		document.write("<img src='http://www.greeneconsults.com/topclass/custom/uga/images/myhistory.gif' align='left'>");
	}
function mymanagerbar()
	{
		document.write("<img src='http://www.greeneconsults.com/topclass/custom/uga/images/manager.gif' align='left'>");
	}

function headernavbar(isAdmin)
	{
		document.write("<a href='"+TCPathToTopClass+"Learning' class='navrow'>Home</a>");
		document.write("&nbsp; |");
		document.write("&nbsp;<a href='https://www.greeneconsults.com/faqs2.asp?company=uga' target='_blank' class='navrow'>Help</a>");
		document.write("&nbsp; |");		
		document.write("&nbsp;<a href='"+TCPathToTopClass+"Logout' class='navrow'>Logout</a>");
		document.write("&nbsp; |");
		if(isAdmin==1)
		{
		  document.write("&nbsp;<a href='"+TCPathToTopClass+"Expand-Administrator' class='navrow'>Admin</a>");
		  document.write("&nbsp; |");
		}
	
	}
//Copyright

function copyrightDate()
	{
	wriYr = new Date
	var doYr = wriYr.getFullYear()

	document.write("CFP<sup>&reg;</sup>, CERTIFIED FINANCIAL PLANNER<sup>&trade;</sup> and <img src='http://uga.financialplannerprogram.com/images/cfp_logo_footer.gif'/> are certification marks owned by Certified Financial Board of Standards, Inc.<br />These marks are awarded to individuals who successfully complete the CFP Board&#39;s initial and ongoing certification requirements.<p>&copy; " + doYr + " Developed by <a href='http://www.greeneconsults.com' target='_blank'  onfocus='if(this.blur)this.blur()'>Greene Consulting Associates</a>, LLC. All Rights Reserved. <a href='http://uga.financialplannerprogram.com/privacypolicy.asp' target='_blank'  onfocus='if(this.blur)this.blur()'>Privacy Policy</a></p>");
	}

function skillmarktitle()
	{
		document.write("<TITLE>SkillMark&reg; - The E-Learning Solution for Financial Services Professionals</TITLE>");
	}

function certificatelogo()
	{
		document.write("<IMG SRC='http://www.greeneconsults.com/topclass/custom/uga/images/logo.gif' align='left'>");
		document.write("<img src='http://www.greeneconsults.com/topclass/custom/uga/images/greeneLogoBlk.gif' align='right'>");
	} 

function certificatesignature()
	{
		document.write("<img src='images/cindy_sign.jpg' align='middle'>");
	}


//Begin TOC Row Color

function indexFrameHighlight(obj)
	{
     		if (obj == presentPosition)
     		{
       			//obj.className="pmHoverSelect";
       			obj.style.background="#EEEEEE";
     		}
     	else
     		{
		       //obj.className="pmHover";
		       obj.style.background="#DFDFDF";
		}
   	}

function markHere(obj,useParent,evt)
	{
  	if (presentPosition != null)
  		{
    			presentPosition.style.background="none";
  		}
  	if (useParent==true)
  		{
    			here = obj.parentNode;
 		}
 	 else
  		{
			here = obj;
			//Nicholas Murphy 03-Apr-2003  unsure that the _contents div containing this is open
			// we shouldn't have to recurse up the tree to ensure that all displays are open, as they have to be
			// to get to this point.
			here.parentNode.parentNode.style.display="";
  		}
			here.style.background="#EEEEEE";
			//debugAlert("setting presentPosition to " + here.id);
			presentPosition=here;
	if (window.navigator.appName == "Microsoft Internet Explorer")
		{
	if (window.event)
   		 {
     			window.event.cancelBubble=true;
   		 }
  		}
  	else
  		{
    	if (evt)
    		 {
     			evt.cancelBubble=true;
     		 }
  		}
	}

//END TOC Row Color
function pretestMessage()
{
	return false;
}
function submissionMessage(aScore, aTotal, aTitle)
{
  document.write("<P><B><font color='#000066'>You scored ");
  document.write(aPercent);
  document.write("%</B></FONT>");
  document.write(" ("+aScore+" out of "+aTotal+" total points) on the test you submitted.</P>");
  document.write("<P>If you scored 80% or higher, you have passed this test and may proceed with your study.  If you scored less than 80%, a new exam has been placed in this exam’s course folder (unless this is your third attempt).  If you scored less than 80% in three tries, you will be contacted by the Program Director to discuss your options.</P>")
}


function listSubmissions()
{
   document.write("<div class='myhistorylink'><a href='"+TCPathToTopClass+"retrieve-list-submissions-mine'>View All Exercise Submissions</a></div>");
   //document.write("View All");
   
}

function getValidstartend(validPeriod)
{
	var validArray = validPeriod.split('-');
	
	var validBegin = validArray[0];
	var validBeginSplit = validBegin.split(' ');
	var validBeginDate = validBeginSplit[0];
	
	var validEnd = validArray[1];
	var validEndSplit = validEnd.split(' ');
	var validEndDate = validEndSplit[1];
	
	document.write("<td class='myhistorytitle3'>"+validBeginDate+"</td><td class='myhistorytitle3'>"+validEndDate+"</td>");
}
//DO NOT CHANGE ANYTHING BELOW THIS LINE
//--------------------------------------

function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

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_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_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 MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
function welcome(username)
{
  now = new Date
  if (now.getHours() < 12) {
    document.write(" Good Morning, " +username)
  }
  else if (now.getHours() < 17) {
    document.write(" Good Afternoon, " +username)
  }
  else {
    document.write(" Good Evening, " +username)
                }
}

function submitCertificate(classname)
{
  document.certificateform.courseid.value = classname;
  document.certificateform.submit();
}

function welcomedate()
{
  now = new Date;
  dayofweekint = now.getDay();

  if(dayofweekint==0)
  {
    dayofweek = "Sunday";
  }
  
  else if(dayofweekint==1)
  {
    dayofweek="Monday";
  }

  else if(dayofweekint==2)
  {
    dayofweek="Tuesday";
  }

  else if(dayofweekint==3)
  {
    dayofweek="Wednesday";
  }

  else if(dayofweekint==4)
  {
    dayofweek="Thursday";
  }
    
  else if(dayofweekint==5)
  {
    dayofweek="Friday";
  }

  else if(dayofweekint==6)
  {
    dayofweek="Saturday";
  }

  monthint = now.getMonth();

  if(monthint==0)
  {
    monthstring = "January";
  }
  
  else if(monthint==1)
  {
    monthstring = "February";
  }
  
  else if(monthint==2)
  {
    monthstring = "March";
  }
  
  else if(monthint==3)
  {
    monthstring = "April";
  }

  else if(monthint==4)
  {
    monthstring = "May";
  }

  else if(monthint==5)
  {
    monthstring = "June";
  }

  else if(monthint==6)
  {
    monthstring = "July";
  }
  
  else if(monthint==7)
  {
    monthstring = "August";
  }

  else if(monthint==8)
  {
    monthstring = "September";
  }

  else if(monthint==9)
  {
    monthstring = "October";
  }

  else if(monthint==10)
  {
    monthstring = "November";
  }

  else if(monthint==11)
  {
    monthstring = "December";
  }

  yearstring = now.getFullYear();
  datestring = now.getDate();

  daystring = dayofweek+", "+monthstring+" "+datestring+", "+yearstring;

  document.write(daystring);
}

function folderTitle(longFolder, folderId, folderstudentId, classname)
{
if(longFolder.indexOf("Training") > -1)
{
       
        linkText="<a href='"+TCPathToTopClass+"CnTxT-"+folderstudentId+"-Retrieve-Page-"+folderId+"'>Training</a>";
        
        return linkText;
}
else if(longFolder.indexOf("Diagnostic") > -1)
{
       
        linkText="<a href='"+TCPathToTopClass+"CnTxT-"+folderstudentId+"-Retrieve-Page-"+folderId+"'>Diagnostic</a>";
        return linkText;
}
else if(longFolder.indexOf("Certificate") > -1)
{
       
        linkText="<a href='javascript:submitCertificate(\""+classname+"\")'>View Certificate</a>";
        return linkText;
}
else if(longFolder.indexOf("Exam") > -1)
{
       
        linkText="<a href='"+TCPathToTopClass+"CnTxT-"+folderstudentId+"-Retrieve-Page-"+folderId+"'>Exam</a>";
        return linkText;
}
else
{
        linkText="<a href='"+TCPathToTopClass+"CnTxT-"+folderstudentId+"-Retrieve-Page-"+folderId+"'>"+longFolder+"</a>";
        return linkText;
}

}

function emailInstructor(pagetitle, pageid, realname, username, email, company)
{
  urlopen = "http://www.greeneconsults.com/topclass/greene/cfp/email.asp?pagetitle="+pagetitle+"&pageid="+pageid+"&wholename="+realname+"&username="+username+"&usermail="+email+"&company="+company;
  window.open(urlopen,'mailform','width=560,height=365,directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes,left=0,top=0,screenX=0,screenY=0');
}

function loadFlashHeader(userCompany, parentFolder)
{
	var queryStr="?userCompany="+userCompany+"&parentFolder="+encodeParentFolder;
	var flashCode = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="650" height="50">\n';
	flashCode += '\t<param name="allowScriptAccess" value="always" /> \n';
	flashCode += '\t<param name="movie" value="custom/'+userCompany+'/flash/header.swf'+queryStr+'" /> \n';
	flashCode += '\t<param name="quality" value="high" /> \n';
	flashCode += '\t<param name="bgcolor" value="#ffffff" /> \n';
	flashCode += '\t<param name="wmode" value="transparent" /> \n';
	flashCode += '\t<embed src="custom/'+userCompany+'/flash/header.swf'+queryStr+'" quality="high" bgcolor="#ffffff" width="650" height="50" name="test" align="middle" type="application/x-shockwave-flash" myinput="Hello World" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" /> \n';
	flashCode += '</object> \n';
	//alert(flashCode);
	document.write(flashCode);
}

function continuingeducationbar()
	{
		document.write("<img src='http://www.greeneconsults.com/topclass/custom/uga/images/continuingEducationBar.gif' align='left'>");
	}



function loadFlashButton(userCompany, parentFolder)
{
	var queryStr="?userCompany="+userCompany+"&parentFolder="+parentFolder;
	var flashCode = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="222" height="30">\n';
	flashCode += '\t<param name="allowScriptAccess" value="always" /> \n';
	flashCode += '\t<param name="movie" value="greene/flash/flashButton1.swf'+queryStr+'" /> \n';
	flashCode += '\t<param name="quality" value="high" /> \n';
	flashCode += '\t<param name="bgcolor" value="#ffffff" /> \n';
	flashCode += '\t<param name="wmode" value="transparent" /> \n';
	flashCode += '\t<embed src="greene/flash/flashButton1.swf'+queryStr+'" quality="high" bgcolor="#ffffff" width="222" height="30" name="test" align="middle" type="application/x-shockwave-flash" myinput="Hello World" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" /> \n';
	flashCode += '</object> \n';
	
	document.write(flashCode);
}

function loadFlashButton2(userCompany, parentFolder, username, realname)
{
	var queryStr="?userCompany="+userCompany+"&parentFolder="+parentFolder+"&username="+username+"&realname="+realname;
	var flashCode = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="120" height="30">\n';
	flashCode += '\t<param name="allowScriptAccess" value="always" /> \n';
	flashCode += '\t<param name="movie" value="greene/flash/flashButton2.swf'+queryStr+'" /> \n';
	flashCode += '\t<param name="quality" value="high" /> \n';
	flashCode += '\t<param name="bgcolor" value="#ffffff" /> \n';
	flashCode += '\t<param name="wmode" value="transparent" /> \n';
	flashCode += '\t<embed src="greene/flash/flashButton2.swf'+queryStr+'" quality="high" bgcolor="#ffffff" width="120" height="30" name="test" align="middle" type="application/x-shockwave-flash" myinput="Hello World" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" /> \n';
	flashCode += '</object> \n';
	
	document.write(flashCode);
}

function loadWealthTool(userCompany, parentFolder, userName, firstName, lastName)
{
	var queryStr="?userCompany="+userCompany+"&parentFolder="+parentFolder+"&userName="+userName+"&firstName="+firstName+"&lastName="+lastName;
	var flashCode = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="850" height="1300">\n';
	flashCode += '\t<param name="allowScriptAccess" value="always" /> \n';
	flashCode += '\t<param name="movie" value="greene/relationshipNavigator_00/main.swf'+queryStr+'" /> \n';
	flashCode += '\t<param name="quality" value="high" /> \n';
	flashCode += '\t<param name="bgcolor" value="#ffffff" /> \n';
	flashCode += '\t<param name="wmode" value="transparent" /> \n';
	flashCode += '\t<embed src="greene/relationshipNavigator_00/main.swf'+queryStr+'" quality="high" bgcolor="#ffffff" width="850" height="1300" name="test" align="middle" type="application/x-shockwave-flash" myinput="Hello World" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" /> \n';
	flashCode += '</object> \n';
	
	document.write(flashCode);
}
function getDisplayScore(score, marks)
{
   var score = parseInt(score);
   var marks = parseInt(marks);
   var pctScore=(Math.round(score/marks*100));
   var isScoreNumber = isNaN(pctScore);
   if(isScoreNumber==false && score <= marks)
   {
   	document.write(score+" of "+marks+" ("+pctScore+"%)");
   }
   else
   {
   	document.write(score+" of "+marks);
   }
}
