function setActiveStyleSheet1(index)
{
    var i, a, main;
    alert(index);
    for(i=0; (a=document.getElementsByTagName("link")[i]); i++)
    {
    alert('hit for loop');
        if (a.getAttribute("rel").indexOf("style") != -1
                && a.getAttribute("index") != -1 )
        {
        alert('hit if statement');
            a.disabled = true;
            if (a.getAttribute("index") == index ) a.disabled = false;
            alert(a.getAttribute("index"));
        }
    }
}


function setActiveStyleSheet(title) {
   var i, a, main;
   alert(title);
   
   for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
        
        alert(a.getAttribute("href"));
     if(a.getAttribute("rel").indexOf("alt") != -1
        && a.getAttribute("href")) {
       a.disabled = true;
       if(a.getAttribute("title") == title) a.disabled = false;
        alert(a.getAttribute("title"));
     }
   }
}

function setPrintStyleSheet() 
{
   var i, a, main;
   
   
   for(i=0; (a = document.getElementsByTagName("link")[i]); i++) 
   {
        
       
         if(a.getAttribute("href").indexOf("common") != -1  ) 
         {
              
                   a.disabled = true;
                   
         }
         else
             {
                a.disabled = false;
                }
         
   }
   
    
}
   function setPreferredStyleSheet() 
   {
       var i, a, main;
       
       for(i=0; (a = document.getElementsByTagName("link")[i]); i++) 
       {
            
           
             if(a.getAttribute("href").indexOf("print") != -1  ) 
             {
                  
                       a.disabled = true;
                       
             }
             else
             {
                a.disabled = false;
                }
             
        }
         
    }
    
    function setAllCheckBoxes(FormId, FieldName, CheckValue, thisObj, swapObj)
    {
        var formVar = document.getElementById(FormId);
    
        if(!formVar)
            return;
        var objCheckBoxes = formVar.elements[FieldName];
        if(!objCheckBoxes)
            return;
        var countCheckBoxes = objCheckBoxes.length;
        if(!countCheckBoxes)
            objCheckBoxes.checked = CheckValue;
        else
            // set the check value for all check boxes
            for(var i = 0; i < countCheckBoxes; i++)
                objCheckBoxes[i].checked = CheckValue;
                
        //p_setSelectText(p_selected);
        //p_selected = !p_selected;

         var thisAnchor = document.getElementById(thisObj);
         var swapAnchor = document.getElementById(swapObj);
         thisAnchor.style.display = "none";
         swapAnchor.style.display = "inline";
         
    }
    
    function checkAllNone(fieldName, checkValue){
    
        var checkBoxes = document.getElementsByName(fieldName);
    
        if(!checkBoxes)
            return;
        var countCheckBoxes = checkBoxes.length;
        if(!countCheckBoxes)
            checkBoxes.checked = checkValue;
        else
            // set the check value for all check boxes
            for(var i = 0; i < countCheckBoxes; i++)
                checkBoxes[i].checked = checkValue;
    }
    
    function collapseExpand(strExpand, strCollapse, rowId, buttonId){
        var button = document.getElementById(buttonId);
        var loanDetails = document.getElementById(rowId);
             
        if (loanDetails.className == 'expanded'){
            loanDetails.className = 'collapsed';
            button.className = "expand";
            button.firstChild.innerHTML = strExpand;
        }else{
            loanDetails.className = 'expanded';
            button.className = "collapse";
            button.firstChild.innerHTML = strCollapse;
        }
    }