/* Path for this file: /content/dam/nissan/codepack/nissan/components/pages/layout/mainlayout.js/jcr:content/renditions/original */
// these were pulled from main JS file into mainlayout.js
/*
jQuery(document).ready(function() {
    if(jQuery("#frameBg").size()>0){
        //jQuery("#frameBg").height(jQuery("#frameContent").height()+20);
    }
    jQuery("#frameContent").click(function(){
        //jQuery("#frameContent").html(jQuery("#frameContent").html()+"<br /><br />");
        //resizeMe(jQuery("#frameContent").height());
    });    
});
function resizeMe(hgt){
    if(jQuery("#frameBg").size()>0){
        jQuery("#frameBg").height(hgt+20);
        if(jQuery("#frameContent").height() + 50 > jQuery("#pageBg").height()){
            //jQuery("#pageBg").height(jQuery("#pageBg").height()+20);
        }
    }
}
*/

jQuery(document).ready(function() {
    if(jQuery.browser.msie && parseInt(jQuery.browser.version) === 6) jQuery('#frameBg + #frameContent').addClass('frameContentHasBg');
 
    if(jQuery("#frameContent").height() + 50 > jQuery("#pageBg").height()){         
            jQuery("#pageBg").css("margin-bottom","50px");
        }
    
});


function selectOpts() { 
    var options = new Array();  
    options = [{
                  value: "Small Image Caption", // all types except combobox
                  text: "Small Image Caption",
                  qtip: "Small Image Caption" // select and combobox only
              },
              {
                  value: "Large Image Caption", // all types except combobox
                  text: "Large Image Caption",
                  qtip: "Large Image Caption" // select and combobox only
              }];            
    this.setOptions(options);     
}

function loadEolDiv(divNum) {   
    var allDIVsObj=document.getElementById('gMain').getElementsByTagName('div');
    var totDivCount= allDIVsObj.length;
    for (var counter =0, tagIDtempVar=""; counter<totDivCount;counter++) {
        if (allDIVsObj[counter].getAttribute('id') != null) {
            tagIDtempVar=allDIVsObj[counter].getAttribute('id');
            if(tagIDtempVar.indexOf('eolDisplayContent') != -1) {                   
                eolDisplayNum = Number(tagIDtempVar.substring(17));
            }               
        }           
    }       
    if(divNum!=null) {
        document.getElementById('eolDisplayContent'+eolDisplayNum).innerHTML = document.getElementById('eolLrnMore'+divNum).innerHTML;
    }
    
    // Adjust the height of the frame border
    jQuery("#frameBg").height(
        jQuery("#frameContent").height() + 20    
    );
    
    // Adjust the height of the footer
    var minHeight = 635;
    var height = jQuery("#frameBg").height() + 40;
    
    if (height < minHeight) {
        height = minHeight;
    }
    jQuery("#pageBg").css("min-height", height); 
}





