﻿// 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 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 fnOutLookFile()
{
    window.open('Market_Resources/ResearchReports/March 2010 report.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();  
 }
 


