/* General js for site */

// opening popup win with dog image
function enlargeDog(dogid) {
	var dogid = dogid; // id of the image
	var output = "";	
	var enlargement = window.open("", "enlarged" , "width=550, height=450, toolbars=no, resize=yes, scrollbars=yes, left=10, top=10");
	
	output += "<html><head><title>Havanney's Havanese | Image</title><link rel=\"stylesheet\" type=\"text/css\" href=\"/css/styles.css\" /></head><body>";
	output += "<div class=\"textBlack\" style=\"padding:10px\"><img src=\"/modules/downloadMed.php?dogid=" + dogid + "\" alt=\"Dog Image\" /><br /><br />";
	output += "<a href=\"javascript:window.close();\">close</a></div>";
	output += "</body></html>";
	enlargement.document.write(output);
	enlargement.document.close();
	enlargement.focus();
}

// open in new window code from http://www.sitepoint.com/article/standards-compliant-world
function externalLinks() {
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
			anchor.target = "_blank";
	}
}
