function control_content_utility_load(e)
{
    Feature_PrinterFriendly();
    Article_Feature_PrinterFriendly();
    Privacy_Feature_PrinterFriendly()
    Feature_ChangeFontSize();  
    General_Feature_PrinterFriendly()
}


function Feature_PrinterFriendly()
{
    function print(e)
    {
          // In future if we have to include print preview function before printing:use the following code               
          newWindow = window.open("/browse/product_details_print.jsp","NewWindow","width=750,height=800,resizable=yes," + "scrollbars=yes,location=no,toolbar=no");
          newWindow.focus();
          newWindow.document.close();
          return false; 
    }
  
    var printButton = document.getElementById("PrintThisProduct");
    if(printButton)
    {
        addEventHandler(printButton, "click", print, false, false);
    }
}

function Article_Feature_PrinterFriendly()
{
    function print_article(e)
    {
          newWindow = window.open("/browse/print_articles_landing.jsp","NewWindow","width=750,height=800,resizable=yes," + "scrollbars=yes,location=no,toolbar=no");
          newWindow.focus();
          newWindow.document.close();
    }
    
    var printButton = document.getElementById("PrintThisArticle");
    if(printButton)
    {
        addEventHandler(printButton, "click", print_article, false, false);
       
    }
}

function Privacy_Feature_PrinterFriendly()
{
    function print_privacy(e)
    {
    
        // In future if we have to include print preview function before printing:use the following code               

        var newwindow_content = document.getElementById("PageSection1"); 
        newWindow = window.open("newwindow_content","NewWindow","width=750,height=800,resizable=yes," + "scrollbars=yes,location=no,toolbar=yes");
        newWindow.document.write('<title>Print Preview</title>');
        newWindow.document.write('<link rel=stylesheet type="text/css" href="/media/styles/default_print.css"  media="all">');
        newWindow.document.write('<div style="float:left;">');
        newWindow.document.write('<img alt="Aicpa C2B logo" title="" src="/media/generic_site_content/images/print_page_images_03.gif" border=0 style="float:left; />');
        newWindow.document.write('</div');
        newWindow.document.write('<div style="float:right;">');
        newWindow.document.write('<img alt="Aicpa C2B logo" title="" src="/media/generic_site_content/images/print_page_images_05.gif" border=0 style="float:right;/>');
        newWindow.document.write('</div');
        newWindow.document.write('<div style="clear:both;">');
         newWindow.document.write('</div');
        newWindow.document.write('<br />');
        newWindow.document.write('<img alt="Aicpa C2B logo" title="" src="/media/generic_site_content/images/print_page_images_07.gif" border=0 />');
        newWindow.document.write('<br />');
        newWindow.document.write('<a href ="javascript:window.print()"><img alt="Print This Page" title="" src="/media/generic_site_content/images/pubdet_printpage_larger.gif" border=0 align="right"/></a>');
        newWindow.document.write('<br /> <br /><br /> <br />');
        newWindow.document.write("<FONT SIZE='2'font-family='verdana'>"+newwindow_content.innerHTML+"</font>");
        newWindow.focus();
        newWindow.document.close();
        return false; 
        
    }
    
    var printButton = document.getElementById("PrintThisPrivacy");
    if(printButton)
    {
        addEventHandler(printButton, "click", print_privacy, false, false);
    }
}

function General_Feature_PrinterFriendly()
{
    function print_general(e)
    {
    
        var newwindow_content = document.getElementById("PageSection1"); 
        newWindow = window.open("newwindow_content","NewWindow","width=750,height=800,resizable=yes," + "scrollbars=yes,location=no,toolbar=no");
        newWindow.document.write('<head>');
        newWindow.document.write('<title>Print Preview</title>');
        newWindow.document.write('<link rel=stylesheet type="text/css" href="/media/styles/default_print.css"  media="all">');
        newWindow.document.write('<link rel=stylesheet type="text/css" href="/media/styles/page_order_tracking_print.css"  media="screen">');
        newWindow.document.write('<script type=text/javascript> function cmCreateShopAction9Tag(a,b,c,d,e,f,g,h){}');
        newWindow.document.write(' function cmDisplayShop9s(){}');
        newWindow.document.write(' function cmSetProduction(){}');
        newWindow.document.write(' function cmCreateOrderTag(a,b,c,d,e,f,g){}');
        newWindow.document.write('</script>');
      //newWindow.document.write('<script language="javascript" type="text/javascript" src="/media/scripts/CPA2Biz_cm_data/v40/eluminate.js"></script>');
      //newWindow.document.write('<script language="javascript" type="text/javascript" src="/media/scripts/CPA2Biz_cm_data/v40/techprops.js"></script>');
      //newWindow.document.write('<script language="javascript" type="text/javascript" src="/media/scripts/CPA2Biz_cm_data/cmdatatagutils.js"></script>');
        newWindow.document.write('</head>');
         newWindow.document.write('<div style="float:left;">');
        newWindow.document.write('<img alt="Aicpa C2B logo" title="" src="/media/generic_site_content/images/print_page_images_03.gif" border=0 style="float:left; />');
        newWindow.document.write('</div');
        newWindow.document.write('<div style="float:right;">');
        newWindow.document.write('<img alt="Aicpa C2B logo" title="" src="/media/generic_site_content/images/print_page_images_05.gif" border=0 style="float:right;/>');
        newWindow.document.write('</div');
        newWindow.document.write('<div style="clear:both;">');
         newWindow.document.write('</div');
         newWindow.document.write('<br />');
        newWindow.document.write('<img alt="Aicpa C2B logo" title="" src="/media/generic_site_content/images/print_page_images_07.gif" border=0 />');
        newWindow.document.write('<br />');
        newWindow.document.write('<a href ="javascript:window.print()"><img alt="Print This Page" title="" src="/media/generic_site_content/images/pubdet_printpage_larger.gif" border=0 align="right"/></a>');
        newWindow.document.write('<br /> <br /><br /> <br />');
        newWindow.document.write(newwindow_content.innerHTML);
        newWindow.focus();
        newWindow.document.close();
        return false; 
   }
    
    var printButton = document.getElementById("PrintThis");
    if(printButton)
    {
        addEventHandler(printButton, "click", print_general, false, false);
    }

}

// #ProductDetailsContentContainerA, #ProductPricingContainerWorkshops, #ProductPricingContainer, .articleTitlePhotoContainer, .articlesBookContainer
function Feature_ChangeFontSize()
{
   
    function fontChanger(fontsize)
    {
        var idArray= new Array();
        idArray[0]=document.getElementById("ProductDetailsContentContainerA");
        idArray[1]=document.getElementById("ProductPricingContainerWorkshops");
        idArray[2]=document.getElementById("ProductPricingContainer");
        idArray[3]=document.getElementById("ArticleContent");

       
        for (i=0; i< idArray.length; i++)
        { 
          
          if(idArray[i] != null)
          {
            
            idArray[i].style.fontSize = fontsize+'pt';
          }
          
        }
       
        
              
    }
 
    function fontSmaller8pt(e)
    {   
        fontChanger(8);
    }    
    
    function fontSmaller10pt(e)
    {
       
        fontChanger(10);
    }
    
    function fontSmaller11pt(e)
    {   
       fontChanger(11);
    }
    
    function fontSmaller12pt(e)
    {
        
       fontChanger(12);
    }
    
    
    var smallerFontButton8pt = document.getElementById("ChangeFontSmaller");
    if(smallerFontButton8pt)
    {
        addEventHandler(smallerFontButton8pt, "click", fontSmaller8pt, false, true);
    }
    
    var smallerFontButton10pt = document.getElementById("ChangeFontSmaller10pt");
    if(smallerFontButton10pt)
    {
        addEventHandler(smallerFontButton10pt, "click", fontSmaller10pt, false, true);
    }
    
    var smallerFontButton11pt = document.getElementById("ChangeFontSmaller11pt");
    if(smallerFontButton11pt)
    {
        addEventHandler(smallerFontButton11pt, "click", fontSmaller11pt, false, true);
    }
    
    var smallerFontButton12pt = document.getElementById("ChangeFontLarger");
    if(smallerFontButton12pt)
    {
        addEventHandler(smallerFontButton12pt, "click", fontSmaller12pt, false, true);
    }
}

addEventHandler(window, "load", control_content_utility_load, false,true);

