// JavaScript Document

function getArgs(){

	var args = new Object();

	var query = location.search.substring(1);

	var pairs = query .split("&");

	for (var i = 0; i < pairs.length; i++) {

		var pos = pairs[i].indexOf('=');

		if (pos == -1) continue;

		var argname = pairs[i].substring(0,pos);

		var value = pairs[i].substring(pos+1);

		args[argname] = unescape(value);

	}

	return args;

}

var args = getArgs();



function linkOffsiteContent() {

	el = document.getElementById("overlay");

	el.style.display = (el.style.display == "block") ? "none" : "block";

}

function cancelOffsiteContent() {

	el = document.getElementById("overlay");

	el.style.display = (el.style.visibility == "block") ? "none" : "block";

}

function writeDisclaimer(url) {

    // if this is a valid url
	if( /(((https?)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i.test(url) )
	{
	    var op;

	    op =  "<div id=\"overlay\"><div align=\"left\"><span class=\"disclaimer\">";

	    op += "<span class=\"disclaimer_hdr\">The information on the following pages";

	    op += "<br />was supplied by another organization.</span><br /><br />";

	    op += "SUN Orthopaedic Group is not responsible for the content presented by any";

	    op += " third party. This information is provided to you by SUN Orthopaedic Group ";

	    op += "as a resource to health information on the Web. SUN Orthopaedic Group is not ";

	    op += "endorsing or recommending any particular implant over others.<br /><br />";

	    op += "Thank you for visiting sunortho.com. Please visit again.<br /><br /><center>";

	    op += "<a class=\"disclaimer\" href=\"/?loc=external.asp&disclaimer=false&content=" + url + "\">Continue</a> | ";

	    op += "<a class=\"disclaimer\" href=\"javascript:history.back();\">Cancel</a>";

	    op += "</center></span></div></div>";

	    document.write(op);
    
    }
}



function writeIFrame(url) {

    // if this is a valid url
	if( /(((https?)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i.test(url) )
	{	
	    var op;

	    op =  "<iframe frameborder=\"0\" height=\"500px\" width=\"98%\" src=\"" + url + "\" style=\"border:none;\">";

        op += "</iframe>";

	    document.write(op);
    }
}

/*

Correctly handle PNG transparency in Win IE 5.5 & 6.

http://homepage.ntlworld.com/bobosola. Updated 18-Jan-2006.



Use in <HEAD> with DEFER keyword wrapped in conditional comments:

<!--[if lt IE 7]>

<script defer type="text/javascript" src="pngfix.js"></script>

<![endif]-->



*/



var arVersion = navigator.appVersion.split("MSIE")

var version = parseFloat(arVersion[1])



if ((version >= 5.5) && (document.body.filters)) 

{

   for(var i=0; i<document.images.length; i++)

   {

      var img = document.images[i]

      var imgName = img.src.toUpperCase()

      if (imgName.substring(imgName.length-3, imgName.length) == "PNG")

      {

         var imgID = (img.id) ? "id='" + img.id + "' " : ""

         var imgClass = (img.className) ? "class='" + img.className + "' " : ""

         var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "

         var imgStyle = "display:inline-block;" + img.style.cssText 

         if (img.align == "left") imgStyle = "float:left;" + imgStyle

         if (img.align == "right") imgStyle = "float:right;" + imgStyle

         if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle

         var strNewHTML = "<span " + imgID + imgClass + imgTitle

         + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"

         + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"

         + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 

         img.outerHTML = strNewHTML

         i = i-1

      }

   }

}
