// sIFR formatting

if(typeof sIFR == "function"){

	sIFR.replaceElement(named({sSelector:"ul.nav li", sFlashSrc:"../sifr/helveticaneueLT_medcon67.swf", sColor:"#ffffff", sLinkColor:"#ffffff", sBgColor:"#efefef", nPaddingTop:"0", nPaddingRight:"0", nPaddingBottom:"33", nPaddingLeft:"0", sFlashVars:"textalign=center", sWmode:"transparent"}));
	
	sIFR.replaceElement(named({sSelector:"#intro h2", sFlashSrc:"../sifr/helveticaneueLT_medcon67.swf", sColor:"#1D5C99", sLinkColor:"#1D5C99", sBgColor:"#efefef", sHoverColor:"#004990", nPaddingTop:"0", nPaddingRight:"0", nPaddingBottom:"0", nPaddingLeft:"0", sFlashVars:"textalign=left", sWmode:"transparent"}));
	
		sIFR.replaceElement(named({sSelector:"h2", sFlashSrc:"../sifr/helveticaneueLT_medcon67.swf", sColor:"#1D5C99", sLinkColor:"#1D5C99", sBgColor:"#efefef", sHoverColor:"#004990", nPaddingTop:"0", nPaddingRight:"0", nPaddingBottom:"0", nPaddingLeft:"0", sFlashVars:"textalign=left", sWmode:"transparent"}));
	
	sIFR.replaceElement(named({sSelector:"#rightcol h4", sFlashSrc:"../sifr/helveticaneueLT_medcon67.swf", sColor:"#1D5C99", sLinkColor:"#1D5C99", sBgColor:"#efefef", sHoverColor:"#004990", nPaddingTop:"0", nPaddingRight:"0", nPaddingBottom:"0", nPaddingLeft:"0", sFlashVars:"textalign=left", sWmode:"transparent"}));
	
};

// Corporate Sponsor Information

function showHowto(toshow)
	{
	document.getElementById(toshow).style.display = 'block'; 
	}
	
function hideHowto(toshow)
	{
	document.getElementById(toshow).style.display = 'none'; 
	}

// Login form validator

		function ValidateLoginForm()
		{
			if (document.login.LoginMemberId.value.length <= 0)
				{
				alert("Please enter a Member Id");
				document.login.LoginMemberId.focus();
				return false;
				}
			return true;
		}



// membership info request validation

	function validateForm() {
		if (!AssertNonEmpty("txtFullName", "Name"))
			return false;
		if (!AssertNonEmpty("txtTitle", "Title"))
			return false;
		if (!AssertNonEmpty("txtOrganization", "Organization"))
			return false;
		if (!AssertNonEmpty("txtEmailAddress", "E-mail address"))
			return false;

		return true;
	}
	
	function submitForm(formname, itemname, action)
	{
		if (validateForm()) {
			document.forms[formname].elements[itemname].value = action;
			document.forms[formname].submit();
		}
	}


// div show/hide function

	function toggleLayer(whichLayer)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style2 = document.getElementById(whichLayer).style;
	style2.display = style2.display? "":"block";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style2 = document.all[whichLayer].style;
	style2.display = style2.display? "":"block";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style2 = document.layers[whichLayer].style;
	style2.display = style2.display? "":"block";
	}
	}
	
// legacy MS-HUG script
	
function FindObj(n, d) {
  var p,i,x; if(!d) d=document;
  if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document;
    n=n.substring(0,p);
  }
  if(!(x=d[n])&&d.all) x=d.all[n];
  for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=FindObj(n,d.layers[i].document);  
  //if(parseInt(navigator.appVersion) >= 5){x=document.getElementsByTagID(n); }
  //if(parseInt(navigator.appVersion) >= 5){x=document.getElementById(n); }
  return x;  
}

function lTrim(toBeLTrimmed) {
	var unWantedChars = new String(" \n\r\t");
	var str = new String(toBeLTrimmed);
	if (unWantedChars.indexOf(str.charAt(0)) != -1) {
		var i=0, nLen = str.length;
		while (i < nLen && unWantedChars.indexOf(str.charAt(i)) != -1)
			i++;
		str = str.substring(i, nLen);
	}
	return str;
}

function rTrim(toBeRTrimmed) {
	var unWantedChars = new String(" \n\r\t");
	var str = new String(toBeRTrimmed);
	var nLen = str.length;	
	if (unWantedChars.indexOf(str.charAt(nLen)) != -1) {
		var i=nLen-1;
		while (i>0 && unWantedChars.indexOf(str.charAt(i)) !=-1)
			i--; str = str.substring(0,++i);
	}
	return str;
}

function trim(toBeRTrimmed) {
	return lTrim(rTrim(toBeRTrimmed));
}

function AssertNonEmpty(fldName, txtFldDesc) {
	var oFld, strValue;
	
	oFld = FindObj(fldName);
	strValue = trim(oFld.value);
	if (strValue.length <= 0) {
		alert(txtFldDesc + " must be entered.")
		if ( oFld.type != 'hidden' ){
			oFld.focus();
		}
		return false;
	}
	return true;	
}
	function submitFormForPaging(formname, itemname, action)
	{
		document.forms[formname].elements[itemname].value = action;
		document.forms[formname].submit();
	}