/*/
/ /  Author: Macromedia Dreamweaver
/ /    Description: these are functions that are very useful for doing common tasks in javascript
/ / Version: 1.1
/*/
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function GetInList (list, index, delim)
{
	var flag = false, curr = 0;
	var posStart = "", posStop = "";

	// first, look for at least one occurance of the delimeter
	// if we can't find one, then just return the original
	if(list.indexOf(delim) == -1) return list;

	// alright, let's go through the string one character at a time
	for(x=0; x<list.length; x++)
	{
		/*/
		/ / We process if we find a delimeter, or we already found
		/ / a delimeter before and reached the end of the string.
		/*/
		if( (list.substr(x, 1) == delim) || (flag && (x == (list.length - 1))) )
		{
			// increment the current index if we need to
			if(index > 0) curr++;

			/*/ are we looking for the end or begining of the index? /*/
			if(flag)
			{	/*/ ending /*/

				/*/
				/ / Record the index for extraction later.  Remember, we want
				/ / the char before the delim, so we're done with this cycle.
				/ / But, we don't do this for the last index because there is
				/ / not delimeter for us to track, so we add one.
				/*/
				if(x == (list.length - 1))
					posStop = x + 1;
				else
					posStop = x;
				break;
			}
			else
			{	/*/ beginning /*/

				// did we find a match?
				if(curr == index)
				{
					/*/
					/ / We are on the index the caller wants.
					/ / So we record this for extraction later.
					/*/

					/*/ flag indicates we found the start /*/
					flag = true;

					/*/
					/ / Now, here's the tricky part.  If we're not on the first
					/ / index (0) we want posStart to be one greater than the
					/ / current iteration to pass up the delimeter; however,
					/ / if we are on the first index, we want posStart to be the
					/ / beginning and posStop to be what posStart was supposed to be.
					/*/
					if(curr == 0)
					{	/*/ zero /*/
						posStart = 0;
						posStop  = x;

						// we have the data we need
						break;
					}
					else
						/*/ non-zero /*/
						posStart = x + 1;
				}
			}
		}
	}

	/*/ if we made it here w/o flag being set, then we didn't find the index /*/
	if(!flag)
		return false;
	else
	{	/*/ we have what we need to extract the index /*/

		// return the data back to the caller
		return list.substring(posStart, posStop);
	}
}

/*/
/ / PURPOSE:
/ /		To replace/add an entry to a list.
/ /
/ / COMMENTS:
/ /		Use index to specify which item in the list.  If insert is
/ /		true then item is inserted, otherwise it item will replace
/ /		the current index.  Also, delim must match whatever the
/ /		delimeter is.  Returns false if the index is not found.
/*/

function SetInList (list, item, index, delim, insert)
{
	var flag = false, curr = 0;
	var posStart = "", posStop = "";

	// if list is empty then we just start a new list
	if((list == null) || (list == "")) return item;

	// first, look for at least one occurance of the delimeter
	// if we can't find one, then there's most likey only a
	// single item in the list, try to append or prepend
	if(list.indexOf(delim) == -1)
	{
		if((index == 0) && insert)  return item + delim + list;
		if((index == 0) && !insert) return item;
	}

	// alright, let's go through the string one character at a time
	for(x=0; x<list.length; x++)
	{
		/*/
		/ / We process if we find a delimeter, or we already found
		/ / a delimeter before and reached the end of the string.
		/*/
		if( (list.substr(x, 1) == delim) || (flag && (x == (list.length - 1))) )
		{
			// increment the current index if we need to
			if(index > 0) curr++;

			/*/ are we looking for the end or begining of the index? /*/
			if(flag)
			{	/*/ ending /*/

				/*/
				/ / Record the index for extraction later.  Remember, we want
				/ / the char before the delim, so we're done with this cycle.
				/ / But, we don't do this for the last index because there is
				/ / not delimeter for us to track, so we add one.
				/*/
				if(x == (list.length - 1))
					posStop = x + 1;
				else
					posStop = x;
				break;
			}
			else
			{	/*/ beginning /*/

				// did we find a match?
				if(curr == index)
				{
					/*/
					/ / We are on the index the caller wants.
					/ / So we record this for extraction later.
					/*/

					/*/ flag indicates we found the start /*/
					flag = true;

					/*/
					/ / Now, here's the tricky part.  If we're not on the first
					/ / index (0) we want posStart to be one greater than the
					/ / current iteration to pass up the delimeter; however,
					/ / if we are on the first index, we want posStart to be the
					/ / beginning and posStop to be what posStart was supposed to be.
					/*/
					if(curr == 0)
					{	/*/ zero /*/
						posStart = 0;
						posStop  = x;

						// we have the data we need
						break;
					}
					else
						/*/ non-zero /*/
						posStart = x + 1;
				}
			}
		}
	}

	/*/ if we made it here w/o flag being set, then we didn't find the index /*/
	if(!flag)
		return false;
	else
	{	/*/ we have what we need to include the index /*/

		/*/ return the data back to the caller /*/

		// do we replace or insert?
		if(insert)
			/*/ insert /*/
			return list.substring(0, posStart) + item + delim +
				list.substring(posStart, list.length);
		else
			/*/ replace /*/
			return list.substring(0, posStart) + item +
				list.substring(posStart + (posStop - posStart), list.length);
	}
}



function resetNewsletter(){
	document.emailcampaign.emailAddress.value="";
}
function resetField(){
	document.searchForm.txtSearch.value="";
}

function openWindow(url,backsaver,pageparams) {
   popupWin = window.open(url,backsaver,pageparams);
   window.blur;
}

//-->
