function OpenNewWindow(fileName, windowName, options) {
var newWin = window.open(fileName, windowName, options);
}
/********************************************************************/
/********************************************************************/
function Goto_Page(gotopage) {
document.location = "" + gotopage;  //NonSecure page
}
function Goto_PagePOP(pageName, sendVariable, winName, winScroll, winTools, winResize, winWidth, winHeight) {
showWin('' + pageName + sendVariable, winName, 'scrollbars=' + winScroll + ',toolbar=' + winTools + ',resizable=' + winResize + ',width=' + winWidth + ',height=' + winHeight);
}
function Goto_SitePOP(siteName, winName, winResize, winWidth, winHeight) {
showWin('http://' + siteName, winName, 'scrollbars=yes,resizable=' + winResize + ',toolbar=yes,width=' + winWidth + ',height=' + winHeight);
}
function setLanguageCookie(country) {
if (country.length > 0) {
document.cookie = 'Language=' + country + ';path=/;expires=Thu, 12-Feb-2099 12:00:00 GMT';
}
}
function Goto_PagePS(gotopage) {
if (gotopage == "trading.asp") {
gotopage = "login.asp"
}
document.location = "" + gotopage;
}
function Goto_PagePOPps(pageName, sendVariable, winName, winScroll, winTools, winResize, winWidth, winHeight) {
showWin('' + pageName + sendVariable, winName, 'scrollbars=' + winScroll + ',toolbar=' + winTools + ',resizable=' + winResize + ',width=' + winWidth + ',height=' + winHeight);
}
<!--
function submitform(page) {         //JF
document.submitform.action = page;
document.submitform.submit();
}
function MM_openBrWindow(theURL, winName, features) { //v2.0
window.open(theURL,winName,features);
}
var submitFlag = 0;   //Global variable used with confirmSubmit function
function confirmSubmit(theForm) {
if (submitFlag == 0) {
submitFlag = 1;   //Set flag to checked
theForm.submit();  //Submit form
return true;
}
else {
alert('You have already submitted your request. \n Please wait for processing to complete.');
return false;
}
}
function ClearImg() {
document.waitImg.src ='../ixx_images/loading2.gif';
return true;
}
function CheckFieldsLogin() {
if (document.form1.AccNum.value == "") {
alert ('Please enter your account number.');
document.form1.AccNum.focus();
return false;
}
if (document.form1.ConnectID.value == "") {
alert ('Please enter your PIN.');
document.form1.ConnectID.focus();
return false;
}
if (document.form1.password.value == "") {
alert ('Please enter a Password.');
document.form1.password.focus();
return false;
}
return true;
}
var head = "display:''";
function doit(header) {
var head = header.style;
if (head.display == "none")
head.display = "";
else
head.display = "none";
}
var loaded = 0;
var hasLayers = 0;
var lastMenu = '';
function MM_goToURL() {       //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
function ChangeLists(portfolio_name) {
document.frmChangeLists.portfolio_name.value = portfolio_name;
document.frmChangeLists.submit();
}
function MM_findObj(n, d) {      //v3.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); 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 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];}}
}
NS4 = (document.layers) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;
ver4 = (NS4 || IE4) ? 1 : 0;
topStart = 20;
if (ver4)
hasLayers = 1;
function moveLayers() {
if (hasLayers)    {
if (NS4)       {
padWidth = 0;
document.layers['Layer1'].left = 402 + padWidth;
document.layers['Layer1'].top = topStart;
document.layers['Layer2'].left = 368 + padWidth;
document.layers['Layer2'].top = topStart;
}
else     {
padWidth = 0;
document.all['Layer1'].style.pixelLeft = 402 + padWidth;
document.all['Layer1'].style.pixelTop = topStart;
document.all['Layer2'].style.pixelLeft = 368 + padWidth;
document.all['Layer2'].style.pixelTop = topStart;
}
}
}
function popUp(menuName, on) {
if (hasLayers)    {
if (on) {
moveLayers();
if (NS4)
document.layers[menuName].visibility = "show";
else
document.all[menuName].style.visibility = "visible";
}
else {
if (NS4)
document.layers[menuName].visibility = "hide";
else
document.all[menuName].style.visibility = "hidden";
}
}
}
var canHide = 1;
function change(menu) {
if (hasLayers)    {
popUp('Layer1',false);
popUp('Layer2',false);
}
lastMenu = menu;
}
function delayHide() {
if (canHide == 1)
popUp(lastMenu,false);
}
function SymbolLookupGetQuote(symbol, market) {
return "Qreal.asp?scrip_code="+symbol+"&submit=Get Quote&Exchange="+market;
}
function populateFields(scripCode, marketID) {
var equivOption = 0;
for (count = 0; count < window.opener.document.frmGetQuote.exchange.length; count++) {
if (window.opener.document.frmGetQuote.exchange.options[count].value == marketID) {
equivOption = count;
break;
}
}
window.opener.document.frmGetQuote.scrip_code.value = scripCode;
window.opener.document.frmGetQuote.exchange.options.selectedIndex = equivOption;
window.close();
}
var theWin = null;
function showWin(filename, name, features) {
theWin = window.open(filename, name, features);
theWin.focus();
}
var theWin = null;
function showWinNew(URL, filename, name, features) {
theWin = window.open(URL, filename, name, features);
theWin.focus();
}
function checkFields1(frmID, curPw, newPw, newPwCnf) {
var strRegExpI    = /[0-9]+[a-zA-Z]+/;
var strRegExpII      = /[a-zA-Z]+[0-9]+/;
var strRegExpIII  = /[^ a-zA-Z0-9]/;
var strCurrPwd    = document.forms[frmID].elements[curPw].value;
var strNewPwd     = document.forms[frmID].elements[newPw].value;
var strNewPwdCnf  = document.forms[frmID].elements[newPwCnf].value;
if (strCurrPwd == "") {
alert ('Please enter your Current Password.');
document.forms[frmID].elements[curPw].focus();
return false;
}
if (strNewPwd == "") {
alert ('Please enter a Password.');
document.forms[frmID].elements[curPw].focus();
return false;
}
else if (strCurrPwd == strNewPwd) {
alert ('New Password and Current Password cannot match.');
document.forms[frmID].elements[newPw].focus();
return false;
}
else if ((strNewPwd.length < 8)||(strNewPwd.length > 12)){
alert ('New Password must be between 8 and 12 characters in length.');
document.forms[frmID].elements[newPw].focus();
document.forms[frmID].elements[newPw].select();
return false;
}
else if (strNewPwd != strNewPwdCnf ) {
alert ('Entered passwords did not match.');
document.forms[frmID].elements[newPw].focus();
document.forms[frmID].elements[newPw].select();
return false;
}
else if ((!strRegExpI.test(strNewPwd) && !strRegExpII.test(strNewPwd)) || strRegExpIII.test(strNewPwd) ){
alert ('Please note that your password must be a combination of Letters and Numbers, but cannot contain any special characters..');
document.forms[frmID].elements[newPw].select();
return false;
}
return true;
}
function checkFields2() {
if (document.validates.FName.value == "") {
alert ('Please enter your First name.');
document.validates.FName.focus();
return false;
}
else if (document.validates.LName.value == "") {
alert ('Please enter your Last name.');
document.validates.LName.focus();
return false;
}
else if (document.validates.Pincode.value == "") {
alert ('Please enter your Pincode.');
document.validates.Pincode.focus();
return false;
}
else if (document.validates.Phone.value == "") {
alert ('Please enter your Daytime Phone Number.');
document.validates.Phone.focus();
return false;
}
else if (document.validates.PhoneB.value == "") {
alert ('Please enter your Evening Phone Number.');
document.validates.PhoneB.focus();
return false;
}
else if (document.validates.Email.value == "") {
alert ('Please enter your e-mail address.');
document.validates.Email.focus();
return false;
}
return true;
}
function isDate(minYear, maxYear, minDays, maxDays) {
var inputStr = document.validation.Birth.value;
while (inputStr.indexOf("-") != -1)
inputStr = replaceString(inputStr,"-","/");
var delim1 = inputStr.indexOf("/");
var delim2 = inputStr.lastIndexOf("/");
if (delim1 != -1 && delim1 == delim2)  {
alert('The date entry is not in an acceptable format.\n\nYou can enter dates in the following formats: mmddyyyy, mm/dd/yyyy, or mm-dd-yyyy.  (If the month or date data is not available, enter \'01\' in the appropriate location).');
return false;
}
if (delim1 != -1) {
var dd = parseInt(inputStr.substring(0,delim1),10);
var mm = parseInt(inputStr.substring(delim1 + 1,delim2),10);
var yyyy = parseInt(inputStr.substring(delim2 + 1, inputStr.length),10);
}
else {
var dd = parseInt(inputStr.substring(0,2),10);
var mm = parseInt(inputStr.substring(2,4),10);
var yyyy = parseInt(inputStr.substring(4,inputStr.length),10);
}
if (isNaN(mm) || isNaN(dd) || isNaN(yyyy)) {
alert('The date entry is not in an acceptable format.\n\nYou can enter dates in the following formats: mmddyyyy, mm/dd/yyyy, or mm-dd-yyyy.  (If the month or date data is not available, enter \'01\' in the appropriate location).');
return false;
}
if (mm < 1 || mm > 12) {
alert('Months must be entered between the range of 01 (January) and 12 (December).');
return false;
}
if (dd < 1 || dd > 31) {
alert('Days must be entered between the range of 01 and a maximum of 31 (depending on the month and year).');
return false;
}
if (yyyy < 100) {
if (yyyy >= 30)
yyyy += 1900;
else
yyyy += 2000;
}
var today = new Date();
if (!minYear) {
var dateStr = new String(monthDayFormat(mm) + "/" + monthDayFormat(dd) + "/" + yyyy);
var testDate = new Date(dateStr);
if (testDate.getTime() < (today.getTime() + (minDays * 24 * 60 * 60 * 1000)))
alert('The most likely range for this entry begins ' + minDays + ' days from today.');
if (testDate.getTime() > today.getTime() + (maxDays * 24 * 60 * 60 * 1000))
alert('The most likely range for this entry ends ' + maxDays + ' days from today.');
}
else if (minYear && maxYear) {
if (yyyy < minYear || yyyy > maxYear)
alert('The most likely range for this entry is between the years ' + minYear + ' and ' + maxYear + '.  If your source data indicates a date outside this range, then enter that date.');
}
else {
var thisYear = today.getYear();
if (thisYear < 100)
thisYear += 1900;
if (yyyy < minYear || yyyy > maxYear)
alert('It is unusual for a date entry to be before ' + minYear + ' or after ' + maxYear + '. Please verify this entry.');
}
return true;
}
var newWindowOrderStatus
var newWindowOrderHistory
var newWindowPOPhld
var newWindowPOPbal
var newwin
function makeNewWindowOrder(page) {
var selection = document.form3.console;
if (!newWindowOrderStatus || newWindowOrderStatus.closed || !newWindowOrderHistory || newWindowOrderHistory.closed || !newWindowPOPhld || newWindowPOPhld.closed || !newWindowPOPbal || newWindowPOPbal.closed) {
newwin = window.open(page ,"Order","scrollbars=yes,resizable=yes,width=750,height=200");
newwin.focus();
}
}
var newWindowOrderStatus
var newWindowOrderHistory
var newwin
function makeNewWindowOrderAdvanced(page) {
var selection = document.form4.console;
if (!newWindowOrderStatus || newWindowOrderStatus.closed) {
newwin = window.open(page,"Order","scrollbars=yes,resizable=yes,width=750,height=200")
newwin.focus();
}
else if (!newWindowOrderHistory || newWindowOrderHistory.closed) {
newwin = window.open(page,"History","scrollbars=yes,resizable=yes,width=750,height=200")
newwin.focus();
}
}
function tab(choice) {
if (choice == 0) {
document.all("span1").style.visibility = "visible";
document.all("span2").style.visibility = "hidden";
document.all("span3").style.visibility = "visible";
document.all("span4").style.visibility = "hidden";
}
else {
document.all("span1").style.visibility = "hidden";
document.all("span2").style.visibility = "visible";
document.all("span3").style.visibility = "hidden";
document.all("span4").style.visibility = "visible";
}
}
function checkField2() {
if (document.frmGetQuote.scripcode.value == "") {
alert ('Please enter a Symbol.');
document.frmGetQuote.scripcode.focus();
return false;
}
if (document.frmGetQuote.Exchange.options[document.frmGetQuote.Exchange.selectedIndex].value == "") {
alert ('Please select an exchange.');
document.frmGetQuote.Exchange.focus();
return false;
}
}
function checkField3() {
if (document.frmGetQuote.Exchange.options[document.frmGetQuote.Exchange.selectedIndex].value == "") {
alert ('Please select an exchange.');
document.frmGetQuote.Exchange.focus();
return false;
}
if (document.frmGetQuote.scrip_code.value == "") {
alert ('Please enter a Symbol.');
document.frmGetQuote.scrip_code.focus();
return false;
}
}
function CheckFieldSymLk() {
if (document.frmGetQuote.scripcode.value == "") {
alert ('Please enter a company name.');
document.frmGetQuote.scripcode.focus();
return false;
}
if (document.frmGetQuote.market.options[document.frmGetQuote.market.selectedIndex].value == "") {
alert ('Please select an exchange.');
document.frmGetQuote.market.focus();
return false;
}
}
function dm(msgStr) {
window.status = msgStr;
return true;
}
function check() {
checkLimit();
checkDayOnly();
}
function changeImage(path) {
document.images["wait"].src = path+'ixx_images/processing2.gif';
return true;
}
function changeImagePop(path) {
document.images["wait"].src = path+'ixx_images/processing-pop2.gif';
return true;
}
function OpenAccValidation() {
if (document.openacc.LN.value == "")   {
alert ('Please enter your Last name.');
document.openacc.LN.focus();
return false;
}
if (document.openacc.FN.value == "") {
alert ('Please enter your First name.');
document.openacc.FN.focus();
return false;
}
if (document.openacc.Address.value == "") {
alert ('Please enter your Residential Address.');
document.openacc.Address.focus();
return false;
}
if (document.openacc.City.value == "") {
alert ('Please enter your City/Suburb.');
document.openacc.City.focus();
return false;
}
if (document.openacc.Pincode.value == "") {
alert ('Please enter your Postal-code');
document.openacc.Pincode.focus();
return false;
}
if (document.openacc.Email.value == "") {
alert('Please enter a valid Email address');
document.openacc.Email.focus();
return false;
}
else if (validEmail(document.openacc.Email.value) == false) {
alert('Please enter a valid Email address');
document.openacc.Email.focus();
return false;
}
return true;
}
function validEmail(email) {
var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/; var check=/@[\w\-]+\./;
var checkend=/\.[a-zA-Z]{2,4}$/;
if((email.search(exclude) != -1) || (email.search(checkend) == -1))
return false;
atPos = email.indexOf("@",0);
pPos1 = email.indexOf(".",0);
periodPos = email.indexOf(".",atPos);
pos1 = pPos1;
pos2 = 0;
while (pos2 > -1) {
pos2 = email.indexOf(".",pos1+1);
if (pos2 == pos1+1)
return false;
else
pos1 = pos2;
}
if (atPos == -1)
return false;
if (atPos == 0)
return false;
if (pPos1 == 0)
return false;
if(email.indexOf("@",atPos+1) > -1)
return false;
if (periodPos == -1)
return false;
if (atPos+1 == periodPos)
return false;
if (periodPos+3 > email.length)
return false;
return true;
}
function validPhoneNum(phoneNum) {
var validChars = /[\-\ ]*/g;
var phoneNumEx = /(^\d{10}\d*$)/;
phoneNum = phoneNum.replace(validChars, ""); // strip valid characters (spaces and hyphens) out of the phone number
if (!phoneNumEx.test(phoneNum)) {
return false;
}
return true;
}
function setLanguageCookie(country) {
if (country.length > 0) {
document.cookie = 'Language=' + country + ';path=/;expires=Thu, 12-Feb-2099 12:00:00 GMT';
}
}
function gotoFile(filename) {
window.opener.top.location = filename;
window.close()
}
function printPage() {
if (window.print) {
agree = confirm('Please make sure your printer is on and connected properly. \n\nOK to print now?');
if (agree) window.print();
}
}
function validateRadio()  {
if (!document.validation.From_Terms0[0].checked && !document.validation.From_Terms0[1].checked) {
alert('You must choose to either agree or disagree.');
document.validation.From_Terms0[0].focus();
return(false);
}
if (!document.validation.From_Terms1[0].checked && !document.validation.From_Terms1[1].checked) {
alert('You must choose to either agree or disagree.');
document.validation.From_Terms1[0].focus();
return(false);
}
if (!document.validation.From_Terms2[0].checked && !document.validation.From_Terms2[1].checked) {
alert('You must choose to either agree or disagree.');
document.validation.From_Terms2[0].focus();
return(false);
}
if (!document.validation.From_Terms3[0].checked && !document.validation.From_Terms3[1].checked) {
alert('You must choose to either agree or disagree.');
document.validation.From_Terms3[0].focus();
return(false);
}
if (!document.validation.From_Terms4[0].checked && !document.validation.From_Terms4[1].checked) {
alert('You must choose to either agree or disagree.');
document.validation.From_Terms4[0].focus();
return(false);
}
if (!document.validation.From_Terms5[0].checked && !document.validation.From_Terms5[1].checked) {
alert('You must choose to either agree or disagree.');
document.validation.From_Terms5[0].focus();
return(false);
}
if (!document.validation.From_Terms6[0].checked && !document.validation.From_Terms6[1].checked) {
alert('You must choose to either agree or disagree.');
document.validation.From_Terms6[0].focus();
return(false);
}
if (!document.validation.From_Terms7[0].checked && !document.validation.From_Terms7[1].checked) {
alert('You must choose to either agree or disagree.');
document.validation.From_Terms7[0].focus();
return(false);
}
if (!document.validation.From_Terms8[0].checked && !document.validation.From_Terms8[1].checked) {
alert('You must choose to either agree or disagree.');
document.validation.From_Terms8[0].focus();
return(false);
}
if (!document.validation.From_Terms9[0].checked && !document.validation.From_Terms9[1].checked) {
alert('You must choose to either agree or disagree.');
document.validation.From_Terms9[0].focus();
return(false);
}
if (!document.validation.From_Terms10[0].checked && !document.validation.From_Terms10[1].checked) {
alert('You must choose to either agree or disagree.');
document.validation.From_Terms10[0].focus();
return(false);
}
if (!document.validation.From_Terms11[0].checked && !document.validation.From_Terms11[1].checked) {
alert('You must choose to either agree or disagree.');
document.validation.From_Terms11[0].focus();
return(false);
}
return true;
}
function showAndHide(theId)
{
var el = document.getElementById(theId)
if (el.style.display=="none")
{
el.style.display="block"; //show element
}
else
{
el.style.display="none"; //hide element
}
}
function getFundType(){
var selected = document.getElementById('select').options[document.getElementById('select').selectedIndex].value;
document.findFund.action="/staticcontent/fundSearch.html?navform_menuid=investment_mutualfunds_fundslist&noresults=500&Filter1="+selected;
document.findFund.submit();
}
function getFundByName(){
var search=document.getElementById('fundName').value;
if(search.length != 0){
document.findFund.action="/staticcontent/fundSearch.html?navform_menuid=investment_mutualfunds_fundslist&search="+search+"&noresults=500";
document.findFund.submit();
}
}