var gAutoPrint = true; // Flag for whether or not to automatically call the print function

function printSpecial()
{
        if (document.getElementById != null){
                var html = '<HTML>\n<HEAD>\n';

                if (document.getElementsByTagName != null)
                {
                        var headTags = document.getElementsByTagName("head");
//                        if (headTags.length > 0){

//                                html += headTags[0].innerHTML;
//                        }

                        html += '\n<link rel="stylesheet" media="screen" href="/visitorsguide/include/css/peiplayCSS_print.css" type="text/css">\n';
                        html += '\n</HE' + 'AD>\n<BODY>\n';
                        //header graphic
                        html += '<table width="100%">';
                        html += '<tr><td colspan="2"><img src="/visitorsguide/assets/images/print_header.gif" height="135" width="600" /><br></t'+'d></t'+'r>';
                        html += '<tr bgcolor="#EFEFEF"> <td colspan="2"><img src="/gif/1by1.gif" height="2" width="1" /><br></t'+'d></t'+'r>';
                        html += '<tr><td colspan="2" align=right><br><i>www.gentleisland.com</i><br></t'+'d></t'+'r>';
                        html += '</ta'+'ble>';
                }
                var printReadyElem = document.getElementById("printReady");
                if (printReadyElem != null){
                        html += printReadyElem.innerHTML;
                        var newHTML=html.replace('printer_friendly.gif','');
                        html=newHTML;
                }
                else{
                        //No print class divtags
                        alert("This page has not been configured for printing.");
                        return;
                }

                var pageLocation=document.location+'';

                //bottom blue line
                html += '<table width="100%">';
                html += '<tr bgcolor="#EFEFEF"> <td colspan="2"><img src="/gif/1by1.gif" height="2" width="1" /><br></t'+'d></t'+'r>';
                html += '<tr><td><img src="/visitorsguide/assets/images/print_logo_bottom.gif" align="left" /></'+'td>';
                html += '<td width="90%">';
                html += '<b>This information has been taken from www.gov.pe.ca</b><br />';
                html += '<b>URL:</b> <i>'+pageLocation.replace('\&','\&amp;')+'</i><BR /><BR />';
                html += '</'+'td>';
                html += '<table width="75%"><tr><td><i>Photos and content copyright Tourism Prince Edward Island. All rights reserved.</'+'i></t'+'d></ti'+'r></ta'+'ble>';
                html += '</'+'tr>';
                html += '</ta'+'ble>';
                //disclaimer
                html += '<BR />';
                html += '\n</BO' + 'DY>\n</HT' + 'ML>';
                var printWin = window.open("","printSpecial");
                printWin.document.open();
                printWin.document.write(html);
                printWin.document.close();
                if (gAutoPrint){
                        //printWin.print();
                }
        }
        else{
                alert("Sorry, the print ready feature is only available in modern browsers.");
        }
}
/*
  French version of printSpecial
*/
function printSpecialf()
{
        if (document.getElementById != null){
                var html = '<HTML>\n<HEAD>\n';

                if (document.getElementsByTagName != null)
                {
                        var headTags = document.getElementsByTagName("head");
//                        if (headTags.length > 0){

//                                html += headTags[0].innerHTML;
//                        }

                        html += '\n<link rel="stylesheet" media="screen" href="/visitorsguide/include/css/peiplayCSS_print.css" type="text/css">\n';
                        html += '\n</HE' + 'AD>\n<BODY>\n';
                        //header graphic
                        html += '<table width="100%">';
                        html += '<tr><td colspan="2"><img src="/visitorsguide/assets/images/print_header_f.JPG" height="104" width="600" /><br></t'+'d></t'+'r>';
                        html += '<tr bgcolor="#EFEFEF"> <td colspan="2"><img src="/gif/1by1.gif" height="2" width="1" /><br></t'+'d></t'+'r>';
                        html += '<tr><td colspan="2" align=right><br><i>www.douceurdelile.com</i><br></t'+'d></t'+'r>';
                        html += '</ta'+'ble>';
                }
                var printReadyElem = document.getElementById("printReady");
                if (printReadyElem != null){
                        html += printReadyElem.innerHTML;
                        var newHTML=html.replace('printer_friendly_F.gif','');
                        html=newHTML;
                }
                else{
                        //No print class divtags
                        alert("This page has not been configured for printing.");
                        return;
                }

                var pageLocation=document.location+'';

                //bottom blue line
                html += '<table width="100%">';
                html += '<tr bgcolor="#3e72ae"> <td colspan="2"><img src="/gif/1by1.gif" height="2" width="1" /><br></t'+'d></t'+'r>';
                html += '<tr><td><img src="/visitorsguide/assets/images/print_logo_bottom_f.gif" align="left" /></'+'td>';
                html += '<td width="90%">';
                html += '<b>Cette information est tir&eacute;e du site www.gov.pe.ca</b><br />';
                html += '<b>URL:</b> <i>'+pageLocation.replace('\&','\&amp;')+'</i><BR /><BR />';
                html += '</'+'td>';
                html += '<table width="75%"><tr><td><i>Droits d\'auteur pour les photos et le contenu - Tourisme &Icirc;le-du-Prince-&Eacute;douard. Tous droits r&eacute;serv&eacute;s.</'+'i></t'+'d></ti'+'r></ta'+'ble>';
                html += '</'+'tr>';
                html += '</ta'+'ble>';
                //disclaimer
                html += '<BR />';
                html += '\n</BO' + 'DY>\n</HT' + 'ML>';
                var printWin = window.open("","printSpecial");
                printWin.document.open();
                printWin.document.write(html);
                printWin.document.close();
                if (gAutoPrint){
                        //printWin.print();
                }
        }
        else{
                alert("Sorry, the print ready feature is only available in modern browsers.");
        }
}