$(window).load(function (){
	var giframe = null;
	var giframecnt = 0;
	var giframetmr = -1;

	giframe = $("body > iframe.notranslate")[0];
	if(giframe != null)
		$(giframe).css("display", "none");
	else
	    giframetmr = setInterval(function(){
	        giframe = $("body > iframe.notranslate")[0];
	        if(giframe != null) {
	            clearInterval(giframetmr);
        		$(giframe).css("display", "none");
            } else if(giframecnt >= 20)
                clearInterval(giframetmr);
            else
    	        giframecnt++;
	    }, 1000);
});

var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
var hasRightVersion  =true;
var counter = 0;
var rightVerDetect = true;
var doPostBack = true;
var searchBase = "/Search/SearchResults.htm";
// Major version of Flash required
var reqMajorVersion = 0;
// Minor version of Flash required
var reqMinorVersion = 0;
// Revision of Flash required
var reqRevision = 0;

if(!String.prototype.startsWith){
	String.prototype.startsWith = function (str) {
		return !this.indexOf(str);
	}
}

function onNavigateLinks(Url)
{
	if(Url!=null && Url!="")
	{
		javascript:document.location.href=Url ;
	}
}
/*
This method get absolute URL for the relative URL entered by the user in the rich edit text box
This method also appends forward slash in case the url entered by user is home directory of the 
site, just to match this status bar information with default text shown by IE in case user hovers
mouse over a link.
*/
function getFullURL(UrlEntered)
{
	var urlString="";
	var urlStringL="";
	var fullUrl="";
	var appendSlash=false;
	urlString=UrlEntered;
	urlStringL=UrlEntered.toLowerCase();
	fullUrl=UrlEntered;
	if (urlStringL.indexOf("http://")!=-1)
	{
		urlString=urlString.replace("http://","");
		if(urlString.indexOf("/")==-1)
		{
			appendSlash=true;//append / in case url is of home directory of a site
		}
	}
	else//it is relative url
	{
		if(urlString.indexOf("/")!=0)
		{
			fullUrl="http://" + document.domain + "/" + urlString;
		}
		else
		{
			fullUrl="http://" + document.domain + urlString;
		}
	}
	javascript:window.status=fullUrl ;
	if(appendSlash)
	{
		javascript:window.status=fullUrl + "/";
	}
}
function StatusBarText(UrlEntered)
{
	if(UrlEntered!=null && UrlEntered!="")
	{
		getFullURL(UrlEntered);
	}else
	{
		javascript:window.status=' ';
	}
}

function renderFlash(flashObjectHTML)
{
    document.write(flashObjectHTML);
}
	
function external(url)
{	
	var sLeavingSiteWarning = "You are now leaving a website maintained by Edwards Lifesciences and going to another site.  This link is provided solely as a service to our users.  Edwards does not review, monitor, or endorse the content on the linked site and is not responsible for the content found there.";
	
	if(url && url != "")
	{
	
		if(url.indexOf("leavingsitewarning=") != -1)
		{
			if(url.indexOf("&",url.indexOf("leavingsitewarning=")) != -1)
			{
				var startIndex = url.indexOf("leavingsitewarning=")+"leavingsitewarning=".length;
				var endIndex = url.indexOf("&",url.indexOf("leavingsitewarning="));
				sLeavingSiteWarning = url.substring(startIndex,endIndex);
			}
			else
			{
				sLeavingSiteWarning = url.substring(url.indexOf("leavingsitewarning=")+"leavingsitewarning=".length);
			}
			url = url.replace("leavingsitewarning="+sLeavingSiteWarning+"&","");
			url = url.replace("&leavingsitewarning="+sLeavingSiteWarning,"");
			url = url.replace("leavingsitewarning="+sLeavingSiteWarning,"");
			if(url.indexOf("?") == url.length-1)
			{
				url = url.replace("?","");
			}
		}
	}
	
	

   	$("#aExternalLink").attr('href',url);
	$("#message").text(sLeavingSiteWarning);
	$("#dialog").dialog('open');
}

/*
Adding some jQuery methods and functions to make the call for our new dialog theme box
This first script is our custom script identifying and using the functions to call our custom
theme box
*/

$(document).ready(function() {
	$('#dialog').dialog({
        autoOpen: false,
        bgiframe: true,
        modal:true,
	    resizable:false,
        width: 600
    });
    
    $('#close_link').bind('click', function() {
	   	closeAlert();		
    });
    
    $('#red_button_link').bind('click', function() {
    	closeAlert();
    });
    
    $('#open_link').bind('click', function() {	
		var WTUrl = "/Pages/WTTracker.aspx?WT.ac="+encodeURIComponent($("#aExternalLink").attr('href'));		
		$.get(WTUrl, function(data) {					
		});
        window.open($("#aExternalLink").attr('href'));
    	closeAlert();
    });
	
	$('#dialog').bind('dialogopen', function(event) {
	
	 	$(".ui-dialog-titlebar").hide();
	 	$("#dialog").parent().removeClass();
	 	$("#dialog").removeClass();
	 	$('.ui-widget-content').css('border', '0px');
		$("#dialog").addClass('ui-dialog-titlebar');
	 	$("#MediaPlayer").hide();
	});

	$('#dialog').bind('dialogclose', function(event) {
		$("#dialog").removeClass('ui-dialog-titlebar');
	 	$("#MediaPlayer").show();		
	});
});

function showAlert()
{
    $("#dialog").dialog('open');
}

function closeAlert()
{
    $("#dialog").dialog('close');
}

/*-----------------------------------------------------------*/

function setPrintable()
{
    var printerForm = document.getElementById("Printer")
	if(printerForm != null)
	{
		
		if(document.getElementById("ContentTD")!=null)
		{
			document.getElementById("InputContents").value = document.getElementById("ContentTD").innerHTML;
		}
		else if(document.getElementById("TableForPageContent")!=null)
		{		    
			
			document.getElementById("InputContents").value = document.getElementById("TableForPageContent").innerHTML;
		}
		//we wont add disclaimers to print friendly version separately as these are already part of content we send 
		//from TableForPageContent node.
		if(document.getElementById('Disclaimer')!=null)
		{
			document.getElementById("InputDisclaimer").value = document.getElementById("Disclaimer").innerHTML;
		}						
		if(document.getElementById('EdPageTitle')!=null)
		{
		
			document.getElementById("InputPageTitle").value = document.getElementById('EdPageTitle').innerHTML;

		}
		else if (document.getElementById('PageTitle_FetchedContent')!=null)
			document.getElementById("InputPageTitle").value = document.getElementById('PageTitle_FetchedContent').innerHTML ;
		else
			document.getElementById("InputPageTitle").value = "" ;
		
		printerForm.action = "/_layouts/Edwards.Moss.Web.WebApp/PrinterForm.aspx";
		printerForm.submit();
	}
}


function Querystring(qs) { // optionally pass a querystring to parse
	this.params = new Object()
	this.get=Querystring_get
	
	if (qs == null)
		qs=location.search.substring(1,location.search.length)

	if (qs.length == 0) return

// Turn <plus> back to <space>
// See: http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.4.1
	qs = qs.replace(/\+/g, ' ')
	var args = qs.split('&') // parse out name/value pairs separated via &
	
// split out each name=value pair
	for (var i=0;i<args.length;i++) {
		var value;
		var pair = args[i].split('=')
		var name = unescape(pair[0])

		if (pair.length == 2)
			value = unescape(pair[1])
		else
			value = name
		
		this.params[name] = value
	}
}

function Querystring_get(key, default_) {
	// This silly looking line changes UNDEFINED to NULL
	if (default_ == null) default_ = null;
	
	var value=this.params[key]
	if (value==null) value=default_;
	
	return value
}



       function autoSignIn()
       {           
             var xmlHttp;
             try
             {
             	document.getElementById("divSigningIn").display.style="block";
                 xmlHttp=new xmlHttpRequest();
             }
             catch(e)
             {
                 try
                 {
                     xmlHttp= new ActiveXObject("Msxml2.XMLHTTP");                     
                 }
                 catch(e)
                 {
                    try
                    {
                       xmlHttp= new ActiveXObject("Microsoft.XMLHTTP");        
                    }
                    catch(e)
                    {
                       //alert("Browser does not support AJAX");
                       return false;
                    }                    
                 }                
              }
              xmlHttp.onreadystatechange=function()
              {
                  if(xmlHttp.readyState==4)
                  {
                       var a= new Querystring();
                       if(a.get("posted")!='true')  
                       {                        
                         //window.location.href=window.location.href+"?posted=true" ;
                         window.location.href=window.location.href;
                       }  
                   }
                   
              }                           
              xmlHttp.open("HEAD","/_layouts/authenticate.aspx",false);              
              xmlHttp.send(null);
              
              
       }
       
              function autoSignOut()
              {           
                    var xmlHttp;
                    try
                    {
                    	document.getElementById("divSigningIn").display.style="block";
                        xmlHttp=new xmlHttpRequest();
                    }
                    catch(e)
                    {
                        try
                        {
                            xmlHttp= new ActiveXObject("Msxml2.XMLHTTP");                     
                        }
                        catch(e)
                        {
                           try
                           {
                              xmlHttp= new ActiveXObject("Microsoft.XMLHTTP");        
                           }
                           catch(e)
                           {
                              //alert("Browser does not support AJAX");
                              return false;
                           }                    
                        }                
                     }
                     xmlHttp.onreadystatechange=function()
                     {
                         if(xmlHttp.readyState==4)
                         {
                              var a= new Querystring();
                              if(a.get("posted")!='true')  
                              {                        
                                window.location.href=window.location.href+"?anon=1" ;
                              }  
                          }
                          
                     }                           
                     xmlHttp.open("HEAD","/_layouts/signout.aspx",false);              
                     xmlHttp.send(null);
                     
                     
       }

function resize_iframe()
{
    try 
    {
        var height;
        if(window.innerHeight)
	    {
        	height=window.innerHeight;//Firefox
        }
        else if(document.documentElement && document.documentElement.clientHeight)
	    {
		    height=document.documentElement.clientHeight;
	    }
        else if (document.body)
	    {
	      height=document.body.clientHeight;//IE
	    }
	    else
	    {
		    clientHeight = document.documentElement.clientHeight;
	    }
        document.getElementById("pdfFrame").style.height=parseInt(height-document.getElementById("pdfFrame").offsetTop-8)+"px";
    }catch (error)
    {
    }
}

function EnabledActiveX(ActiveXTag)
{
	document.write(ActiveXTag);
}

function DisplayContents(FlashContent,AlternateContent,requiredMajorVersion,requiredMinorVersion,requiredRevision)
{
	
	// Major version of Flash required
	//var requiredMajorVersion = 9;
	// Minor version of Flash required
	//var requiredMinorVersion = 0;
	// Revision of Flash required
	//var requiredRevision = 85;
	reqMajorVersion=requiredMajorVersion;
	reqMinorVersion=requiredMinorVersion;
	reqRevision = requiredRevision;
	
	//alert(requiredMajorVersion + "," + requiredMinorVersion + "," + requiredRevision);
    
	hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	//var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	if (hasRightVersion==false)
		rightVerDetect = hasRightVersion;
	
	//IF REQUIRED FLASH VERSION IS INSTALLED
	//alert(hasRightVersion);
	if(hasRightVersion)
		{		
		//alert('hasrightversion=true');
		EnabledActiveX(FlashContent);
		//counter = 0;
		}
	else
		{
	
		//EnabledActiveX('<span style="display:none">' + FlashContent + '</span>');	

		//counter = counter +1;
		//if (counter==1)
		//	{
		//	DisplayContents(FlashContent,AlternateContent,requiredMajorVersion,requiredMinorVersion,requiredRevision);	
		//	counter = 0;
			
		//	}
		//if (counter!=0)
		//	{
			//alert(AlternateContent);
		document.write (AlternateContent);
		//	counter = counter + 1;
		//	}
		}
}

function DisplayContents2(FlashContent,AlternateContent,requiredMajorVersion,requiredMinorVersion,requiredRevision)
{
	reqMajorVersion=requiredMajorVersion;
	reqMinorVersion=requiredMinorVersion;
	reqRevision = requiredRevision;
	hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	if (hasRightVersion==false)
		rightVerDetect = hasRightVersion;
    while (FlashContent != (FlashContent = FlashContent.replace("&lt;","<")));
    while (FlashContent != (FlashContent = FlashContent.replace("&gt;",">")));
	//IF REQUIRED FLASH VERSION IS INSTALLED
	if(hasRightVersion)
		{		
		EnabledActiveX(FlashContent);
		}
	else
		{
		document.location.href(AlternateContent);
		}
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");			
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			var versionRevision = descArray[3];
			if (versionRevision == "") {
				versionRevision = descArray[4];
			}
			if (versionRevision[0] == "d") {
				versionRevision = versionRevision.substring(1);
			} else if (versionRevision[0] == "r") {
				versionRevision = versionRevision.substring(1);
				if (versionRevision.indexOf("d") > 0) {
					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
				}
			}
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}

function ControlVersion()
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}

	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}


function openPopUp_2(url, w, h){

$(document).trigger('CustomFocusOut');
	var xMax, yMax, l, t;
	if (document.all) xMax = screen.width, yMax = screen.height;
	else{	xMax = window.outerWidth, yMax = window.outerHeight;
	}
	if (w>xMax) w = xMax * .9;
	if (h>yMax) h = yMax * .9;
	l = (xMax - w)/2, t = (yMax-h)/2;
	window.open(url,'ImageBrowser','screenX='+l+',left='+l+',screenY='+t+',top='+t+',toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+w+',height='+h);
}


//AC_RunActiveContent

//v1.7
// Flash Player Version Detection
// Detect Client Browser type
// Copyright 2005-2007 Adobe Systems Incorporated.  All rights reserved.
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function ControlVersion()
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}

	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");			
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			var versionRevision = descArray[3];
			if (versionRevision == "") {
				versionRevision = descArray[4];
			}
			if (versionRevision[0] == "d") {
				versionRevision = versionRevision.substring(1);
			} else if (versionRevision[0] == "r") {
				versionRevision = versionRevision.substring(1);
				if (versionRevision.indexOf("d") > 0) {
					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
				}
			}
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}

function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '';
  if (isIE && isWin && !isOpera)
  {
    str += '<object ';
    for (var i in objAttrs)
    {
      str += i + '="' + objAttrs[i] + '" ';
    }
    str += '>';
    for (var i in params)
    {
      str += '<param name="' + i + '" value="' + params[i] + '" /> ';
    }
    str += '</object>';
  }
  else
  {
    str += '<embed ';
    for (var i in embedAttrs)
    {
      str += i + '="' + embedAttrs[i] + '" ';
    }
    str += '> </embed>';
  }

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblclick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
      case "id":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}

;(function($) {
	
$.fn.extend({
	autocomplete: function(urlOrData, options) {
		var isUrl = typeof urlOrData == "string";
		options = $.extend({}, $.Autocompleter.defaults, {
			url: isUrl ? urlOrData : null,
			data: isUrl ? null : urlOrData,
			delay: isUrl ? $.Autocompleter.defaults.delay : 10,
			max: options && !options.scroll ? 10 : 150
		}, options);
		
		// if highlight is set to false, replace it with a do-nothing function
		options.highlight = options.highlight || function(value) { return value; };
		
		// if the formatMatch option is not specified, then use formatItem for backwards compatibility
		options.formatMatch = options.formatMatch || options.formatItem;
		
		return this.each(function() {
			new $.Autocompleter(this, options);
		});
	},
	result: function(handler) {
		return this.bind("result", handler);
	},
	search: function(handler) {
		return this.trigger("search", [handler]);
	},
	flushCache: function() {
		return this.trigger("flushCache");
	},
	setOptions: function(options){
		return this.trigger("setOptions", [options]);
	},
	unautocomplete: function() {
		return this.trigger("unautocomplete");
	}
});

$.Autocompleter = function(input, options) {

	var KEY = {
		UP: 38,
		DOWN: 40,
		DEL: 46,
		TAB: 9,
		RETURN: 13,
		ESC: 27,
		COMMA: 188,
		PAGEUP: 33,
		PAGEDOWN: 34,
		BACKSPACE: 8
	};

	// Create $ object for input element
	var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass);

	var timeout;
	var previousValue = "";
	var cache = $.Autocompleter.Cache(options);
	var hasFocus = 0;
	var lastKeyPressCode;
	var config = {
		mouseDownOnSelect: false
	};
	var select = $.Autocompleter.Select(options, input, selectCurrent, config);
	
	var blockSubmit;
	
	// prevent form submit in opera when selecting with return key
	$.browser.opera && $(input.form).bind("submit.autocomplete", function() {
		if (blockSubmit) {
			blockSubmit = false;
			return false;
		}
	});
	
	// only opera doesn't trigger keydown multiple times while pressed, others don't work with keypress at all
	$input.bind(($.browser.opera ? "keypress" : "keydown") + ".autocomplete", function(event) {
		// a keypress means the input has focus
		// avoids issue where input had focus before the autocomplete was applied
		hasFocus = 1;
		// track last key pressed
		lastKeyPressCode = event.keyCode;
		//added for model code look up ..start
		String.prototype.endsWith = function(str)
        {
            return (this.match(str+"$")==str)
        }
//added for model code look up ...end
		
		
		switch(event.keyCode) {
		
			case KEY.UP:
				event.preventDefault();
				if ( select.visible() ) {
					select.prev();
				} else {
					onChange(0, true);
				}
				break;
				
			case KEY.DOWN:
				event.preventDefault();
				if ( select.visible() ) {
					select.next();
				} else {
					onChange(0, true);
				}
				break;
				
			case KEY.PAGEUP:
				event.preventDefault();
				if ( select.visible() ) {
					select.pageUp();
				} else {
					onChange(0, true);
				}
				break;
				
			case KEY.PAGEDOWN:
				event.preventDefault();
				if ( select.visible() ) {
					select.pageDown();
				} else {
					onChange(0, true);
				}
				break;
			
			// matches also semicolon
			case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA:
			case KEY.TAB:
			case KEY.RETURN:
				if( selectCurrent() ) {
				//model code look up ..start 
				if($(input).attr("id").endsWith("txtModel"))
                {                   
                    modelLookupSubmit();
                }
                	//model code look up ..end
                	else
                	{							    
					// stop default to prevent a form submit, Opera needs special handling
					submitSearchAutocomplete(searchBase,input.value);
					}
					event.preventDefault();
					blockSubmit = true;
					return false;
				}
				break;
				
			case KEY.ESC:
				select.hide();
				break;
				
			default:
				clearTimeout(timeout);
				timeout = setTimeout(onChange, options.delay);
				break;
		}
	}).focus(function(){
		// track whether the field has focus, we shouldn't process any
		// results if the field no longer has focus
		hasFocus++;
	}).blur(function() {
		hasFocus = 0;
		if (!config.mouseDownOnSelect) {
			hideResults();
		}
	}).click(function() {
		// show select when clicking in a focused field
		if ( hasFocus++ > 1 && !select.visible() ) {
			onChange(0, true);
		}
	}).bind("search", function() {
		// TODO why not just specifying both arguments?
		var fn = (arguments.length > 1) ? arguments[1] : null;
		function findValueCallback(q, data) {
			var result;
			if( data && data.length ) {
				for (var i=0; i < data.length; i++) {
					if( data[i].result.toLowerCase() == q.toLowerCase() ) {
						result = data[i];
						break;
					}
				}
			}
			if( typeof fn == "function" ) fn(result);
			else $input.trigger("result", result && [result.data, result.value]);
		}
		$.each(trimWords($input.val()), function(i, value) {
			request(value, findValueCallback, findValueCallback);
		});
	}).bind("flushCache", function() {
		cache.flush();
	}).bind("setOptions", function() {
		$.extend(options, arguments[1]);
		// if we've updated the data, repopulate
		if ( "data" in arguments[1] )
			cache.populate();
	}).bind("unautocomplete", function() {
		select.unbind();
		$input.unbind();
		$(input.form).unbind(".autocomplete");
	});
	
	
	function selectCurrent() {
		var selected = select.selected();
		if( !selected )
			return false;
		
		var v = selected.result;
		previousValue = v;
		
		if ( options.multiple ) {
			var words = trimWords($input.val());
			if ( words.length > 1 ) {
				var seperator = options.multipleSeparator.length;
				var cursorAt = $(input).selection().start;
				var wordAt, progress = 0;
				$.each(words, function(i, word) {
					progress += word.length;
					if (cursorAt <= progress) {
						wordAt = i;
						return false;
					}
					progress += seperator;
				});
				words[wordAt] = v;
				// TODO this should set the cursor to the right position, but it gets overriden somewhere
				//$.Autocompleter.Selection(input, progress + seperator, progress + seperator);
				v = words.join( options.multipleSeparator );
			}
			v += options.multipleSeparator;
		}
		$input.val(v);
		hideResultsNow();
		$input.trigger("result", [selected.data, selected.value]);
		return true;
	}
	
	function onChange(crap, skipPrevCheck) {
		if( lastKeyPressCode == KEY.DEL ) {
			select.hide();
			return;
		}
		
		var currentValue = $input.val();
		
		if ( !skipPrevCheck && currentValue == previousValue )
			return;
		
		previousValue = currentValue;
		
		currentValue = lastWord(currentValue);
		if ( currentValue.length >= options.minChars) {
			$input.addClass(options.loadingClass);
			if (!options.matchCase)
				currentValue = currentValue.toLowerCase();
			request(currentValue, receiveData, hideResultsNow);
		} else {
			stopLoading();
			select.hide();
		}
	};
	
	function trimWords(value) {
		if (!value)
			return [""];
		if (!options.multiple)
			return [$.trim(value)];
		return $.map(value.split(options.multipleSeparator), function(word) {
			return $.trim(value).length ? $.trim(word) : null;
		});
	}
	
	function lastWord(value) {
		if ( !options.multiple )
			return value;
		var words = trimWords(value);
		if (words.length == 1) 
			return words[0];
		var cursorAt = $(input).selection().start;
		if (cursorAt == value.length) {
			words = trimWords(value)
		} else {
			words = trimWords(value.replace(value.substring(cursorAt), ""));
		}
		return words[words.length - 1];
	}
	
	// fills in the input box w/the first match (assumed to be the best match)
	// q: the term entered
	// sValue: the first matching result
	function autoFill(q, sValue){
		// autofill in the complete box w/the first match as long as the user hasn't entered in more data
		// if the last user key pressed was backspace, don't autofill
		if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE ) {
			// fill in the value (keep the case the user has typed)
			$input.val($input.val() + sValue.substring(lastWord(previousValue).length));
			// select the portion of the value not typed by the user (so the next character will erase)
			$(input).selection(previousValue.length, previousValue.length + sValue.length);
		}
	};

	function hideResults() {
		clearTimeout(timeout);
		timeout = setTimeout(hideResultsNow, 200);
	};

	function hideResultsNow() {
		var wasVisible = select.visible();
		select.hide();
		clearTimeout(timeout);
		stopLoading();
		if (options.mustMatch) {
			// call search and run callback
			$input.search(
				function (result){
					// if no value found, clear the input box
					if( !result ) {
						if (options.multiple) {
							var words = trimWords($input.val()).slice(0, -1);
							$input.val( words.join(options.multipleSeparator) + (words.length ? options.multipleSeparator : "") );
						}
						else {
							$input.val( "" );
							$input.trigger("result", null);
						}
					}
				}
			);
		}
	};

	function receiveData(q, data) {
		if ( data && data.length && hasFocus ) {
			stopLoading();
			select.display(data, q);
			autoFill(q, data[0].value);
			select.show();
		} else {
			hideResultsNow();
		}
	};

	function request(term, success, failure) {
		if (!options.matchCase)
			term = term.toLowerCase();
		var data = "";//cache.load(term);
		// recieve the cached data
		if (data && data.length) {
			success(term, data);
		// if an AJAX url has been supplied, try loading the data now
		} else if( (typeof options.url == "string") && (options.url.length > 0) ){
			
			var extraParams = {
				timestamp: +new Date()
			};
			$.each(options.extraParams, function(key, param) {
				extraParams[key] = typeof param == "function" ? param() : param;
			});
			
			$.ajax({
				// try to leverage ajaxQueue plugin to abort previous requests
				mode: "abort",
				// limit abortion to this input
				port: "autocomplete" + input.name,
				dataType: options.dataType,
				url: options.url,
				data: $.extend({
					q: lastWord(term),
					limit: options.max
				}, extraParams),
				success: function(data) {
					var parsed = options.parse && options.parse(data) || parse(data);
					//cache.add(term, parsed);
					success(term, parsed);
				}
			});
		} else {
			// if we have a failure, we need to empty the list -- this prevents the the [TAB] key from selecting the last successful match
			select.emptyList();
			failure(term);
		}
	};
	
	function parse(data) {
		var parsed = [];
		var rows = data.split("\n");
		for (var i=0; i < rows.length; i++) {
			var row = $.trim(rows[i]);
			if (row) {
				row = row.split("|");
				parsed[parsed.length] = {
					data: row,
					value: row[0],
					result: options.formatResult && options.formatResult(row, row[0]) || row[0]
				};
			}
		}
		return parsed;
	};

	function stopLoading() {
		$input.removeClass(options.loadingClass);
	};

};

$.Autocompleter.defaults = {
	inputClass: "ac_input",
	resultsClass: "ac_results",
	loadingClass: "ac_loading",
	minChars: 1,
	delay: 400,
	matchCase: false,
	matchSubset: true,
	matchContains: false,
	cacheLength: 1,
	max: 100,
	mustMatch: false,
	extraParams: {},
	selectFirst: false,
	formatItem: function(row) { return row[0]; },
	formatMatch: null,
	autoFill: false,
	width: 0,
	multiple: false,
	multipleSeparator: ", ",
	highlight: function(value, term) {
	    value = value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<removestrong>$1</removestrong>");
		return value.replace("<removestrong>","").replace("</removestrong>","<strong>") + "</strong>";
	},
    scroll: true,
    scrollHeight: 180
};

$.Autocompleter.Cache = function(options) {

	var data = {};
	var length = 0;
	
	function matchSubset(s, sub) {
		if (!options.matchCase) 
			s = s.toLowerCase();
		var i = s.indexOf(sub);
		if (options.matchContains == "word"){
			i = s.toLowerCase().search(sub.toLowerCase());
		}
		if (i == -1) return false;
		return i == 0 || options.matchContains;
	};
	
	function add(q, value) {
		if (length > options.cacheLength){
			flush();
		}
		if (!data[q]){ 
			length++;
		}
		data[q] = value;
	}
	
	function populate(){
		if( !options.data ) return false;
		// track the matches
		var stMatchSets = {},
			nullData = 0;

		// no url was specified, we need to adjust the cache length to make sure it fits the local data store
		if( !options.url ) options.cacheLength = 1;
		
		// track all options for minChars = 0
		stMatchSets[""] = [];
		
		// loop through the array and create a lookup structure
		for ( var i = 0, ol = options.data.length; i < ol; i++ ) {
			var rawValue = options.data[i];
			// if rawValue is a string, make an array otherwise just reference the array
			rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue;
			
			var value = options.formatMatch(rawValue, i+1, options.data.length);
			if ( value === false )
				continue;
				
			var firstChar = value.charAt(0).toLowerCase();
			// if no lookup array for this character exists, look it up now
			if( !stMatchSets[firstChar] ) 
				stMatchSets[firstChar] = [];

			// if the match is a string
			var row = {
				value: value,
				data: rawValue,
				result: options.formatResult && options.formatResult(rawValue) || value
			};
			
			// push the current match into the set list
			stMatchSets[firstChar].push(row);

			// keep track of minChars zero items
			if ( nullData++ < options.max ) {
				stMatchSets[""].push(row);
			}
		};

		// add the data items to the cache
		$.each(stMatchSets, function(i, value) {
			// increase the cache size
			//options.cacheLength++;
			// add to the cache
			//add(i, value);
		});
	}
	
	// populate any existing data
	setTimeout(populate, 25);
	
	function flush(){
		data = {};
		length = 0;
	}
	
	return {
		flush: flush,
		add: add,
		populate: populate,
		load: function(q) {
			if (!options.cacheLength || !length)
				return null;
			/* 
			 * if dealing w/local data and matchContains than we must make sure
			 * to loop through all the data collections looking for matches
			 */
			if( !options.url && options.matchContains ){
				// track all matches
				var csub = [];
				// loop through all the data grids for matches
				for( var k in data ){
					// don't search through the stMatchSets[""] (minChars: 0) cache
					// this prevents duplicates
					if( k.length > 0 ){
						var c = data[k];
						$.each(c, function(i, x) {
							// if we've got a match, add it to the array
							if (matchSubset(x.value, q)) {
								csub.push(x);
							}
						});
					}
				}				
				return csub;
			} else 
			// if the exact item exists, use it
			if (data[q]){
				return data[q];
			} else
			if (options.matchSubset) {
				for (var i = q.length - 1; i >= options.minChars; i--) {
					var c = data[q.substr(0, i)];
					if (c) {
						var csub = [];
						$.each(c, function(i, x) {
							if (matchSubset(x.value, q)) {
								csub[csub.length] = x;
							}
						});
						return csub;
					}
				}
			}
			return null;
		}
	};
};

$.Autocompleter.Select = function (options, input, select, config) {
	var CLASSES = {
		ACTIVE: "ac_over"
	};
	
	var listItems,
		active = -1,
		data,
		term = "",
		needsInit = true,
		element,
		list;
	
	// Create results
	function init() {
		if (!needsInit)
			return;
		element = $("<div/>")
		.hide()
		.addClass(options.resultsClass)
		.css("position", "absolute")
		.appendTo(document.body);
	
		list = $("<ul/>").appendTo(element).mouseover( function(event) {
			if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') {
	            active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event));
			    $(target(event)).addClass(CLASSES.ACTIVE);            
	        }
		}).click(function(event) {
			$(target(event)).addClass(CLASSES.ACTIVE);
			select();	
			if($(input).attr("id").endsWith("txtModel"))
            {                   
                modelLookupSubmit();
            }
            	//model code look up ..end
        	else
        	{				
	        submitSearchAutocomplete(searchBase,input.value);
	        }
			// TODO provide option to avoid setting focus again after selection? useful for cleanup-on-focus
			input.focus();
			return false;
		}).mousedown(function() {
			config.mouseDownOnSelect = true;
		}).mouseup(function() {
			config.mouseDownOnSelect = false;
		});
		
		if( options.width > 0 )
			element.css("width", options.width);
			
		needsInit = false;
	} 
	
	function target(event) {
		var element = event.target;
		while(element && element.tagName != "LI")
			element = element.parentNode;
		// more fun with IE, sometimes event.target is empty, just ignore it then
		if(!element)
			return [];
		return element;
	}

	function moveSelect(step) {
		listItems.slice(active, active + 1).removeClass(CLASSES.ACTIVE);
		movePosition(step);
        var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE);
        if(options.scroll) {
            var offset = 0;
            listItems.slice(0, active).each(function() {
				offset += this.offsetHeight;
			});
            if((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) {
                list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight());
            } else if(offset < list.scrollTop()) {
                list.scrollTop(offset);
            }
        }
	};
	
	function movePosition(step) {
		active += step;
		if (active < 0) {
			active = listItems.size() - 1;
		} else if (active >= listItems.size()) {
			active = 0;
		}
	}
	
	function limitNumberOfItems(available) {
		return options.max && options.max < available
			? options.max
			: available;
	}
	
	function fillList() {
		list.empty();
		var max = limitNumberOfItems(data.length);
		for (var i=0; i < max; i++) {
			if (!data[i])
				continue;
			var formatted = options.formatItem(data[i].data, i+1, max, data[i].value, term);
			if ( formatted === false )
				continue;
			var li = $("<li/>").html( options.highlight(formatted, term) ).addClass(i%2 == 0 ? "ac_even" : "ac_odd").appendTo(list)[0];
			$.data(li, "ac_data", data[i]);
		}
		listItems = list.find("li");
		if ( options.selectFirst ) {
			listItems.slice(0, 1).addClass(CLASSES.ACTIVE);
			active = 0;
		}
		// apply bgiframe if available
		if ( $.fn.bgiframe )
			list.bgiframe();
	}
	
	return {
		display: function(d, q) {
			init();
			data = d;
			term = q;
			fillList();
		},
		next: function() {
			moveSelect(1);
		},
		prev: function() {
			moveSelect(-1);
		},
		pageUp: function() {
			if (active != 0 && active - 8 < 0) {
				moveSelect( -active );
			} else {
				moveSelect(-8);
			}
		},
		pageDown: function() {
			if (active != listItems.size() - 1 && active + 8 > listItems.size()) {
				moveSelect( listItems.size() - 1 - active );
			} else {
				moveSelect(8);
			}
		},
		hide: function() {
			element && element.hide();
			listItems && listItems.removeClass(CLASSES.ACTIVE);
			active = -1;
		},
		visible : function() {
			return element && element.is(":visible");
		},
		current: function() {
			return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]);
		},
		show: function() {
			var offset = $(input).offset();
			var widthbrowser = document.all ? 3 : 2;
			element.css({
				width: typeof options.width == "string" || options.width > 0 ? options.width : $(input).width() + widthbrowser,
				top: offset.top + input.offsetHeight,
				left: offset.left
			}).show();
            if(options.scroll) {
                list.scrollTop(0);
                list.css({
					maxHeight: options.scrollHeight,
					overflow: 'auto'
				});
				
                if($.browser.msie && typeof document.body.style.maxHeight === "undefined") {
					var listHeight = 0;
					listItems.each(function() {
						listHeight += this.offsetHeight;
					});
					var scrollbarsVisible = listHeight > options.scrollHeight;
                    list.css('height', scrollbarsVisible ? options.scrollHeight : listHeight );
					if (!scrollbarsVisible) {
						// IE doesn't recalculate width when scrollbar disappears
						listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) );
					}
                }
                
            }
		},
		selected: function() {
			var selected = listItems && listItems.filter("." + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);
			return selected && selected.length && $.data(selected[0], "ac_data");
		},
		emptyList: function (){
			list && list.empty();
		},
		unbind: function() {
			element && element.remove();
		}
	};
};

$.fn.selection = function(start, end) {
	if (start !== undefined) {
		return this.each(function() {
			if( this.createTextRange ){
				var selRange = this.createTextRange();
				if (end === undefined || start == end) {
					selRange.move("character", start);
					selRange.select();
				} else {
					selRange.collapse(true);
					selRange.moveStart("character", start);
					selRange.moveEnd("character", end);
					selRange.select();
				}
			} else if( this.setSelectionRange ){
				this.setSelectionRange(start, end);
			} else if( this.selectionStart ){
				this.selectionStart = start;
				this.selectionEnd = end;
			}
		});
	}
	var field = this[0];
	if ( field.createTextRange ) {
		var range = document.selection.createRange(),
			orig = field.value,
			teststring = "<->",
			textLength = range.text.length;
		range.text = teststring;
		var caretAt = field.value.indexOf(teststring);
		field.value = orig;
		this.selection(caretAt, caretAt + textLength);
		return {
			start: caretAt,
			end: caretAt + textLength
		}
	} else if( field.selectionStart !== undefined ){
		return {
			start: field.selectionStart,
			end: field.selectionEnd
		}
	}
};

})(jQuery);


function find_n_hide_div_class_ac_results() 
{
    if(document.getElementById("filteredSearchKey")!=null)
    {
        var divCollection = document.getElementsByTagName("div");
        for (var i=0; i<divCollection.length; i++) 
        {
            var outerHTML = "text";
            outerHTML += divCollection[i].outerHTML;
            if(divCollection[i].getAttribute("class") == "ac_results" || outerHTML.indexOf("class=ac_results") >= 0) 
            {
                divCollection[i].style.display = 'none';
                break;
            } 
        }
    }
}

function DetectQuickTimePlayer()
{
var qtInstalled = false;
qtObj = false;
if (navigator.plugins && navigator.plugins.length)
{
       for (var i=0; i < navigator.plugins.length; i++ )
       {
           var plugin = navigator.plugins[i];
            if (plugin.name.indexOf("QuickTime") > -1)
            {
	qtInstalled = true;
            }
      }
}
return qtInstalled;
}

function getInternetExplorerVersion()
{
  var rv = -1; 
  if (navigator.appName == "Microsoft Internet Explorer")
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}

function checkIEVersion_Eight_or_below()
{
  var ver = getInternetExplorerVersion();

  if ( ver > -1 )
  {
    if ( ver <= 8.0 ) 
     return true;
    else
      return false;
  }  
}
 function IphoneLink(Link, alternateUrl, LinkText) {
        if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPad/i)) || (navigator.userAgent.match(/iPod/i))) {
            document.write('<a href="' + Link + '">' + LinkText + '</a>');
        } else {
            document.write('<a onclick="return itmsOpen(\'' + Link + '\',\'' + alternateUrl + '\',true)" href="' + Link + '&uo=4">' + LinkText + '</a>');
        }
    }
function AppLink(link,Linktext)
{
document.write('<a href="'+ link +'">'+Linktext+'</a>');
}

function GetFlashObject(parentobject) {
	var FlashObject = null;
	if(isIE)
		FlashObject = $(parentobject).contents().find('object').filter(function() { return (/clsid:d27cdb6e-ae6d-11cf-96b8-444553540000/i).test( $(this).attr('classid')); })[0];
	if(!FlashObject)
		FlashObject = $(parentobject).contents().find('embed').filter(function() { return typeof($(this).attr('type')) != 'undefined' ? (/application\/x-shockwave-flash/i).test( $(this).attr('type')) : (/.+getflashplayer.*/i).test( $(this).attr('pluginspage')); })[0];
	return FlashObject;
}

var OpenDialogBoxFullScreen = false;

function OpenDialogBox(url, title, width, height, resize, customaction) {
    var Width = Number(width);
    var Height = Number(height);
    var Resize = (resize == "1" ? true : false);
	var FullScreen = ((customaction != null && typeof(customaction) == 'string' && customaction.indexOf('fullscreen') != -1) ? true : false);
	var MaintainAspect = ((customaction != null && typeof(customaction) == 'string' && customaction.indexOf('maintainaspect') != -1) ? true : false);
	var HidePrinterIcon = ((customaction != null && typeof(customaction) == 'string' && customaction.indexOf('hideprintericon') != -1) ? true : false);
	
	
	
	var DialogWidth = Width;
	var DialogHeight = Height;
	if(Resize)
		{ DialogWidth += 16; DialogHeight += 39; }
	else
		DialogHeight += 23;
	
    var $dialog = $('<div></div>').append('<iframe id="popupiframe" frameborder="0" scrolling="no" src="" width="' + Width + '" height="' + Height + '"></iframe>').dialog({
		modal: true,
		autoOpen: false,
		resizable : Resize,
		width: DialogWidth,
		height: DialogHeight,
		title: title.replace(/&apos;/gi, "'").replace(/&quot;/gi, "\"").replace(/&gt;/gi, ">").replace(/&lt;/gi, "<").replace(/&amp;/gi, "&"),
		open: function(event, ui) {
			OpenDialogBoxFullScreen = false;
			$(document).trigger('CustomFocusOut');
			
			if(Resize)
			{				
				var IFrame = jQuery('iframe[id=popupiframe]', $dialog)[0];
				IFrame.width = $dialog.width();
				IFrame.height = $dialog.height();							
			}
		 
				$dialog.css({'overflow': 'hidden'});
			
			var IFrame = jQuery('iframe[id=popupiframe]', $dialog).one("load", function() {
				if(HidePrinterIcon) {
					var PrinterTable = $(this).contents().find('#FramelessPrinterTable');
					if(PrinterTable != null)
						$(PrinterTable).hide();
				}
			}).attr('src', url).get(0);
			
			if(FullScreen)
			{
				if(Resize == false)				
				$( this ).dialog( "option", "resizable", false );
								
				
						 
				$('.ui-dialog-title').after('<a style="-moz-user-select: none;height:18px;margin:-10px 17px 0;padding:1px;position:absolute;right:0.3em;top:50%;width:19px;" unselectable="on" role="button" class="ui-corner" href="#"><span style="-moz-user-select: none;" unselectable="on" class="ui-icon ui-icon-arrow-4-diag"></span></a>');
				$('.ui-icon-arrow-4-diag').one('click', function() {
					OpenDialogBoxFullScreen = true;					
					
					
					var windowWidth = $(window).width() - 2;
					var windowHeight = $(window).height() - 2;
					
					$(this).css("display", "none");
					$dialog.dialog("option", "resizable", false);
					$dialog.dialog("option", "position", [0,0]);
					$dialog.dialog("option", "width", windowWidth);
					$dialog.dialog("option", "height", windowHeight);				
					 
					
					if(Resize)
						$dialog.css({"height": windowHeight, "width": windowWidth, "overflow": "hidden"});
					else
						$dialog.css({"height": windowHeight, "width": windowWidth});
					
					var oldWidth = IFrame.width;
					var oldHeight = IFrame.height;
					IFrame.width = windowWidth;
					IFrame.height = windowHeight;

					var FlashObject = GetFlashObject($(IFrame));
					if(MaintainAspect && FlashObject) {
						FlashObject.width = FlashObject.width * (IFrame.width / oldWidth);
						FlashObject.height = FlashObject.height * (IFrame.height / oldHeight);
					}
					return false;
				});
			}
		},
		close: function (event, ui) {
			$(document).trigger('CustomFocusIn');
			$(this).dialog('destroy');
			$(this).html('');
		},
		resize: function(event, ui) {
			if(Resize) {			
			    
				$dialog.css({'overflow': 'hidden'});
				
				var IFrame = jQuery('iframe[id=popupiframe]', $dialog)[0];				
				var oldWidth = IFrame.width;
				var oldHeight = IFrame.height;							 	
				
			 			
				
				IFrame.width = $dialog.width();
				IFrame.height = $dialog.height();			
				

				var FlashObject = GetFlashObject($(IFrame));				 
				
				
				if(MaintainAspect && FlashObject) {
					FlashObject.width = FlashObject.width * (IFrame.width / oldWidth);
					FlashObject.height = FlashObject.height * (IFrame.height / oldHeight);
				}
				
			}
		}
	});
		
    $dialog.dialog('open');
    return false;
}

$(document).ready(function() {
    $(document.body).append("<img src='/SiteCollectionImages/common/home.png' style='display:none;' />");
    $(document.body).append("<img src='/SiteCollectionImages/common/loading.gif' style='display:none;' />");
});

function PopUp(url, title, width, height, autoscroll) {
    var htmlContent = "";
    htmlContent = htmlContent + "<table cellpadding='0' cellspacing='0' border='0'>";
    htmlContent = htmlContent + "<tr>";
    htmlContent = htmlContent + "<td style='background:url(\"/SiteCollectionImages/common/home.png\") no-repeat -83px -23px;width:16px;height:16px;'></td>";
    htmlContent = htmlContent + "<td style='background-color:#FFFFFF;height:16px;'></td>";
    htmlContent = htmlContent + "<td style='background:url(\"/SiteCollectionImages/common/home.png\") no-repeat -100px -23px;width:16px;height:16px;'></td>";
    htmlContent = htmlContent + "</tr>";
    htmlContent = htmlContent + "<tr style='background-color:#FFFFFF;'>";
    htmlContent = htmlContent + "<td></td>";
    htmlContent = htmlContent + "<td>";
    htmlContent = htmlContent + "<table cellspacing='0' cellpadding='0' border='0' style='width:100%;margin-bottom:7px;font-weight:bold;font-size:12pt;font-family:Arial;'>";
    htmlContent = htmlContent + "<tr>";
    htmlContent = htmlContent + "<td class='titletd' style='color:#606060;'></td>";
    htmlContent = htmlContent + "<td style='width:50%;' align='right'><a class='close' href='javascript:void(0)' style='float:right;'><div style='color:#D0D0D0;line-height:22px;vertical-align:middle;float:left;margin-right:5px;'>Close window</div><div style='background:url(\"/SiteCollectionImages/common/home.png\") no-repeat -83px -57px;float:left;width:22px;height:22px;'></div></a><br class='clearfloat' /></td>";
    htmlContent = htmlContent + "</tr>";
    htmlContent = htmlContent + "</table>";
    htmlContent = htmlContent + "</td>";
    htmlContent = htmlContent + "<td></td>";
    htmlContent = htmlContent + "</tr>";
    htmlContent = htmlContent + "<tr style='background-color:#FFFFFF;'>";
    htmlContent = htmlContent + "<td style='width:16px;'></td>";
    htmlContent = htmlContent + "<td class='contenttd' style='height:160px;width:160px;' align='center' valign='middle'><img src='/SiteCollectionImages/common/loading.gif' /></td>";
    htmlContent = htmlContent + "<td style='width:16px;'></td>";
    htmlContent = htmlContent + "</tr>";
    htmlContent = htmlContent + "<tr>";
    htmlContent = htmlContent + "<td style='background:url(\"/SiteCollectionImages/common/home.png\") no-repeat -83px -40px;width:16px;height:16px;'></td>";
    htmlContent = htmlContent + "<td style='background-color:#FFFFFF;height:16px;'></td>";
    htmlContent = htmlContent + "<td style='background:url(\"/SiteCollectionImages/common/home.png\") no-repeat -100px -40px;width:16px;height:16px;'></td>";
    htmlContent = htmlContent + "</tr>";
    htmlContent = htmlContent + "</table>";
    
    var scroll = (autoscroll ? "auto" : "no");
    var IFrame = $('<iframe id="popupiframe" frameborder="0" scrolling="' + scroll + '" style="margin:0;padding:0;display:none;" src="" width="' + width + '" height="' + height + '"></iframe>').one("load", function() {
        $(this).parent().children().eq(0).css("display", "none");
        $(this).css("display", "block");
    });
    
    var dialog = $("<div></div>"); 
    $(dialog).dialog({
        modal: true,
        autoOpen: false,
        resizable : false,
        closeOnEscape: true,
        draggable: false,
        open: function(event, ui) {
            $(this).siblings().remove();
            $(this).parent().attr("class", "ui-dialog").css({"width": "auto"});
            $(this).removeClass("ui-dialog-content ui-widget-content").css({"display": "block", "padding": "0px"});
            $("div.ui-widget-overlay").css({"background-color":"#000000", "-ms-filter":"progid:DXImageTransform.Microsoft.Alpha(Opacity=35)", "filter":"alpha(opacity=35)", "-moz-opacity":".35", "-khtml-opacity":".35", "opacity":".35"});
            
            $(this).append(htmlContent);
            
            $(this).find("a.close").bind("click", function() {
                $(dialog).dialog("close");
            });
            
            $(this).parent().animate({
                top:$(window).scrollTop() + (($(window).height() - height - 61) / 2),
                left:$(window).scrollLeft() + (($(window).width() - width - 32) / 2)
            }, 500);

            $(this).find("td.contenttd").animate({
                width:width,
                height:height
            }, 500, function() {
                $(dialog).find("td.titletd").html(title);
                $(this).append($(IFrame));
                $(IFrame).attr("src", url);
            });
        }
    });

    $(dialog).bind("dialogclose", function(event) {
        $(IFrame).die();
        $(IFrame).attr("src", "");
        $(dialog).dialog("destroy");
        $(dialog).remove();
    });
    
    $(dialog).dialog("open");
    return false;
}

(function($){
    var dataArray = new Array();
    var sourceArray = new Array();
    
    $.resourceLoadDelay = 500;
    $.resourceLoadFailure = 3;
    
	$.fn.cacheResource = function(source) {

	    var arrayIndex = -1;
	    var sourceString = source.toLowerCase();
	    var callbackEventName = (arguments.length > 1 ? arguments[1] : null);
	    
	    if((arrayIndex = jQuery.inArray(sourceString, sourceArray)) == -1 || !dataArray[arrayIndex].loaded) {
	        if(arrayIndex == -1) {
                arrayIndex = sourceArray.length;
                dataArray[arrayIndex] = new Object();
                dataArray[arrayIndex].loaded = false;
                dataArray[arrayIndex].element = null;
                dataArray[arrayIndex].loadTime = 0;
                dataArray[arrayIndex].loadFailure = 0;
				dataArray[arrayIndex].callbackEvent = callbackEventName;
                sourceArray[arrayIndex] = sourceString;
	        }
	        
	        if(dataArray[arrayIndex].loadFailure < $.resourceLoadFailure) {
                if((new Date().getTime()) - dataArray[arrayIndex].loadTime > $.resourceLoadDelay) {
					               
					var image = null;					
					if(sourceString.indexOf(".svg") > 0)
					{
						var embed = jQuery("<embed type='image/svg+xml' pluginspage='http://www.adobe.com/svg/viewer/install/' width='100%' height = '100%' wmode='opaque'  />");						
						dataArray[arrayIndex].element = $(embed);
						
						if(!document.getElementById("Hdiv")) {
							var Hdiv = jQuery("<div />");
							$(Hdiv).attr("id","Hdiv");
							$(Hdiv).attr("style","width:10px;height:10px");
							$(Hdiv).css({visibility:'hidden'});
							$('body').append($(Hdiv));
						}
						else
							document.getElementById("Hdiv").innerHtml = "";
						
						$(embed)[0].addEventListener("load", function(e) {
							var innerIndex = 0;
							while(innerIndex < dataArray.length)
							{						
								if($(dataArray[innerIndex].element)[0] == e.target)
									break;							
								else
									innerIndex++;
							}
						
							dataArray[innerIndex].loaded = true;
						
							if(dataArray[innerIndex].callbackEvent)
								$(document).trigger(dataArray[innerIndex].callbackEvent);
						}, true);
						
						$(embed).attr("src", source);	
						$("#Hdiv").append($(embed));
					}
					else
					{
						image = jQuery("<img />");
						$(image).one("load", {index: arrayIndex, callbackEvent: callbackEventName}, function(e) {
		                    if(this.naturalWidth === 0)
		                        $(this).trigger("error");
		                    else {
		                        $(this).unbind("error");
		                        dataArray[e.data.index].loaded = true;
		                        dataArray[e.data.index].element = $(this);
		                        if(e.data.callbackEvent)
	                                $(document).trigger(e.data.callbackEvent);
							}
						});
					   	            
						$(image).one("error", {index: arrayIndex}, function(e) {
							dataArray[arrayIndex].loadTime = 0;
							dataArray[arrayIndex].loadFailure++;
						});
					
						$(image).attr("src", source + "?param=" + Math.floor(Math.random() * 0xffffff));					
					}
					
	                dataArray[arrayIndex].loadTime = (new Date().getTime());
	            }
	        }
	    } else {
	        if(callbackEventName)
                $(document).trigger(callbackEventName);
	    }
	};
	
	$.fn.getCachedResource = function(source) {
	    var arrayIndex = -1;	    
	    if((arrayIndex = jQuery.inArray(source.toLowerCase(), sourceArray)) != -1 && dataArray[arrayIndex].loaded)
			return $(dataArray[arrayIndex].element)[0];   
	    setTimeout(function(){ jQuery.fn.cacheResource(source); }, 0);
        return null;
	};
})(jQuery);

//SmartSource Data Collector Copyright 1996-2005 WebTrends Inc V7.5
(function(a){a.registerWebTrends=function(){var n=new Array;var b=0;var k=new Object();var p=new Object();var i=new Object();var q=new Array();function o(t){var v=t;v=v.replace("http://","");if(v.substring(0,v.indexOf("/"))!=""){v=v.substring(0,v.indexOf("/"))}var u=t;u=u.replace("http://","");u=u.replace(v,"");if(u==""){u="/"}if(v!=""&&u!=""){c("DCS.dcssip",v,"DCS.dcsuri",u,"WT.ti","link to "+t)}}var d="ss.edwards.com";var j="dcse19fcay9lyrh1jx0h3576n_4o2g";if((typeof(gConvert)!="undefined")&&gConvert&&(document.cookie.indexOf(gFpc+"=")==-1)){document.write("<SCRIPT Language='JavaScript' SRC='http"+(window.location.protocol.indexOf("https:")==0?"s":"")+"://"+d+"/"+j+"/wtid.js'></SCRIPT>")}function c(){for(var u=0;u<arguments.length;u++){if(arguments[u].indexOf("WT.")==0){p[arguments[u].substring(3)]=arguments[u+1];u++}if(arguments[u].indexOf("DCS.")==0){k[arguments[u].substring(4)]=arguments[u+1];u++}if(arguments[u].indexOf("DCSext.")==0){i[arguments[u].substring(7)]=arguments[u+1];u++}}var t=new Date();k.dcsdat=t.getTime();l()}function g(){var u=new Date();p.tz=u.getTimezoneOffset()/60*-1;if(p.tz==0){p.tz="0"}p.bh=u.getHours();p.ul=navigator.appName=="Netscape"?navigator.language:navigator.userLanguage;if(typeof(screen)=="object"){p.cd=navigator.appName=="Netscape"?screen.pixelDepth:screen.colorDepth;p.sr=screen.width+"x"+screen.height}if(typeof(navigator.javaEnabled())=="boolean"){p.jo=navigator.javaEnabled()?"Yes":"No"}if(document.title){p.ti=document.title}p.js="Yes";if(typeof(gVersion)!="undefined"){p.jv=gVersion}if(document.body&&document.body.addBehavior){document.body.addBehavior("#default#clientCaps");if(document.body.connectionType){p.ct=document.body.connectionType}document.body.addBehavior("#default#homePage");p.hp=document.body.isHomePage(location.href)?"1":"0"}if(parseInt(navigator.appVersion)>3){if((navigator.appName=="Microsoft Internet Explorer")&&document.body){p.bs=document.body.offsetWidth+"x"+document.body.offsetHeight}else{if(navigator.appName=="Netscape"){p.bs=window.innerWidth+"x"+window.innerHeight}}}p.fi="No";if(window.ActiveXObject){if((typeof(gFV)!="undefined")&&(gFV.length>0)){p.fi="Yes";p.fv=gFV}}else{if(navigator.plugins&&navigator.plugins.length){for(var w=0;w<navigator.plugins.length;w++){if(navigator.plugins[w].name.indexOf("Shockwave Flash")!=-1){p.fi="Yes";p.fv=navigator.plugins[w].description.split(" ")[2];break}}}}k.dcsdat=u.getTime();k.dcssip=window.location.hostname;k.dcsuri=window.location.pathname;if(typeof(resourceurl)==="string"){var v=document.createElement("a");v.href=resourceurl;k.dcssip=v.hostname;k.dcsuri=v.pathname}if(window.location.search){k.dcsqry=window.location.search;if(q.length>0){for(var w=0;w<q.length;w++){var y=k.dcsqry.indexOf(q[w]);if(y!=-1){var x=k.dcsqry.substring(0,y);var t=k.dcsqry.substring(y+q[w].length,k.dcsqry.length);k.dcsqry=x+t}}}}if((window.document.referrer!="")&&(window.document.referrer!="-")){if(!(navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)<4)){k.dcsref=window.document.referrer}}}function h(u,t){return"&"+u+"="+m(t)}function m(t){if(typeof(RE)!="undefined"){var u=new String(t);for(R in RE){u=u.replace(RE[R],R)}return u}else{return escape(t)}}function s(t){if((typeof(gHref)!="undefined")&&(gHref.length>0)){window.location=gHref;gHref=""}}function e(t){if(document.images){n[b]=new Image;if((typeof(gHref)!="undefined")&&(gHref.length>0)){n[b].onload=n[b].onerror=s}n[b].src=t;b++}else{a.get(t)}}function r(){var t;if(document.all){t=document.all.tags("meta")}else{if(document.documentElement){t=document.getElementsByTagName("meta")}}if(typeof(t)!="undefined"){for(var u=1;u<=t.length;u++){var v=t.item(u-1);if(v.name){if(v.name.indexOf("WT.")==0){p[v.name.substring(3)]=v.content}else{if(v.name.indexOf("DCSext.")==0){i[v.name.substring(7)]=v.content}else{if(v.name.indexOf("DCS.")==0){k[v.name.substring(4)]=v.content}}}}}}}function l(){var t="http"+(window.location.protocol.indexOf("https:")==0?"s":"")+"://"+d+(j==""?"":"/"+j)+"/dcs.gif?";for(N in k){if(k[N]){t+=h(N,k[N])}}for(N in p){if(p[N]){t+=h("WT."+N,p[N])}}for(N in i){if(i[N]){t+=h(N,i[N])}}if(t.length>2048&&navigator.userAgent.indexOf("MSIE")>=0){t=t.substring(0,2040)+"&WT.tu=1"}e(t)}function f(t){if(typeof(window[t])=="function"){window[t]()}}g();r();f("dcsAdv");l()}})(jQuery);

