﻿// JScript File


var titleMsg="Mecklai Fianacial - Home";
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 fnLoginPopup()
{

  document.getElementById('divLogin').style.display ='';
  document.getElementById('divLogin').style.left =(screen.width/2) - 100 +'px';
  document.getElementById('ctl00_txtUserNm').focus();
  return false;
}

function fn_forgotpwd()
{
    WinFP= window.open('ForgotPassword.aspx','WinFP','status=0, width=285, height=126, top=300, left=350,resizable=no');
}

function KeyDownHandlerLogIn(btn)
{
   
    // process only the Enter key
    if (event.keyCode == 13)
    {
        // cancel the default submit
        event.returnValue=false;
        event.cancel = true;
        // submit the form by programmatically clicking the specified button.
  
            document.getElementById(btn).click();
    }
}

function fn_Validate()
{

    if(trim(document.getElementById('ctl00_txtUserNm').value)=='' || document.getElementById('ctl00_txtUserNm').value =='')
    {
        alert('Please enter username.');
        document.getElementById('ctl00_txtUserNm').focus();
        return false;
    }
      if(trim(document.getElementById('ctl00_txtPwd').value)=='' || document.getElementById('ctl00_txtPwd').value =='')
    {
        alert('Please enter password.');
         document.getElementById('ctl00_txtPwd').focus();
         return false;
    }
    return true;

}

function fn_CallLogin(str)
{

document.getElementById('ctl00_hdnPage').value = str;
if(str=="MarketResource.aspx")
{
    window.location.href = str;
}
else if(document.getElementById('ctl00_hdnUType').value=='')
{

fnLoginPopup();
}
else
{
    document.getElementById('ctl00_hdnPage').value = str;
    if(document.getElementById('ctl00_hdnUType').value!='')
    {
        window.location.href = str;
    }
    else
    {
      window.location.href =  window.location.href;
    }
}

}
function fnPageFeedBack(str)
{
   WinP= window.open('PageFeedBack.aspx?strPage='+str,'WinP','status=0, width=494, height=480, top=150, left=300,resizable=no');
   return false;
}
function fnMouseEnter(obj)
{
       
//       document.getElementById('1').style.backgroundColor  = '#A5A5A5';
//       document.getElementById('A4').style.color  = '#ffffff';
//       document.getElementById('2').style.backgroundColor  = '#A5A5A5';
//       document.getElementById('3').style.backgroundColor  = '#A5A5A5';
//       document.getElementById('4').style.backgroundColor  = '#A5A5A5';
////       document.getElementById('5').style.backgroundColor  = '#A5A5A5';
//       document.getElementById('6').style.backgroundColor  = '#A5A5A5';
//               document.getElementById('7').style.backgroundColor  =  '#A5A5A5';
//       document.getElementById('8').style.backgroundColor  =  '#A5A5A5';
//       document.getElementById(obj.id).style.backgroundColor  = '';
//       if(obj.id=='1')
//       {
//        document.getElementById('A4').style.color  = '#16168E';
//       }
//       else
//       {
//        document.getElementById('A4').style.color  = '#ffffff';
//       }
      
}
function fnMouseLeave(obj)
{
//       document.getElementById('1').style.backgroundColor  = '';
//              document.getElementById('A4').style.color  = '#16168E';
//       document.getElementById('2').style.backgroundColor  = '';
//       document.getElementById('3').style.backgroundColor  = '';
//       document.getElementById('4').style.backgroundColor  = '';
////       document.getElementById('5').style.backgroundColor  = '';
//       document.getElementById('6').style.backgroundColor  = '';
//              document.getElementById('7').style.backgroundColor  = '';
//       document.getElementById('8').style.backgroundColor  = '';
//       document.getElementById(obj.id).style.backgroundColor  = '';

}

function RefreshMe()
{
window.location.href = window.location.href;
}

//Added By Sandeep on 25 Sep
var frame_ht=0 ;
function HideImg(objLink,iframeId)
{
if(objLink.value == null)
    objLink.value = "Hide";

if(objLink.value == "Hide")
{
    frame_ht = parseInt(document.getElementById(iframeId).style.height);
    objLink.value = "Show";
    objLink.innerHTML = "Collapse";
    document.getElementById('imgColl').src = "Images/Expand.gif";
    document.getElementById('divImg').parentNode.parentNode.style.display='none';
    document.getElementById('trSplit').style.display='';    
    document.getElementById(iframeId).style.height = (frame_ht+120)+'px';
}
else
{
    objLink.value = "Hide";
    objLink.innerHTML = "Expand";
    document.getElementById('divImg').parentNode.parentNode.style.display='';
    document.getElementById(iframeId).style.height = frame_ht+'px';
    document.getElementById('trSplit').style.display='none'; 
    document.getElementById('imgColl').src = "Images/Collapse.gif";
}

}

//function HandleEvent()
//{

//    var hdnTargetId = document.getElementById("ctl00_hdnTargetId");
// //alert(hdnTargetId.value);   
//    if(hdnTargetId.value != "")
//    {
//        var val = hdnTargetId.value;
//        //hdnTargetId.value = "";
//        document.getElementById(val).click();
//        
//        window.open('capexil offer web.pdf');
//        
//    }
//    
//}

//window.attachEvent("onload", HandleEvent);


//function correctPNG(){var arVersion=navigator.appVersion.split("MSIE")
//var version=parseFloat(arVersion[1])
//if ((version >=5.5)&& (document.body.filters)){for(var i=0;i<document.images.length;i++){var img=document.images[i]
//var imgName=img.src.toUpperCase()
//if (imgName.substring(imgName.length-3, imgName.length)=="PNG"){var imgID=(img.id)? "id='"+img.id+"' " : ""
//var imgClass=(img.className)? "class='"+img.className+"' " : ""
//var imgTitle=(img.title)? "title='"+img.title+"' " : "title='"+img.alt+"' "
//var imgStyle="display:inline-block;"+img.style.cssText 
//if (img.align=="left")imgStyle="float:left;"+imgStyle
//if (img.align=="right")imgStyle="float:right;"+imgStyle
//if (img.parentElement.href)imgStyle="cursor:hand;"+imgStyle
//var strNewHTML="<span "+imgID+imgClass+imgTitle
//+" style=\""+"width:"+img.width+"px;height:"+img.height+"px;"+imgStyle+";"
//+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
//+"(src=\'"+img.src+"\', sizingMethod='scale');\"></span>" 
//img.outerHTML=strNewHTML
//i=i-1
//}}}}