
/*
Pasted from 7695.js for glossary
*/
function GlossaryDefinition(Term){
	var sUrl="/cms/templates/so/glossary.asp" + document.location.search ;
	if(Term){sUrl+="#" + Term;}
	var oWin=window.open(sUrl,"Glossary","width=500,height=400").focus()
}

function PrintFormat(){
	var sUrl="/cms/templates/so/print.asp" + document.location.search
	var oWin=window.open(sUrl,"EmailFriend","width=600,height=600").focus()
}


function EmailFriend(){
	var sUrl="/cms/email.asp?src=" + document.location.href;
	var oWin=window.open(sUrl,"EmailFriend","width=500,height=500").focus()
}

function validateForm() {


	var myMessage = ""
	if (form1.name.value == "") myMessage += "Name\n ";  
	if (form1.email.value == "") myMessage += "Email Address\n ";
	if (form1.subject.value == "") myMessage += "Subject\n ";
	if (form1.feedback.value == "") myMessage += "Feedback\n ";
	
	if (myMessage.length > 0) {
		myMessage = myMessage.slice(0, myMessage.length-2);
		alert("The following fields have not been filled out:\n\n " + myMessage + "\n\n Please fill out all the required fields.");
		return false;
	}
	
	var verify_email = form1.email.value
		if ((verify_email.indexOf('@') < 0) || ((verify_email.charAt(verify_email.length-4) != '.') && (verify_email.charAt(verify_email.length-3) != '.')))
			{alert("Please enter a valid email address: you@yourdomain.com");
			form1.email.select();
		return false;
			}
	return true;
}

function IPCGProductForm() {
	
	
	    var myMessage = ""
	    
	    if (form.name.value.length==0) myMessage += "Name\n";
        if (form.email.value.length==0) myMessage += "Email\n";
       
		if (form.select.options[0].selected) myMessage += "I am a resident of\n";
		if (form.selectinvest.options[0].selected) myMessage += "How much would you like to invest?\n";
		if (!form.radio_client[0].checked && !form.radio_client[1].checked) myMessage += "Are you a Merrill Client?\n";
		
		if (myMessage.length > 0) {

            myMessage = myMessage.slice(0, myMessage.length-1);
            alert("The following fields have not been filled out:\n\n" + myMessage + "\n\nPlease fill out all the required fields.");
            return false;

        }
            
         var verify_email = form.email.value
			if ((verify_email.indexOf('@') < 0) || ((verify_email.charAt(verify_email.length-4) != '.') && (verify_email.charAt(verify_email.length-3) != '.')))
				{alert("Please enter a valid email address: you@yourdomain.com");
				form.email.select();
				return false;		
        
         }
		 return true;
}



function validateRadioButtons(radioName, radioList) {
	
	var radioValue = null;
	
	for (var i=0; i < radioList.length; i++) {
		if (radioList[i].checked) {
				radioValue = radioList[i].value;
				break;
			}
	}
	  
	return radioValue;  
	   
}


function check_evaluation() {
	
	var leftUnchecked = "";
	
	var RadioResult = validateRadioButtons('question1', document.evaluation.question1)
	if (RadioResult == null )  { leftUnchecked += ' 1' }
	else answer01=RadioResult;
	
	
	RadioResult = validateRadioButtons('question2', document.evaluation.question2) 
	if (RadioResult == null )  { leftUnchecked += ' 2' }
	else answer02=RadioResult;
  
	RadioResult = validateRadioButtons('question3', document.evaluation.question3) 
	if (RadioResult == null )  { leftUnchecked += ' 3' }
	else answer03=RadioResult;
  
	RadioResult = validateRadioButtons('question4', document.evaluation.question4) 
	if (RadioResult == null )  { leftUnchecked += ' 4' }
	else answer04=RadioResult;
  
	RadioResult = validateRadioButtons('question5', document.evaluation.question5) 
	if (RadioResult == null )  { leftUnchecked += ' 5' }
	else answer05=RadioResult;
  
	RadioResult = validateRadioButtons('question6', document.evaluation.question6) 
	if (RadioResult == null )  { leftUnchecked += ' 6' }
	else answer06=RadioResult;
  
   if (leftUnchecked != "") { 
   	 alert("Please complete question(s):   " + leftUnchecked)
   	 return;
   }
	
	var total = 0;
	if (answer01 == 'a') { total = 1 ; }
	if (answer01 == 'b') { total = 3; }
	if (answer01 == 'c') { total = 5; }
	if (answer01 == 'd') { total = 7; }
	if (answer01 == 'e') { total = 9; }

	if (answer02 == 'a') { total += 1; } 
	if (answer02 == 'b') { total += 5; }
	if (answer02 == 'c') { total += 9; }

	if (answer03 == 'a') { total += 1; }
	if (answer03 == 'b') { total += 5; }
	if (answer03 == 'c') { total += 9; }

	if (answer04 == 'a') { total += 1; }
	if (answer04 == 'b') { total += 3; }
	if (answer04 == 'c') { total += 5; }
	if (answer04 == 'd') { total += 7; }
	if (answer04 == 'e') { total += 9; }

	if (answer05 == 'a') { total += 1; }
	if (answer05 == 'b') { total += 3; }
	if (answer05 == 'c') { total += 5; }
	if (answer05 == 'd') { total += 7; }
	if (answer05 == 'e') { total += 9; }

	if (answer06 == 'a') { total += 1; }
	if (answer06 == 'b') { total += 3; }
	if (answer06 == 'c') { total += 7; }
	if (answer06 == 'd') { total += 9; }

if (total <  16) {
risk_category = 'In this risk category, preservation of capital is the single most important concern, with an average annual total return typically ranging from 5% to 7%. Adjusted for inflation, investment returns may be very low or, in some years, negative, in exchange for very high liquidity and minimal risk of principal loss. ';
risk_description = 'Conservative';
}
if ((total > 15) && (total < 26)) {
risk_category = 'In this risk category, preservation of capital and income are the most important objectives, with an average annual total return typically ranging from 6% to 8%. A slightly greater willingness to accept risk is seen as a desire to have a modest positive "real" (after-inflation) rate of return. ';
risk_description = 'Conservative to Moderate';
}
if ((total > 25) && (total < 35)) {
risk_category = 'Investors in this risk category accept possible principal loss as a natural function of investment risk incurred in the pursuit of higher average annual total returns, typically ranging from 7% to 9%. The degree of risk is normally reduced through diversification and asset allocation as well as periodic revisions to rebalance any excesses that develop. ';
risk_description = 'Moderate';
}
if ((total > 34) && (total < 45)) {
risk_category = 'Investors in this category are more willing to take risk, both in types of securities held and in the concentration of holdings in favored market sectors, and accept possible loss of principal. The average annual total return typically ranges from 8% to 10%, but some holdings may be aimed at higher goals.  More active portfolio adjustment is a typical feature of this type of investor behavior. ';
risk_description = 'Moderate to Aggressive';
}
if ((total > 44) && (total < 55)) {
risk_category = 'Investors in this risk category typically are more willing to accept losses on individual transactions in pursuit of overall portfolio results that historically produce average annual total returns of 10% or more. More concentrated positions and frequent portfolio changes typify this type of investor. More speculative investment choices also require careful and continuous overseeing. Investors in this category may experience a wide variance in returns from one year to the next in the pursuit of longer-term goals. ';
risk_description = 'Aggressive';
}


var win = window.open("/?id=15261_15372", "win", "width=600,height=400,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes"); // a window object
win.document.open("text/html", "replace");
win.document.write("<HTML><HEAD><link rel=stylesheet type='text/css' href='/cms/css/15261.css'><TITLE>Risk Tolerance Evaluator</TITLE></HEAD><BODY style='padding:15px'><BR><span class='bodytext'><B>Score "+total+" : Your risk tolerance is " +risk_description+"</B><BR>" +risk_category+"<BR><BR>To discuss your results with a Financial Consultant ,<a href='/?id=15261_15372'> contact us</a>.</span></BODY></HTML>");
win.document.close();


}


function gotosite(sSite) {

	if(sSite != "") {
		//window.document.location = sSite;
		open(sSite);
	}

	return false;
}
// Navigation Image Swap Javascript Start
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.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_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];}
}

// div Popup  //

  function showPopUp(display)
    {
    document.getElementById('divpopup').style.display = display;
    }
    
//




// Navigation Image Swap Javascript End


function OpenPDF()
{
    var PdfBox = document.getElementById("GlobalReport");
	this.languageselected = PdfBox.selectedIndex;
	this.language = PdfBox.options[this.languageselected].value;
	if (this.language == "English")
	{
	 	window.open("/media/45418.pdf")
	}
	if (this.language == "Chinese")
	{
	 	window.open("/media/45419.pdf")
	}
	if (this.language == "ChineseTD")
	{
	 	window.open("/media/45420.pdf")
	}
	if (this.language == "Korean")
	{
	 	window.open("/media/45421.pdf")
	}
	if (this.language == "Spanish")
	{
	 	window.open("/media/45422.pdf")
	}
}
