﻿//###########################################################################################################
// Description : User Master page.
// Author :  RPO, SCS                    Date : 20 Oct 2008
// Copyright 2008 John Wiley and Sons Ltd
//-----------------------------------------------------------------------------------------------------------
// Change log:	Date		Reference		Author		Description
//-----------------------------------------------------------------------------------------------------------
// R01.P08      30/03/09                    RPO         updated to load IPA source when activating IPA window
// R01.P08      21/04/09                    BMA         Include SetHeight function
//###########################################################################################################

var browser = navigator.appName;    
var browser_version=navigator.appVersion;   
var ipa_text;
                    
/* start: ipa settings */           
function showIPA(txtbox) {         
    ipa_text = txtbox;              
    /* R01.P08 - RPO - 30/03/09 - updated to load IPA source when activating IPA window */    
    document.getElementById('ifrmIPA').setAttribute("src","/Include/htm/ipa.html");    
    $find("ModalPopupBehavior_IPA").show();
}     

function closeIPA() {    
    $find('ModalPopupBehavior_IPA').hide();    
}  

function closeIpaWindow() {
    $find('ModalPopupBehavior_IPA').hide();
}
/* end: ipa settings */

/* R01.P08 BMA, 21/04/2009 */
function SetHeight(divToSlide, divRelative, maxHeight) {
    var slideHeight = $('#' + divRelative).height();
    
    /* RPO - 22/04/2009 - added for quick search suggestion tool */    
    var _slideHeightTmp = 0;
    $('#' + divRelative).children().each(function() {
        if ($(this).attr('id').indexOf('quicksearch') > -1 || $(this).attr('id').indexOf('authors') > -1) {
            _slideHeightTmp += 20;
        }        
    });    
    if (_slideHeightTmp > 0) slideHeight = _slideHeightTmp;
    /* RPO - 22/04/2009 - added for quick search suggestion tool */
    
    if (slideHeight == 0)
        return;

    if (slideHeight >= maxHeight) {
        slideHeight = maxHeight;
    }
    else {
        $('#' + divRelative).width('100%');
    }

    $('#' + divToSlide).height(slideHeight);
    
}
/* R01.P08 BMA, 21/04/2009 */
