<!--

// MM Scripts

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// Custom scripts

function setDropDownListAssociatedTextBoxVisibility(dropDownList, textBox, showOnDropDownListValue)
{
	if (dropDownList.value == showOnDropDownListValue) 
		textBox.style.visibility = 'visible';
	else
		textBox.style.visibility = 'hidden';
}

function clickDefaultButton(defaultButton)
{
	if (document.all)
	{
		if (event.keyCode == 13)
		{
			event.returnValue = false;
			event.cancel = true;
			defaultButton.click();
		}
	}
}	

function limitTextBoxCharacterCount(textBox, maxChars)
{
	if (textBox.value.length > maxChars)
		textBox.value = textBox.value.substring(0, maxChars);
}

function preloadImages()
{
	MM_preloadImages('images/btn_head_lib_r.gif','images/btn_head_pos_r.gif','images/btn_head_jou_r.gif','images/btn_head_mem_r.gif','images/btn_head_cin_r.gif','images/btn_head_dia_r.gif','images/btn_head_spe_r.gif','images/btn_head_pri_r.gif','images/btn_head_dis_r.gif','images/btn_head_lin_r.gif','images/btn_footer_abo_r.gif','images/btn_footer_sup_r.gif','images/btn_footer_reg_r.gif','images/btn_footer_mem_r.gif','images/btn_footer_myp_r.gif','images/btn_footer_edi_r.gif','images/btn_forgot_password_r.gif','images/btn_register_here_r.gif');
}

function confirmPublishNewsLetter()
{
	return confirm('Are you sure you want to publish this Newsletter?');
}

function confirmDeleteNewsStory()
{
	return confirm('Are you sure you want to permanently delete this News Story?');
}

function confirmDeleteNewsLetter()
{
	return confirm('Are you sure you want to permanently delete this News Letter?');
}

function confirmOpenChatRoom()
{
	return confirm('Are you sure you want to open the chat room?');
}

function confirmCloseChatRoom()
{
	return confirm('Are you sure you want to close the chat room?');
}
function confirmSendEmailtoNewsLetterSubscribers()
{
	return confirm('Are you sure you want to send this newsletter to all the newsletter subscribers?');
}
function confirmSendEmailtoIndividuals()
{
	return confirm('Are you sure you want to send this email to all the individuals?');
}
function confirmSendEmailtoMarketing()
{
	return confirm('Are you sure you want to send this newsletter to all the marketing information subscribers?');
}

function openHelp(url) {
	var mh = 554;
	var mw = 560;
	var helpWin = window.open(url, 'help', 'height=' + mh + ', width=' + mw + ', toolbar=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no');
	helpWin.resizeTo(mw+2, mh+30);
	helpWin.moveTo(100, 100);
	helpWin.focus();
}

function flashvars_text01_DoFSCommand(command, args)
{
	// Escapes 'args' (to avoid special character conflicts) and splits it into an array of values (by comma - %2C)
	var DataArray = escape(args).split("%2C")

	if ( command == "set_cookie" )
	{
		// Creates a variable for expiry date
		var expdate = new Date ();
		expdate.setTime (expdate.getTime() + (DataArray[2] * 24 * 60 * 60 * 1000))
		// Creates the cookie
		document.cookie = DataArray[0] + "=" + DataArray[1] + ((expdate) ? "; expdate=" + expdate.toGMTString() : "")
	}

	if ( command == "get_cookie" )
	{
		// Executes the GetCookie function
		GetCookie (DataArray[0],DataArray[1]);
	}

	if ( command == "del_cookie" )
	{
		// Sets the date on the cookie to expire immediately (deletes it)
		document.cookie = DataArray[0] + "=; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
}

function GetCookie(CookieName,FlashVariableName)
{
CookieValue = document.cookie;
CookieName += "=";

// Finds the location of the value of the cookie specified in CookieName
if (CookieValue.length > 0)
	{
	startString = CookieValue.indexOf(CookieName);

	if (startString != -1)
		{
			startString += CookieName.length;
			endString = CookieValue.indexOf(";", startString);

			if (endString == -1)
			{
				endString = CookieValue.length;
			}

			// Retrieves the cookie value
			CookieResult=unescape(CookieValue.substring(startString,endString));
			// Sends the cookie value back to Flash
			window.document.flashvars_text01.SetVariable(FlashVariableName,CookieResult);
		}
		else
		{
		// If no value is is set (Internet Explorer) sends back the string 'undefined'
		window.document.flashvars_text01.SetVariable(FlashVariableName,"undefined");
		}

	}
	else
	{
		//If no value is set (Netscape Navigator) sends back the string 'undefined'
		window.document.flashvars_text01.SetVariable(FlashVariableName,"undefined");
	}
}

function openNewWindow(URLtoOpen, windowName, windowFeatures) { newWindow=window.open(URLtoOpen, windowName, windowFeatures); }

function changeOpeningWindowContent(urlToOpen) { 
	window.opener.location.href = urlToOpen;
}

//-->
			