/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
//Buttons

function MM_swapImgRestore() { 
	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_preloadImages() { 
	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_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=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) 
		x=d.getElementById(n); 
	return x;
}

function MM_swapImage() { 
	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];
		}
}


/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
//Insert

function InsertText(nList, nBox)
{
	var TheList = document.getElementById(nList);
	var TheBox = document.getElementById(nBox);
	if(TheList.value == "B")
	{
		TheBox.value += "<b>TEXT</b>";
	}
	else if(TheList.value == "I")
	{
		TheBox.value += "<i>TEXT</i>";
	}
	else if(TheList.value == "A")
	{
		TheBox.value += "<a href=\"URL\">TEXT</a>";
	}
	else if(TheList.value == "AMP")
	{
		TheBox.value += "&amp;";
	}
	else if(TheList.value == "S")
	{
		TheBox.value += "&nbsp;";
	}
	else if(TheList.value == "F")
	{
		TheBox.value += "<span style=\"font-size:11pt\">TEXT</span>";
	}
	else if(TheList.value == "GT")
	{
		TheBox.value += "&gt;";
	}
	else if(TheList.value == "LT")
	{
		TheBox.value += "&lt;";
	}
	else if(TheList.value == "CON")
	{
		TheBox.value = "Contest description, start date, end date, and ultimately the results, should appear in place of this paragraph.\r\n\r\n";
		
		TheBox.value += "<b>Top Achievers:</b>\r\n";
		TheBox.value += "<achievers>MM/DD/YYYY TO MM/DD/YYYY</achievers>\r\n\r\n";
		
		TheBox.value += "<b>Contest Rules:</b>\r\n";
		TheBox.value += "In order for your Achievement Coins to be considered, Transactions must be recorded on or after the specified contest start date/time and before or on the specified contest end date/time. All contests begin on the start date at 12:00 AM universal time and finish on the end date at 11:59 PM universal time. Please note that universal time is only used for contests, all other dates on WiiWasHere are displayed in your selected time zone. You can change your time zone in your profile.\r\n\r\nThe top ten list posted in a contest is not an authority on who wins the contest. The WiiWasHere team will make that determination using the list. Issues that may cause the WiiWasHere team to skip over someone on the list may arise from the following conditions: Changes to contest rules may alter what is shown in the list after a contest is complete. Additionally, coins deducted after the contest for cheating during the contest are not reflected here.";
	}
	TheBox.focus();
}


/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
