﻿// JScript File


var titleMsg="Mecklai Fianacial - Home";
var dtCh= "/";
var PHName="ctl00_cphMain_";

 function trim(str)
 {
        if(!str || typeof str != 'string')
            return null;
        return str.replace(/^[\s]+/,'').replace(/[\s]+$/,'').replace(/[\s]{2,}/,' ');
 }
 
 function fnAlert()
 {
    alert('To access this page you need to be a subscribed user.');
 }
 
  function fn_ShowDivs(obj)
 {
   if(obj==1)
   {
       document.getElementById('divTools').style.display ='none';
       document.getElementById('divRpt').style.display ='block';
   }
   else if(obj==2)
   {
      document.getElementById('divRpt').style.display ='none';
        document.getElementById('divTools').style.display ='block';
   }
    else
   {
      document.getElementById('divRpt').style.display ='none';
        document.getElementById('divTools').style.display ='none';
   }
 }
 function fnDP1()
{
    WinC= window.open('Markets_live/Markets_Live/Market_Data.aspx','WinC','status=1, width=1010, height=680,top=5, left=5,scrollbars=yes');
    return false;
}
  function Benchmarking_Treasury()
 {
   window.open('Service/research_market_intelligence/Benchmarking Treasury Performance - website.htm');
 }
 
function fnMobileTrial()
{
    WinMob= window.open('MobileTicker_Trial.aspx','WinMob','status=1, width=355, height=180,top=250, left=350,scrollbars=yes');
    return false;
}
 
 function fnGetAddress()
{
    WinC= window.open('OfficeLocations.aspx','WinOL','status=1, width=742, height=350,top=200, left=150,scrollbars=yes');
}
 function fnRecapChart()
{
    WinChart= window.open('aboutus/CommunityAndMecklai.aspx','WinChart','status=1, width=700, height=550,top=25, left=175,scrollbars=yes');
}

 function fn_ChartOfTheDay()
{
    WinChart= window.open('Market_Resources/currency_markets/chart_of_the_day.aspx','WinChart','status=1, width=750, height=550,top=25, left=175,scrollbars=yes');
}
 function fnOutLookFile()
{
    window.open('Market_Resources/ResearchReports/March 2010 report.pdf');
}

function fnOpenWhitePaper()
{
    window.open('../../Market_Resources/ResearchReports/Mecklai_FX_Risk_Management-Fertilizer_Industry.pdf');    
}

 function fnFollowUs(str)
{
   if(str=='facebook')
   { window.open('http://www.facebook.com/pages/Mecklai-Financial/165919619732?ref=nf');}
     if(str=='linkedin')
   { window.open('http://in.linkedin.com/in/mecklaifinancial');}
   
      if(str=='twitter')
   { window.open('http://twitter.com/mecklaifin');}
   
        if(str=='RSSFeed')
   { window.open('MecklaiRss.aspx');}
        if(str=='RSSWebFeed')
   { window.open('RSSFeed.aspx');}
   
   
}


    var t1;
var img1 =new Image();
var img2 =new Image();
var img3 =new Image();
img1.src= "Images/Homepage_ad.gif";
img2.src= "Images/forecast_winner.gif";
img3.src= "Images/Discussions_ad.gif";
function fn_onLoad()
{
if(typeof(document.getElementById('1').childNodes[0].style)!="undefined")
  {
    document.getElementById('1').childNodes[0].style.fontWeight= 'bold';
   }
  // document.getElementById('Td1').style.backgroundColor  ='#4453A4';
      //   document.getElementById('tdinfo').style.display ='none';
     res = screen.width+"x"+screen.height;    
     var screenWid  = (screen.width - 700)/2; 
    document.getElementById('divTerms').style.left = screenWid +'px';
      



//startImage(); 
    
}


function fn_ResultOpenHome()
{   
WinCF= window.open('RupeeForecastAfterResult.aspx','WinCF','status=0, width=900, height=400, top=100, left=50,resizable=no');
}

function startImage()
{   
     setInterval("getImages()",600000);
     setTimeout("callSecondImage()",9000);    
     //setTimeout("callCFImage()",9000);     
}
function getImages(notAgain)
{
//     if(t1 != null)
//        clearTimeout(t1);
//      
//      var imgMain =document.getElementById('imgAds');  
//    imgMain.src = img1.src;
//    imgMain.onclick = function(){};//.removeEventListener('click',"window.location.href = 'Discussion.aspx'",false)
//    imgMain.style.cursor = 'default';
//    
//    if(! notAgain)
//        t1=setTimeout("callSecondImage()",9000);
}

function callSecondImage()
{    
     var imgMain =document.getElementById('imgAds');
     imgMain.src = img3.src;
     imgMain.onclick = function(){window.open('Mecklai_Blog/Mecklai_Blog_Home.aspx');}; //addEventListener('click',"window.location.href = 'Discussion.aspx'",false);
     imgMain.style.cursor = 'pointer';
     t1=setTimeout("getImages(true)",12000);
}

function callCFImage()
{    
     var imgMain =document.getElementById('imgAds');
     imgMain.src = img2.src;
     imgMain.onclick = function(){};//{WinR= window.open('RupeeForecastResult.aspx','WinO','status=0, width=900, height=495, top=100, left=50,resizable=no');}; //addEventListener('click',"window.location.href = 'Discussion.aspx'",false);
     imgMain.style.cursor = 'pointer';
     setTimeout("callSecondImage()",9000); 
}




 function pageLoad()
 {    
    fn_onLoad();  
 }
 


