$(document).ready(function() {
	if (navigator.userAgent.indexOf('WebKit/') <= -1) {
		var cra_Protocol = (("https:" == document.location.protocol) ? "https://" : "http://");
		var cra_Host = "www.heartriskassessment.com";
		
		// ColorBox Style
		var cra_ColorBoxStyle = document.createElement('link');
		cra_ColorBoxStyle.href = cra_Protocol + cra_Host + "/App_Themes/Default/ColorBox/Rounded-Black/colorbox.css";
		cra_ColorBoxStyle.type = "text/css";
		cra_ColorBoxStyle.rel = "stylesheet";
		cra_ColorBoxStyle.id = "ColorBoxStyle";
		
		// Add elements to the document head
		var cra_Head = document.getElementsByTagName("head").item(0);
		cra_Head.appendChild(cra_ColorBoxStyle);
		
		// Load other scripts and proceed
		$.getScript(cra_Protocol + cra_Host + "/App_Themes/Default/Scripts/jquery.jqURL.js", function(){
			$.getScript(cra_Protocol + cra_Host + "/App_Themes/Default/ColorBox/jquery.colorbox-min.js", function(){
				$("a.heart-tracks").each(function(){
					$(this).colorbox({ iframe: true, href: cra_Protocol + cra_Host + "/TCCH/Heart-Tracks", initialWidth: 100, initialHeight: 100, width: "775", height: "580", opacity: 0.5, overlayClose: false });
				});
				
				if ($.jqURL.get('autostart') != undefined)
				{
					$("a.heart-tracks:first").click();
				}
			});
		})
	}
});
