//Begin Random Book Cover
function randomBookCover(){
		
    var images = [["/Publications/ICAPBookSeries/SwimmingwithCrocodiles","swimming_with_crocodiles_88x114.gif", "Swimming with Crocodiles: The Culture of Extreme Drinking", ""],
				  ["/Portals/0/download/all_pdfs/Policy Tools/Overview - Drinking Patterns and Health Outcomes.pdf", "overview_drinking_patterns_and_health_outcomes_88x114.gif", "Drinking Patterns & Health Outcomes", "_blank"],      
				  ["/Portals/0/download/all_pdfs/Policy Tools/Guide to Creating Integrative Policies.pdf", "guide_to_creating_integrative_policies_88x114.gif", "Guide to Creating Integrative Alcohol Policies", "_blank"],   
				  ["/Portals/0/download/all_pdfs/Policy Tools/ICAP Review 3 - Noncommercial Alcohol in Three Regions.pdf", "icap_review_3_noncommercial_alcohol_in_three_regions_88x114.gif", "Noncommercial Alcohol in Three Regions", "_blank"],	  
				  ["/Portals/0/download/all_pdfs/Policy Tools/Periodic Review on Drinking and Culture - Issue 1.pdf","periodic_review_on_drinking_and_culture_issue_1_88x114.gif", "ICAP Periodic Review on Drinking &amp; Culture", "_blank"],
                  ]
    
    var randomnumber = Math.floor(Math.random()*(images.length)) 

    var banner_div = $("banner");
    var image_url = images[randomnumber][0];
    var image_src = images[randomnumber][1];
	var image_alt = images[randomnumber][2];
	var url_target = images[randomnumber][3];
    banner_div.innerHTML = '<a target="' + url_target + '" href="' + image_url + '"><img id="banner" src="/Portals/_default/Skins/icap_main/_design/images/book/' + image_src + '" alt="' + image_alt + '" /></a><p><strong>' + image_alt + '</strong></p>';

}



//Begin Toolkit Dropdown
function OnChange(dropdown){
	var myindex  = dropdown.selectedIndex
	var SelValue = dropdown.options[myindex].value
	var baseURL  = "http://www.icap.org"
	top.location.href = baseURL +SelValue;
}


function toggle (postid) {
   whichpost = document.getElementById(postid);
   if (whichpost.className=="shownContent") { 
      whichpost.className="hideContent";
   }
   else {
      whichpost.className="shownContent";
   }
}


//Begin Print function
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
var gAutoPrint = true; // Tells whether to automatically call the print function
function printSpecial()
{
	if (document.getElementById != null)
	{
		var html = '<html>\n<head>\n<link rel="stylesheet" type="text/css" media="screen" href="/Portals/_default/Skins/icap_main/_design/css/print.css">\n<link rel="stylesheet" type="text/css" media="print" href="/Portals/_default/Skins/icap_main/_design/css/print.css">';

		html += '\n</head>\n<body>\n';

		var header = '<div id="header">' + document.getElementById("header").innerHTML + '</div>';
		var title = '<h1>' + document.getElementById("dnn_dnnBREADCRUMB_lblBreadCrumb").innerHTML + '</h1>';
		var content = '<div id="content">' + document.getElementById("dnn_ContentPane").innerHTML + '</div>';
		var footer = '<div id="footer">' + document.getElementById("footer").innerHTML + '</div>';

		if (content != null)
			{
				html += header + title + content + footer
			}
		else
			{
				alert("Sorry, due to an error on this site, this page cannot be printed");
				return;
			}

		html += '\n</body>\n</html>';

		var printWin = window.open("","printSpecial");
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
		if (gAutoPrint)
		printWin.print();

	}
	else
	{
		alert("The print ready feature is only available if you are using a browser. Please update your browser.");
	}
}

