var gAutoPrint;
//gAutoPrint = true; // Flag for whether or not to automatically call the print function

function printSpecial(banner, blnHasLeftMargin)
{
	if (document.getElementById != null)
	{
		var html = '<HTML>\n<HEAD>\n';

        //I don't want to copy the styles from the main website, because whatever
        // I have here is what I need to be able to copy and use for email blasts.
		//if (document.getElementsByTagName != null)
		//{
		//	var headTags = document.getElementsByTagName("head");
		//	if (headTags.length > 0)
		//		html += headTags[0].innerHTML;
		//}
		
		html += '<link rel="stylesheet" type="text/css" href="styles/core.css"/>\n'

		html += '\n</HEAD>\n<BODY style="height:100%;margin:0;padding:0;">\n';
		//html += '\n</HEAD>\n<BODY>\n';
		
		//Gray Background
        html += '\n<div style="background:url(http://www.westernlakes.com/images/Shadow_Background.jpg) repeat-x top left;margin:0px;font-family:tahoma, arial, sans-serif;color:#3d3f3f;width:750px;max-height:1000px;">\n';
        
        //Banner Image
		if (banner == 'service')
		{
            //White Content Area
            html += '\n<div style="width:700px;border:#999999 1px solid;position:relative;margin-left:25px;padding-bottom:5px;z-index:1;background-color:#fff;margin-top:5px;max-height:1000px;">\n';
            html += '\n<img src="http://www.westernlakes.com/images/service_banner.jpg" alt="Western Lakes Golf Club" style="width:100%;" />\n';
        }
        else if (banner == 'fountain')
        {
            //White Content Area
            html += '\n<div style="width:700px;border:#999999 1px solid;position:relative;margin-left:25px;padding-bottom:5px;z-index:1;background-color:#fff;margin-top:5px;max-height:1000px;">\n';        
            html += '\n<img src="http://www.westernlakes.com/images/fountain_banner.jpg" alt="Western Lakes Golf Club" style="width:100%;" />\n';                    
        }
        else if (banner == 'fountain_with_address')
        {
            //White Content Area
            html += '\n<div style="width:700px;border:#999999 1px solid;position:relative;margin-left:25px;padding-bottom:5px;z-index:1;background-color:#fff;margin-top:5px;max-height:1000px;">\n';        
            html += '\n<img src="http://www.westernlakes.com/images/fountain_banner_with_address.jpg" alt="Western Lakes Golf Club" style="width:100%;" />\n';                    
        }
        else if (banner == 'none')
        {
            //White Content Area
            html += '\n<div style="width:700px;border:#999999 1px solid;position:relative;margin-left:25px;padding-bottom:5px;z-index:1;background-color:#fff;margin-top:5px;max-height:1000px;">\n';        
        }
        //else if (banner == 'WLbannerlogo_fountain_Facilities.jpg')
        //{
        //    //Smaller White Content Area
        //    html += '\n<div style="width:700px;border:#999999 1px solid;margin:auto;position:relative;margin-left:25px;padding-bottom:5px;z-index:1;background-color:#fff;margin-top:5px;max-height:500px;">\n';        
        //    html += '\n<img src="http://www.westernlakes.com/images/\n' + banner + '\n" alt="Western Lakes Golf Club" style="width:100%;" />\n';                
        //}
        else
        {
            //White Content Area
            html += '\n<div style="width:700px;border:#999999 1px solid;position:relative;margin-left:25px;padding-bottom:5px;z-index:1;background-color:#fff;margin-top:5px;max-height:1000px;">\n';        
            html += '\n<img src="http://www.westernlakes.com/images/\n' + banner + '\n" alt="Western Lakes Golf Club" style="width:100%;" />\n';                
        }
        
        //Content div
        if (blnHasLeftMargin == true)
        {
            html += '\n<div style="padding-top:5px;padding-left:15px;padding-bottom:5px;">\n';        
        }
        else
        {
            html += '\n<div style="padding-top:5px;padding-bottom:5px;">\n';        
        }
                
		var printReadyElem = document.getElementById("printReady");

		if (printReadyElem != null)
		{
				html += printReadyElem.innerHTML;
		}
		else
		{
			alert("Could not find the printReady section in the HTML");
			return;
		}
		
		html += '\n</div></div></div>\n';

		html += '\n</BODY>\n</HTML>';

		var printWin = window.open("","printSpecial", "width=767,height=550,screenX=50,screenY=100,left=50,top=100,toolbar=yes,status=yes,location=no,menubar=yes,scrollbars=yes");
		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.");
	}
}