
//*************** Font Resizing **********************
//ID, class and\or tag elements that will allow font resizing 
var fontResize = new Array('span', 'p', 'li', 'dt', 'dd', 'a');
fontResize = fontResize.join(',');

var currentSize = 0;
var maxSize = 2;
var minSize = -2;

// Reset Font Size 
var originalFontSize = $(fontResize).css('font-size');

function resetFont() {
    do {
        if (currentSize > 0) { decreaseFont() }
        if (currentSize < 0) { increaseFont() }
    } while (currentSize != 0);
};

// Increase Font Size 
function increaseFont() {
    if (currentSize < maxSize) {
        var currentFontSize = $(fontResize).css('font-size');
        var currentFontSizeNum = parseFloat(currentFontSize, 10);
        var newFontSize = currentFontSizeNum + 1;
        $(fontResize).css('font-size', newFontSize);
        currentSize++;

        //ssohl...07/12/11
        SetPhotoViewerSize(newFontSize);
        SetManagementPhotoViewerSize(newFontSize);
    }

};

// Decrease Font Size 
function decreaseFont() {
    if (currentSize > minSize) {
        var currentFontSize = $(fontResize).css('font-size');
        var currentFontSizeNum = parseFloat(currentFontSize, 10);
        var newFontSize = currentFontSizeNum - 1;
        $(fontResize).css('font-size', newFontSize);
        currentSize--;

        //ssohl...07/12/11
        SetPhotoViewerSize(newFontSize);
        SetManagementPhotoViewerSize(newFontSize);
    }
};


//Set Font Size of Photo Viewer Silverlight Control
function SetPhotoViewerSize(newFontSize) {
    var control = document.getElementById("GeneraliPhotoViewer");
    if (control != null) {
        var txtDetails = control.content.findName("txtDetails");
        var txtArtist = control.content.findName("txtArtist");
        var txtTitle = control.content.findName("txtTitle");

        if (txtDetails != null && txtArtist != null && txtTitle != null) {
            txtDetails.FontSize = newFontSize;
            txtArtist.FontSize = newFontSize;
            txtTitle.FontSize = newFontSize;
        }
    }

};

//Set Font Size of Management Silverlight Control
function SetManagementPhotoViewerSize(newFontSize) {
    var control = document.getElementById("GeneraliManagementProfile");
    if (control != null) {
            
        var txtBio = control.content.findName("txtBio");
        var txtName = control.content.findName("txtName");
        var txtTitle = control.content.findName("txtTitle");

        if (txtBio != null && txtName != null && txtTitle != null) {
            txtBio.FontSize = newFontSize;
            txtName.FontSize = newFontSize;
            txtTitle.FontSize = newFontSize;
        }
    }

};

//****************** Email Link to current page *************
function EmailLinkToPage() {
    //window.open('mailto:?subject='+escape(document.title)+'&body='+escape(window.location),'_self',''); 
    var body = escape(window.document.title + String.fromCharCode(13) + window.location.href);
    var subject = "Generali USA Life Reassurance Company :: " + document.title;
    window.location.href = "mailto:?body=" + body + "&subject=" + subject;
}

//*************** Toggle High Contrast View ********************** 
var contrastEnabled = false;
function ToggleContrast() {
    if (contrastEnabled == true) {
        $(".highContrastLink").removeClass("highContrastLink");
    }
    else {
        $("a").addClass("highContrastLink");
    }
    contrastEnabled = !contrastEnabled;
}
