﻿// JScript File


var titleMsg="Mecklai Fianacial - Contact Us";
var dtCh= "/";
var PHName="ctl00_cphMain_";

 function trim(str)
 {
        if(!str || typeof str != 'string')
            return '';
        return str.replace(/^[\s]+/,'').replace(/[\s]+$/,'').replace(/[\s]{2,}/,' ');
 }


//function pagetitle()

//{

//var frame = document.getElementById("ifmSub");
//  frame.onload = function() {
//    if(frame.contentWindow) {
//      document.title = frame.contentWindow.document.title;
//    }
//  }

//}

function dateForm(str)
{
var dt1   = parseInt(str.substring(0,2),10); 
var mon1  = parseInt(str.substring(3,5),10);
var yr1   = parseInt(str.substring(6,10),10); 
var rdate=new Date(yr1,mon1-1,dt1);
return rdate;
}

function fn_ValidateHist()
{

 
    if(document.getElementById('cboDataType').value=="0")
    {
        alert('Select data type for historical data.');
          document.getElementById('cboDataType').focus();
        return false;
    }
    if(document.getElementById('cboCurr1').disabled == false)
    {
        if(document.getElementById('cboCurr1').value=="0")
        {
            alert('Select currency.');
            document.getElementById('cboCurr1').focus();
            return false;
        }
        
    }
    if(document.getElementById('cboCurr2').disabled == false)
    {
        if(document.getElementById('cboCurr2').value=="0")
        {
            alert('Select currency.');
            document.getElementById('cboCurr2').focus();
            return false;
        }        
    }
    if(document.getElementById('cboCurr1').disabled == false && document.getElementById('cboCurr2').disabled == false)
    {
        if(document.getElementById('cboCurr1').value==document.getElementById('cboCurr2').value)
        {
            alert('Select different currencies.');
            document.getElementById('cboCurr2').focus();
            return false;
        }
    }
    if(document.getElementById('txtfromDt').value =='')
    {
        alert('Select date from.');        
          return false;
    }
     var tdDate = new Date();
    if(document.getElementById('txtToDt').value =='')
    {
            alert('Select date to.');
                    return false;
    }
     else if (dateForm(document.getElementById("txtfromDt").value) > dateForm(document.getElementById("txtToDt").value))
    {
        alert('Select to date greater than from date.')
        return false;    
    }  
     else if ((dateForm(document.getElementById("txtfromDt").value)> tdDate) || ( dateForm(document.getElementById("txtToDt").value)>tdDate))
    {
        alert('Dates should be less than today date.')
        return false;    
    }      
    

}




 function fn_Show(obj)
    {   
   
   
        if(obj=='A1')
        {     
        
          WinW= window.open('SubScribe/CalC/WPT.aspx','WinW','status=0, width=800, height=227, top=100, left=50,resizable=no ');
           // document.title = 'Web Price Ticker - Mecklai Financial';
        }

        if(obj=='A2')
        {     
            document.getElementById('ifmSub').src="SubScribe/Desktop_PriceTicker.aspx";
               document.title = 'Desktop Price Ticker - Mecklai Financial';
        }

        if(obj=='A3')
        {     
            document.getElementById('ifmSub').src="SubScribe/ExportRates.aspx";
             document.title = 'Market in Detail - Mecklai Financial';
        }
        if(obj=='B1')
        {     
            document.getElementById('ifmSub').src="SubScribe/DailyReports.aspx";
             document.title = 'Daily Report - Mecklai Financial';
        }
         if(obj=='B11')
        {     
            document.getElementById('ifmSub').src="SubScribe/WeeklyAnalysis.aspx";
             document.title = 'Weekly Analysis - Mecklai Financial';
        }
        if(obj=='B2')
        {     
             document.getElementById('ifmSub').src="SubScribe/WeeklyReports.aspx";
            document.title = 'FX Weekly Report - Mecklai Financial';
        }

        if(obj=='B3')
        {     
            document.getElementById('ifmSub').src="SubScribe/SonOfDrRisk.aspx";
               document.title = 'Dr. Risk’s Prescription - Mecklai Financial';
        }

        if(obj=='B4')
        {     
            document.getElementById('ifmSub').src="SubScribe/SpecialReport.aspx";
             document.title = 'Special Reports - Mecklai Financial';
        }
        
        
    if(obj=='B5')
    {     
      document.getElementById('ifmSub').src="SubScribe/TechnicalReports.aspx";
      document.title = 'FX Technical Report - Mecklai Financial';  
     }
    
    if(obj=='B6')
    {     
      document.getElementById('ifmSub').src="SubScribe/WeeklyReports.aspx";
      document.title = 'Interest Rate Weekly Report - Mecklai Financial';  
     }
        if(obj=='A4')
        {     
            document.getElementById('ifmSub').src="SubScribe/Hedging_Programs.aspx";
             document.title = 'Hedging Programs - Mecklai Financial';
        }
        
      
      
        if(obj=='C1' )
        {   
        
         document.getElementById('ifmSub').src="SubScribe/CurrencyConverter.aspx";  
          document.title = 'Currency Converter - Mecklai Financial';
           //WinC= window.open('SubScribe/CurrencyConverter.aspx','WinC','status=0, width=342, height=227, top=250, left=330,resizable=no ');
        }
        
        if(obj=='C2')
        {    
         document.getElementById('ifmSub').src="SubScribe/ForwardRateCalculator.aspx"; 
         document.title = 'Forward Rate Calculator - Mecklai Financial'; 
           //WinC= window.open('SubScribe/ForwardRateCalculator.aspx','WinC','status=0, width=330, height=230, top=250, left=330,resizable=no ');
        }
        if(obj=='C3')
        { 
        document.getElementById('ifmSub').src="SubScribe/OptionPremiumCalculator.aspx"; 
        document.title = 'Option Premium Calculator - Mecklai Financial';  
            // WinC= window.open('SubScribe/OptionPremiumCalculator.aspx','WinC','status=0, width=350, height=283, top=250, left=270,resizable=no ');
        }
        if(obj=='C4')
        {
            document.getElementById('ifmSub').src="SubScribe/FRACalculator.aspx"; 
            document.title = 'FRA Calculator - Mecklai Financial';   
            //WinC= window.open('SubScribe/FRACalculator.aspx','WinC','status=0, width=490, height=295, top=200, left=270,resizable=no ');
        }   
        
         if(obj=='C5')
        {
            document.getElementById('ifmSub').src="SubScribe/YieldCalculator.aspx"; 
            document.title = 'Yield Calculator - Mecklai Financial';   
            //WinC= window.open('SubScribe/FRACalculator.aspx','WinC','status=0, width=490, height=295, top=200, left=270,resizable=no ');
        }   
        
        
        
        if(obj=='D4')
        {
           document.getElementById('ifmSub').src="SubScribe/DP.aspx"; 
            document.title = 'Mecklai Lives - Mecklai Financial';   
           
        }  
        
          if(obj=='MD1'  || obj=='')
        {
           document.getElementById('ifmSub').src="SubScribe/MarketData1.aspx"; 
            document.title = 'Mecklai Lives - Mecklai Financial';   
           
        }  
        
          if(obj=='MD2')
        {
           document.getElementById('ifmSub').src="SubScribe/MarketData2.aspx"; 
            document.title = 'Mecklai Lives - Mecklai Financial';   
           
        }  
        
          if(obj=='MD3')
        {
           document.getElementById('ifmSub').src="SubScribe/MarketData3.aspx"; 
            document.title = 'Mecklai Lives - Mecklai Financial';   
           
        }   
             if(obj=='MD4')
        {
           document.getElementById('ifmSub').src="SubScribe/MarketData4.aspx"; 
            document.title = 'Mecklai Lives - Mecklai Financial';   
           
        }   
        
           if(obj=='MD5')
        {
           document.getElementById('ifmSub').src="SubScribe/MarketData5.aspx"; 
            document.title = 'Mecklai Lives - Mecklai Financial';   
           
        }   
        
      
          if(obj=='D1')
        {     
            document.getElementById('ifmSub').src="SubScribe/RbiRefRate.aspx";
              document.title = 'RBI Reference Rate - Mecklai Financial';   
        }
         if(obj=='D2')
        {     
            document.getElementById('ifmSub').src="SubScribe/Custom_Exchange_Rate.aspx";
              document.title = 'Custom Exchange Rate - Mecklai Financial';   
        }
          if(obj=='D3')
        {     
            document.getElementById('ifmSub').src="SubScribe/MonthAvgRates.aspx";
              document.title = 'Monthly Average Rates - Mecklai Financial';   
        }
          if(obj=='T1')
        {     
            document.getElementById('ifmSub').src="SubScribe/TechnicalReports.aspx";
              document.title = 'Technical Reports - Mecklai Financial';   
        }
        
            
      if(obj=='I1' )
    {     
      document.getElementById('ifmSub').src="SubScribe/SubDebtMarket1.aspx";
      document.title = 'Market Data - Interest Rate Markets';  

      
     }
     
      if(obj=='I2' )
    {     
      document.getElementById('ifmSub').src="SubScribe/SubDebtMarket2.aspx";
      document.title = 'Derivatives - Interest Rate Markets';  

       
     }
     
      if(obj=='I3' )
    {     
      document.getElementById('ifmSub').src="SubScribe/SubDebtMarket3.aspx";
      document.title = 'History - Interest Rate Markets';    

     }


   return false;
  }
   
function fnWMV() 
{
    window.open('../SubScribe/WMV/WMVMay262009.pdf');  
}
    
function fnDP()
{
    WinC= window.open('EMP/DP.aspx','WinC','status=1, width=1010, height=680,top=5, left=5,scrollbars=yes');
}

function fnDP1()
{
    WinC= window.open('EMP/DP_WebPart.aspx','WinC','status=1, width=1010, height=680,top=5, left=5,scrollbars=yes');
}

function fnAlbum()
{
    WinC= window.open('Album.aspx','WinC','status=1, width=500, height=450,top=225, left=450,scrollbars=no');
}
function fnDP_New()
{
    WinC= window.open('EMP/DP_new.aspx','WinC','status=1, width=1010, height=680,top=5, left=5,scrollbars=yes');
}

function fnSRpt()
{
  window.open('../SubScribe/WMV/AnalysisAug09.pdf');  
return false; 
}

function fnSonOfDrRisk()
{
strFileName= '../JoyToTheWorld/SonOfDrRisk/'+  document.getElementById('hdnFileName').value

 //strFileName= '../JoyToTheWorld/SonOfDrRisk/090901.pdf';
window.open(strFileName);  
return false; 
}
function fn_onLoad()
{



document.getElementById('ifmSub').style.height = screen.height - 453 +'px';
//document.getElementById('8').classname= 'bold';
// document.getElementById('3').childNodes[0].class= 'tdLinkWhiteSelected';
document.getElementById('8').style.fontsize= '14px';
	
       fn_Show(document.getElementById('ctl00_cphMain_hdnType').value);
//     res = screen.width+"x"+screen.height;
//     var resWidth=screen.width;
//     var resHeight=screen.height;
//     if((resWidth < "1024") && (resHeight < "768"))
//     {
//        alert("Please change your screen resolution to 1024x768.");
//     }
}


 function pageLoad()
 {
    fn_onLoad();
   
   
 }
 

 



