﻿// JScript File
$(document).ready(function() {

    $('.toolbar a').click(function(e) {
          
        var url=$(this).attr('href');
        $("#iFrame").attr('src',url);
        $('.toolbar .main_').removeClass('active');
        $(this).parent('div').addClass('active');
        
        //placeContentToIframe();
        e.preventDefault();
    
    });
    
    $(".navlist1>li").click(function(){        
        $(".navlist1>li").removeClass('li_active');
        $(this).addClass('li_active');     
    });
       
    $("#iFrame").load(function(){
        //$("#iFrame").attr('height', '0');
        //$("#iFrameCover").fadeOut();
         //alert(1)
         $("#iFrameCover").show();
    });
     
    $("#iFrame").unload(function(){
        //$("#iFrame").attr('height', '0');
        //$("#iFrameCover").fadeOut();
        //alert(2)
        $("#iFrameCover").show();
    });
    
});

//
function _loadComplete(){    
    window.setTimeout(function(){
        //$("#iFrame").attr('height', '500');
        $("#iFrameCover").hide();        
    }, 1500);
}//
//
function _unloadComplete(){    
    //$("#iFrameCover").fadeIn();
    //$("#iFrame").attr('height', '0');
    //alert(3)
    $("#iFrameCover").show();
}//
//       
function openExternalCorpPages(uri){
    $("#iFrameCover").show();
    $("#iFrame").attr('src', uri);
}//

function placeContentToIframe(ifrm){
/*
var surl = $(ifrm).attr('src');    
          
    //find the element to show
    var elem;
        
    if($("#iFrame").attr('src')!='Pages/PressReleases.html' && $("#iFrame").attr('src').indexOf('Inv-')==-1 )                                 
        elem= $("#iFrame").contents().find('#ctl00_ContentPlaceHolder1_ctl00_SubActive').next('td').find('div:first');
    else 
        elem= $("#iFrame").contents().find('.mainArea');
            
    var w=elem.outerWidth();
    var h=elem.outerHeight();

    //change height and width of iframe to show only element
    $("#iFrame").css({height:h,width:w});
    
    //scroll iframe to show only element
    $("#iFrame").scrollTo(elem);
    */
    
}//

     
     

