// Standard Dreamweaver functions
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_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];
	}
}

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_jumpMenu(targ,selObj,restore)
{
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

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 && document.getElementById) x=document.getElementById(n); 
	return x;
}

function MM_showHideLayers() 
{
	var i,p,v,obj,args=MM_showHideLayers.arguments;
	for (i=0; i<(args.length-2); i+=3) 
	if ((obj=MM_findObj(args[i]))!=null) 
  	{ 
		v=args[i+2];
		if (obj.style) 
		{ 
			obj=obj.style; 
			v=(v=='show')?'visible':(v='hide')?'hidden':v; 
		}
		obj.visibility=v; 
	}
}

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 openNewWindow(URLtoOpen, windowName, windowFeatures) 
{ 
	if (newWindow) newWindow.close(); 
	newWindow=window.open(URLtoOpen, windowName, windowFeatures); 
}

function MM_openBrWindow(theURL,winName,features) 
{
	window.open(theURL,winName,features);
}

function MM_popupMsg(msg) 
{
	alert(msg);
}

strBaseURL	= 'www.barmyarmy.com';
var isNS4;
var isNS6;
var isIE4;
var isIE5;
var strPlatform;

isNS4 		= (document.layers) ? true : false;
isIE4 		= (document.all && !document.getElementById) ? true : false;
isIE5 		= (document.all && document.getElementById) ? true : false;
isNS6 		= (!document.all && document.getElementById) ? true : false;

Browser 	= navigator.appName
Net 		= Browser.indexOf("Netscape")
Micro 		= Browser.indexOf("Microsoft")
Netscape 	= false
IE 			= false

if(Net >= 0) 
{
	Netscape = true
}

if(Micro >= 0) 
{
	IE = true
}

var xPos;
var yPos;
document.onmousemove = XYpos;

function XYpos(e) 
{
	if (IE == true) 
	{
		xPos = event.screenX + document.body.scrollLeft;
		yPos = event.screenY + document.body.scrollTop;
	}
	else
	{
		xPos = e.clientX + document.body.scrollLeft;
		yPos = e.clientY + document.body.scrollTop;
	}
}

function getMouseXY(e) 
{
	if (IE) 
	{ // grab the x-y pos.s if browser is IE
		xPos = event.clientX + document.body.scrollLeft
		yPos = event.clientY + document.body.scrollTop
	} 
	else
	{  // grab the x-y pos.s if browser is NS
		xPos = e.pageX
		yPos = e.pageY
	}  
	// catch possible negative values in NS4
	if (xPos < 0){xPos = 0}
	if (yPos < 0){yPos = 0}  
  
  	return true
}

var updateRequest = createMultiRequest();

function createRequest()
{
	try
	{
		request = new XMLHttpRequest();
	}
	catch (trymicrosoft)
	{
		try
		{
			request = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (othermicrosoft)
		{
			try
			{
				request = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (failed)
			{
				request = null;
			}
		}
	}

	if(request == null)
	{
		alert("Error creating request object");
	}

	return request;
}

function createMultiRequest()
{
	try
	{
		request = new XMLHttpRequest();
	}
	catch (trymicrosoft)
	{
		try
		{
			request = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (othermicrosoft)
		{
			try
			{
				request = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (failed)
			{
				request = null;
			}
		}
	}
 
	if(request == null)
	{
		alert("Error creating request object");
	}
 
	return request;
}

if (document.layers) 
{
    document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove = captureMousePosition;
} 
else if (document.all) 
{
    document.onmousemove = captureMousePosition;
}
else if (document.getElementById) 
{
    document.onmousemove = captureMousePosition;
}

xMousePos 		= 0;
yMousePos 		= 0;
xMousePosMax 	= 0;
yMousePosMax 	= 0;

function captureMousePosition(e) 
{
    if (document.layers)
	{
		xMousePos 		= e.pageX;
        yMousePos 		= e.pageY;
        xMousePosMax 	= window.innerWidth  + window.pageXOffset;
        yMousePosMax 	= window.innerHeight + window.pageYOffset;
    } 
	else if (document.all) 
	{
        xMousePos 		= window.event.x + document.body.scrollLeft;
        yMousePos 		= window.event.y + document.body.scrollTop;
        xMousePosMax 	= document.body.clientWidth  + document.body.scrollLeft;
        yMousePosMax 	= document.body.clientHeight + document.body.scrollTop;
    } 
	else if (document.getElementById) 
	{
        xMousePos 		= e.pageX;
        yMousePos 		= e.pageY;
        xMousePosMax 	= window.innerWidth	 + window.pageXOffset;
        yMousePosMax 	= window.innerHeight + window.pageYOffset;
    }
}


function findPos(obj)
{
	var curleft = curtop = 0;
	if (obj.offsetParent) 
	{
		curleft = obj.offsetLeft
		curtop 	= obj.offsetTop
		while (obj = obj.offsetParent) 
		{
			curleft += obj.offsetLeft
			curtop 	+= obj.offsetTop
		}
	}
	return [curleft,curtop];
}

function is_int(strValue)
{
	var i;

	if (isEmpty(strValue.value))
	{
		return 'empty';
	}

	for (iCount = 0; iCount < strValue.value.length; iCount++)
	{
		var strThisChar = strValue.value.charAt(iCount);

		if (!isDigit(strThisChar))
		{
			return false;
		}
	}
	
	return true;
}

function isEmpty(strValue)
{
	return ((strValue == null) || (strValue.length == 0))
}

function isDigit(iValue)
{
	return ((iValue >= "0") && (iValue <= "9"))
}



function changeActionDiv(strContent, strVisibleStatus, leftPos, topPos)
{
	hActionDiv 					= document.getElementById("actionDiv");
	hActionDiv.innerHTML		= strContent;
	hActionDiv.style.visibility	= strVisibleStatus;
	hActionDiv.style.top		= topPos + 'px';
	hActionDiv.style.left		= leftPos + 'px';
}

function showActionLayer(iLeft, iTop, iWidth, iHeight)
{
	hALayer						= document.getElementById("actionLayer");
	hALayer.style.background	= '#FFFFFF';
	hALayer.style.visibility	= 'visible';
	hALayer.style.left			= iLeft + 'px';
	hALayer.style.top			= iTop + 'px';
	hALayer.style.width			= iWidth + 'px';
	hALayer.style.height		= iHeight + 'px';
}

function hideActionLayer()
{
	hALayer 					= document.getElementById("actionLayer");
	hALayer.style.visibility	= 'hidden';
}

function hideActionDiv()
{
//	if(IE)
//	{
//		upload					= document.getElementById("actionLayer");
//		upload.style.visibility	= 'hidden';
//	}

	handle 						= document.getElementById("actionDiv");
	handle.style.visibility 	= "hidden";
}

function getCheckedValue(radioObj) 
{
	if(!radioObj)	return "";
	
	var radioLength = radioObj.length;
	
	if(radioLength == undefined)
	{
		if(radioObj.checked)
		{
			return radioObj.value;
		}
		else
		{
			return "";
		}
	}
	
	for(var i = 0; i < radioLength; i++) 
	{
		if(radioObj[i].checked) 
		{
			alert(radioObj[i].value);
			return radioObj[i].value;
		}
	}
	return "";
}



function moreDiv()
{
	switch(Browser)
	{
		case 'Microsoft Internet Explorer':
			hImage						= document.getElementById("imageDiv");
			iOpacity					= hImage.filters[0].opacity;
			iNewOpacity					= iOpacity + 4;
			hImage.filters[0].opacity 	= iNewOpacity;
		
			if(iNewOpacity < 100)
			{
				tTimer 			= setTimeout("moreDiv()", 50);
			}
			else
			{
				tTimer 			= setTimeout("lessDiv()", 10000);
			}
			break;
		
		case 'Netscape':
			hImage					= document.getElementById("imageDiv");
			iOpacity				= hImage.style.opacity;
			iNewOpacity				= (iOpacity * 1) + 0.04;
			hImage.style.opacity 	= iNewOpacity;

			if(iNewOpacity < 1)
			{
				tTimer 			= setTimeout("moreDiv()", 50);
			}
			else
			{
				tTimer 			= setTimeout("lessDiv()", 10000);
			}
			break;		
	}		
}

function lessDiv()
{
	switch(Browser)
	{
		case 'Microsoft Internet Explorer':
			hImage						= document.getElementById("imageDiv");
			iOpacity					= hImage.filters[0].opacity;
			iNewOpacity					= iOpacity - 8;
			hImage.filters[0].opacity 	= iNewOpacity;

			if(iNewOpacity > 1)
			{
				tTimer 			= setTimeout("lessDiv()", 50);
			}
			else
			{
				hCard					= document.getElementById("imageDiv");
				hCard.style.visibilty	= false;
			}
			break;
		
		case 'Netscape':
			hImage					= document.getElementById("imageDiv");
			iOpacity				= hImage.style.opacity;
			iNewOpacity				= (iOpacity * 1) - 0.08;
			hImage.style.opacity 	= iNewOpacity;

			if(iNewOpacity > 0.01)
			{
				tTimer 			= setTimeout("lessDiv()", 50);
			}
			else
			{
				hCard					= document.getElementById("imageDiv");
				hCard.style.visibilty	= false;
			}
			break;		
	}		
}


// Member Functions
function confirmMemeberDelete(iMemberID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this member?<br><a href="index.php?m=delete&iMemberID=' + iMemberID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', 200, 200);
}

function adminChangeMembership(strChange)
{
	if(strChange == 'off')
	{
		strNewLink	=	'<a href="javascript:adminChangeMembership(\'on\')" class="subheaderlink">New Members Currently OFF. Turn ON</a>';
		alert('New member signup suspended');
	}
	else
	{
		strNewLink	=	'<a href="javascript:adminChangeMembership(\'off\')" class="subheaderlink">New Members Currently ON. Turn OFF</a>';
		alert('New member signup allowed');
	}
	
	hMembershipLinkSpan				=	document.getElementById("memstatusspan");
	hMembershipLinkSpan.innerHTML	=	strNewLink;
	
	var URL		= 'http://www.barmyarmy.com/admin/members/index.php?m=membershipchange&change=' + strChange + '&dummy=' + new Date().getTime();
//	alert(URL);
	ExDates		= createRequest();
	ExDates.open("GET",URL, true);
	ExDates.onreadystatechange = changeMembershipStatus;
	ExDates.send(null);
}

function changeMembershipStatus()
{
	if(ExDates.readyState == 4)
	{
		strExcludedDates		= ExDates.responseText;
	}
}

function confirmMemeberWaitDelete(iMemberID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this member from the waiting list?<br><a href="index.php?m=deletewait&iMemberID=' + iMemberID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', 200, 200);
}

function updateDDConfirmation(iMemberID)
{
	// Get the entered username and password
	hConfNessage			=	document.getElementById("confmessage");
	hConfNessage.innerHTML	=	'<br><br>Member ' + iMemberID + ' marked as on Direct Debit Successfully, they will be removed from the list when you refresh the page';
}

function addMemberDD(iMemberID)
{
	strContent = '<form action="index.php" method="post" name="dd"><table width="300" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Add DD Details</span></td></tr><tr><td colspan="2" align="center">Please Enter the account details?</td></tr><tr><td>Account Name:</td><td><input type="text" name="acname" size="20"></td></tr><tr><td>Sort Code:</td><td><input type="text" name="sortcode" size="20"></td></tr><tr><td>Account Number:</td><td><input type="text" name="acnum" size="20"></td></tr><tr><td colspan="2" align="center"><a href="#" class="subheaderlink" onClick="document.forms.dd.submit();">Save</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">Cancel</a><input type="hidden" name="iMemberID" value="' + iMemberID + '"><input type="hidden" name="m" value="directdebit"></td></tr></table></form>';
	
	changeActionDiv(strContent, 'visible', 200, 200);
}



// Ticket Functions
function confirmTicketDelete(iTicketID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this ticket?<br><a href="index.php?m=deleteticket&iTicketID=' + iTicketID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', 200, 200);
}

function confirmOrderDelete(iOrderID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this order?<br><a href="index.php?m=deletepurchase&iOrderID=' + iOrderID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', 200, 200);
}

function confirmAshesTicketDelete(iTicketID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this ticket?<br><a href="ashes.php?m=deleteticket&iTicketID=' + iTicketID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', 200, 200);
}

function confirmAshesOrderDelete(iOrderID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this order?<br><a href="ashes.php?m=deletepurchase&iOrderID=' + iOrderID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', 200, 200);
}



function confirmPollDelete(iNewsID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this poll?<br><a href="index.php?m=deletepoll&iPollID=' + iNewsID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}


// News Functions
function newsChangeImage(iNewsID)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="index.php?m=newimage&iNewsID=' + iNewsID + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change News Image</span></td></tr><tr><td valign="top">Image:</td><td><input type="file" name="thephoto" size="45" onFocus="select()"><br><span class="failure">This image must be W: 339 x H: 282</span></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 300, yMousePos - 50);
}

function confirmNewsDelete(iNewsID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this news story?<br><a href="index.php?m=delete&iNewsID=' + iNewsID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function newsDeleteImage(iNewsID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Image Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete the image for this news story?<br><a href="index.php?m=deleteimage&iNewsID=' + iNewsID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function confirmSponsorDelete(iSponsorID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this sponsor?<br><a href="index.php?m=delete&isponsorID=' + iSponsorID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function sponsorChangeImage(iSponsorID)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="index.php?m=newimage&isponsorID=' + iSponsorID + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change News Image</span></td></tr><tr><td valign="top">Image:</td><td><input type="file" name="thephoto" size="45" onFocus="select()"><br><span class="failure"></span></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 300, yMousePos - 50);
}

function sponsorDeleteImage(iSponsorID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Image Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete the image for this sponsor?<br><a href="index.php?m=deleteimage&isponsorID=' + iSponsorID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}




// Features Functions
function confirmMediaDelete(iMediaID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this Media Spy?<br><a href="index.php?m=delete&iMediaID=' + iMediaID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function confirmArticleDelete(iMediaID, iArticleID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this Article?<br><a href="index.php?m=articledelete&iArticleID=' + iArticleID + '&iMediaID=' + iMediaID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function confirmLetterPageDelete(iBALID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this Letters Page?<br><a href="letters.php?m=delete&iBALID=' + iBALID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function confirmLetterDelete(iBALID, iLetterID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this Letter?<br><a href="letters.php?m=letterdelete&iLetterID=' + iLetterID + '&iBALID=' + iBALID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function viewChangeImage(iViewID)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="baview.php?m=newimage&iViewID=' + iViewID + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change View Image</span></td></tr><tr><td valign="top">Image:</td><td><input type="file" name="thephoto" size="45" onFocus="select()"><br><span class="failure">This image must be W: 180 x H: 150</span></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 300, yMousePos - 50);
}

function confirmViewDelete(iViewID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this view?<br><a href="baview.php?m=delete&iViewID=' + iViewID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function viewDeleteImage(iViewID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Image Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete the image for this view?<br><a href="baview.php?m=deleteimage&iViewID=' + iViewID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}




// Harmonies Functions
function confirmHarmDelete(iHarmID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this Barmy Hamony?<br><a href="index.php?m=delete&iHarmID=' + iHarmID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function harmChangeImage(iHarmID)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="index.php?m=newimage&iHarmID=' + iHarmID + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change Harmony Image</span></td></tr><tr><td valign="top">Image:</td><td><input type="file" name="thephoto" size="45" onFocus="select()"><br><span class="failure">This image must be W: 180 x H: 150</span></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 300, yMousePos - 50);
}

function harmDeleteImage(iHarmID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Image Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete the image for this Harmony?<br><a href="index.php?m=deleteimage&iHarmID=' + iHarmID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function harmChangePDF(iHarmID)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="index.php?m=newpdf&iHarmID=' + iHarmID + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change Harmony PDF</span></td></tr><tr><td valign="top">PDF:</td><td><input type="file" name="thepdf" size="45" onFocus="select()"><br><span class="failure">This image must be W: 180 x H: 150</span></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 300, yMousePos - 50);
}

function harmDeletePDF(iHarmID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm PDF Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete the image for this Harmony?<br><a href="index.php?m=deletepdf&iHarmID=' + iHarmID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function confirmStoryDelete(iHarmID, iStoryID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this Story?<br><a href="index.php?m=storydelete&iStoryID=' + iStoryID + '&iHarmID=' + iHarmID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function storyChangeImage(iHarmID, iStoryID, iImageNumber)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="index.php?m=storynewimage&iStoryID=' + iStoryID + '&iHarmID=' + iHarmID + '&iImageNum=' + iImageNumber + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change Story Image</span></td></tr><tr><td valign="top">Image:</td><td><input type="file" name="thephoto" size="45" onFocus="select()"><br><span class="failure">This image must be W: 180 x H: 150</span></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 300, yMousePos - 50);
}

function storyDeleteImage(iHarmID, iStoryID, iImageNumber)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Image Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete the image for this Story?<br><a href="index.php?m=storydeleteimage&iStoryID=' + iStoryID + '&iHarmID=' + iHarmID + '&iImageNum=' + iImageNumber + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}




// Fun & Games Functions
function confirmTShirtDelete(iTShirtID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this T-Shirt?<br><a href="index.php?m=delete&iTShirtID=' + iTShirtID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function tshirtChangeImage(iTShirtID)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="index.php?m=newimage&iTShirtID=' + iTShirtID + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change T-Shirt Image</span></td></tr><tr><td valign="top">Image:</td><td><input type="file" name="thephoto" size="45" onFocus="select()"><br><span class="failure">This image must be W: 180 x H: 150</span></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 300, yMousePos - 50);
}

function tshirtDeleteImage(iTShirtID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Image Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete the image for this T-Shirt?<br><a href="index.php?m=deleteimage&iTShirtID=' + iTShirtID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function tshirtChangeThumb(iTShirtID)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="index.php?m=newthumb&iTShirtID=' + iTShirtID + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change T-Shirt Image</span></td></tr><tr><td valign="top">Image:</td><td><input type="file" name="thephotot" size="45" onFocus="select()"><br><span class="failure">This image must be W: 180 x H: 150</span></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 300, yMousePos - 50);
}

function tshirtDeleteThumb(iTShirtID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Image Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete the thumbnail image for this T-Shirt?<br><a href="index.php?m=deletethumb&iTShirtID=' + iTShirtID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function confirmSuspectDelete(iSuspectID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this Suspect?<br><a href="suspects.php?m=delete&iSuspectID=' + iSuspectID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function suspectChangeImage(iSuspectID)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="suspects.php?m=newimage&iSuspectID=' + iSuspectID + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change Suspect Image</span></td></tr><tr><td valign="top">Image:</td><td><input type="file" name="thephoto" size="45" onFocus="select()"><br><span class="failure">This image must be W: 180 x H: 150</span></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 300, yMousePos - 50);
}

function suspectDeleteImage(iSuspectID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Image Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete the image for this Suspect?<br><a href="suspects.php?m=deleteimage&iSuspectID=' + iSuspectID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function confirmGameDelete(iGameID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this Game?<br><a href="games.php?m=delete&iGameID=' + iGameID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function gameChangeImage(iGameID)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="games.php?m=newimage&iGameID=' + iGameID + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change Game Image</span></td></tr><tr><td valign="top">Image:</td><td><input type="file" name="thephoto" size="45" onFocus="select()"><br><span class="failure">This image must be W: 180 x H: 150</span></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 300, yMousePos - 50);
}

function gameDeleteImage(iGameID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Image Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete the image for this Game?<br><a href="games.php?m=deleteimage&iGameID=' + iGameID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function confirmSongDelete(iSongID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this Song?<br><a href="songs.php?m=delete&iSongID=' + iSongID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function songChangeVideo(iSongID)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="songs.php?m=newvideo&iSongID=' + iSongID + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change Song Video</span></td></tr><tr><td valign="top">Image:</td><td><input type="file" name="thephoto" size="45" onFocus="select()"><br><span class="failure">This image must be W: 180 x H: 150</span></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 300, yMousePos - 50);
}

function songDeleteVideo(iSongID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Video Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete the video for this song?<br><a href="songs.php?m=deletevideo&iSongID=' + iSongID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function confirmDownloadDelete(iDLID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this Download?<br><a href="downloads.php?m=delete&iDLID=' + iDLID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function downloadChangeImage(iDLID)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="downloads.php?m=newimage&iDLID=' + iDLID + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change Download Image</span></td></tr><tr><td valign="top">Image:</td><td><input type="file" name="thephoto" size="45" onFocus="select()"><br><span class="failure">This image must be W: 180 x H: 150</span></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 300, yMousePos - 50);
}

function downloadDeleteImage(iDLID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Image Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete the image for this download?<br><a href="downloads.php?m=deleteimage&iDLID=' + iDLID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function downloadChangeDL(iDLID)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="downloads.php?m=newDL&iDLID=' + iDLID + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change Download</span></td></tr><tr><td valign="top">Download:</td><td><input type="file" name="theDL" size="45" onFocus="select()"><br><span class="failure">This image must be W: 180 x H: 150</span></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 300, yMousePos - 50);
}

function downloadDeleteDL(iDLID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Image Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete the Object for this download?<br><a href="downloads.php?m=deleteDL&iDLID=' + iDLID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function confirmGalleryDelete(iGalID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this Gallery?<br><a href="photos.php?m=delete&iGalID=' + iGalID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function photoDeleteImage(iGalID, iPhotoID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this Photo?<br><a href="photos.php?m=photodelete&iGalID=' + iGalID + '&iPhotoID=' + iPhotoID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function confirmCompDelete(iCompID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this Competition?<br><a href="comps.php?m=delete&iCompID=' + iCompID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function compChangeImage(iCompID)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="comps.php?m=newimage&iCompID=' + iCompID + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change Competition Image</span></td></tr><tr><td valign="top">Image:</td><td><input type="file" name="thephoto" size="45" onFocus="select()"><br><span class="failure">This image must be W: 180 x H: 150</span></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 300, yMousePos - 50);
}

function compDeleteImage(iCompID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Image Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete the image for this Competition?<br><a href="comps.php?m=deleteimage&iCompID=' + iCompID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function confirmCompClose(iCompID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Close</span></td></tr><tr><td align="center">Are you sure you want to close this Competition and pick a winner?<br><a href="comps.php?m=close&iCompID=' + iCompID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}




// Calendar Functions
function confirmCalDelete(iCalID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this Match?<br><a href="index.php?m=delete&iCalID=' + iCalID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function makeTicketRows(iDays)
{
	// Get the stage of the tick box
	hSellingCheck 					= document.getElementById("sellingCheck");
	
	// if the box is ticked, show the required fields
	if(hSellingCheck.checked == 1)
	{
		// Initialise variables			
		var	strPriceValues	= '';
		var strMFeeValues	= '';
		var strNMFeeValues	= '';
		var strQTYValues	= '';
		var strTicketInputs = '';
		
		// if we have no iDays passed through, get it from the page
		if(iDays > 0)
		{
		}
		else
		{
			// What sort of match have we (and therefore how many days)
			hMatchType	= document.getElementById("matchType");
			iDays		= (hMatchType.value == 'Test' ? '5' : '1');
		}
		
		// Loop around for the right amount of days
		for(iCount = 1; iCount <= iDays; iCount++)
		{
			// Reset Vars
			strPriceValues	= '';
			strMFeeValues	= '';
			strNMFeeValues	= '';
			strQTYValues	= '';

			// Get the values from any failed submission
			hOldPrice	= document.getElementById("hiddenPriceDay" + iCount);
			hOldMFee	= document.getElementById("hiddenMemFee" + iCount);
			hOldNMFee	= document.getElementById("hiddenNMemFee" + iCount);
			hOldQty		= document.getElementById("hiddenQTY" + iCount);

			iOldPrice	= hOldPrice.value;
			iOldMfee	= hOldMFee.value;
			iOldNMFee	= hOldNMFee.value;
			iOldQty		= hOldQty.value;
			
			// Make the drop lists
			// Price
			for(iValue = 0; iValue < 700; iValue++)
			{
				if(iValue == iOldPrice)
				{
					strPriceValues	= strPriceValues + '<option value="' + iValue + '" selected>' + iValue + '</option>';
				}
				else
				{
					strPriceValues	= strPriceValues + '<option value="' + iValue + '">' + iValue + '</option>';
				}
			}
			// Members Fee
			for(iValue = 0; iValue < 76; iValue++)
			{
				if(iValue == iOldMfee)
				{
					strMFeeValues	= strMFeeValues + '<option value="' + iValue + '" selected>' + iValue + '</option>';
				}
				else
				{
					strMFeeValues	= strMFeeValues + '<option value="' + iValue + '">' + iValue + '</option>';
				}
			}
			// Non Members Fee
			for(iValue = 0; iValue < 76; iValue++)
			{
				if(iValue == iOldNMFee)
				{
					strNMFeeValues	= strNMFeeValues + '<option value="' + iValue + '" selected>' + iValue + '</option>';
				}
				else
				{
					strNMFeeValues	= strNMFeeValues + '<option value="' + iValue + '">' + iValue + '</option>';
				}
			}
			// Quantity
			for(iValue = 0; iValue < 750; iValue++)
			{
				if(iValue == iOldQty)
				{
					strQTYValues	= strQTYValues + '<option value="' + iValue + '" selected>' + iValue + '</option>';
				}
				else
				{
					strQTYValues	= strQTYValues + '<option value="' + iValue + '">' + iValue + '</option>';
				}
			}
		
			// Add this ticket to the output
			strTicketInputs	= strTicketInputs + '<tr><td valign="top"><span class="subheader">Day ' + iCount + ':</span></td><td align="center"><select name="price' + iCount + '">' + strPriceValues + '</td><td align="center"><select name="mfee' + iCount + '">' + strMFeeValues + '</td><td align="center"><select name="nmfee' + iCount + '">' + strNMFeeValues + '</td><td align="center"><select name="qty' + iCount + '">' + strQTYValues + '</td></tr>';
		}
		
		// Complete the ticket output
		strTicketInputs	= '<table width="420" border="0" cellpadding="2" cellspacing="0"><tr><td width="90"><span class="subheader">&nbsp;</span></td><td width="60" align="center"><span class="subheader">Price</span></td><td width="100" align="center"><span class="subheader">Member Fee</span></td><td width="110" align="center"><span class="subheader">Non Member Fee</span></td><td width="60" align="center"><span class="subheader">Quantity</span></td></tr>' + strTicketInputs + '</table>';
		
		// Change the span to show the ticket columns
		hTicketSpan				= document.getElementById("ticketSpan");
		hTicketSpan.innerHTML	= strTicketInputs;
	}
	else
	{
		// Clear the span if there is anything there
		hTicketSpan				= document.getElementById("ticketSpan");
		hTicketSpan.innerHTML	= '&nbsp;';
	}
}

function addTicket(iCalID, iDay)
{
	// Initialise variables			
	var	strPriceValues	= '';
	var strMFeeValues	= '';
	var strNMFeeValues	= '';
	var strQTYValues	= '';
	var strTicketInputs = '';
	
	// Make the drop lists
	// Price
	for(iValue = 0; iValue < 700; iValue++)
	{
		strPriceValues	= strPriceValues + '<option value="' + iValue + '">' + iValue + '</option>';
	}
	// Members Fee
	for(iValue = 0; iValue < 76; iValue++)
	{
		strMFeeValues	= strMFeeValues + '<option value="' + iValue + '">' + iValue + '</option>';
	}
	// Non Members Fee
	for(iValue = 0; iValue < 76; iValue++)
	{
		strNMFeeValues	= strNMFeeValues + '<option value="' + iValue + '">' + iValue + '</option>';
	}
	// Quantity
	for(iValue = 0; iValue < 650; iValue++)
	{
		strQTYValues	= strQTYValues + '<option value="' + iValue + '">' + iValue + '</option>';
	}
	
	// Make the new ticket output
//	strTicketInputs	= '<form method="post" name="ticket" action="index.php?m=addticket&iCalID=' + iCalID + '&iDay=' + iDay + '"><table width="370" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="5" align="center"><span class="mainheader">New Ticket</span></td></tr><tr><td width="40"><span class="subheader">&nbsp;</span></td><td width="60" align="center"><span class="subheader">Price</span></td><td width="100" align="center"><span class="subheader">Member Fee</span></td><td width="110" align="center"><span class="subheader">Non Member Fee</span></td><td width="60" align="center"><span class="subheader">Quantity</span></td></tr><tr><td valign="top"><span class="subheader">Day ' + iDay + ':</span></td><td align="center"><select name="price">' + strPriceValues + '</td><td align="center"><select name="mfee">' + strMFeeValues + '</td><td align="center"><select name="nmfee">' + strNMFeeValues + '</td><td align="center"><select name="qty">' + strQTYValues + '</td></tr><tr><td colspan="5" align="center"><input type="button" name="save" value="  Save  " onClick="document.ticket.submit();">&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" name="cancel" value="Cancel" onClick="hideActionDiv();"></td></tr></table><input type="hidden" name="iCalID" value="' + iCalID + '"><input type="hidden" name="iDay" value="' + iDay + '"></form>';
	strTicketInputs	= '<form method="post" name="ticket" action="index.php?m=addticket&iCalID=' + iCalID + '&iDay=' + iDay + '"><table width="370" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="5" align="center"><span class="mainheader">New Ticket</span></td></tr><tr><td width="40"><span class="subheader">&nbsp;</span></td><td width="60" align="center"><span class="subheader">Price</span></td><td width="60" align="center"><span class="subheader">Quantity</span></td></tr><tr><td valign="top"><span class="subheader">Day ' + iDay + ':</span></td><td align="center"><select name="price">' + strPriceValues + '</td><td align="center"><select name="qty">' + strQTYValues + '</td></tr><tr><td colspan="5" align="center"><input type="button" name="save" value="  Save  " onClick="document.ticket.submit();">&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" name="cancel" value="Cancel" onClick="hideActionDiv();"></td></tr></table><input type="hidden" name="iCalID" value="' + iCalID + '"><input type="hidden" name="iDay" value="' + iDay + '"></form>';
	
	changeActionDiv(strTicketInputs, 'visible', xMousePos - 200, yMousePos - 50);

}

function confirmAshesCalDelete(iCalID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this Match?<br><a href="ashes.php?m=delete&iCalID=' + iCalID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function makeAshesTicketRows()
{
	// Get the stage of the tick box
	hSellingCheck 					= document.getElementById("sellingCheck");
	
	// if the box is ticked, show the required fields
	if(hSellingCheck.checked == 1)
	{
		// Initialise variables			
		var	strPriceValues	= '';
		var strFeeValues	= '';
		var strQTYValues	= '';
		var strTicketInputs = '';
		
		// Loop around for the right amount of days
		for(iCount = 1; iCount <= 5; iCount++)
		{
			// Reset Vars
			strPriceValues	= '';
			strFeeValues	= '';
			strQTYValues	= '';

			// Get the values from any failed submission
			hOldPrice	= document.getElementById("hiddenPriceDay" + iCount);
			hOldFee		= document.getElementById("hiddenFee" + iCount);
			hOldQty		= document.getElementById("hiddenQTY" + iCount);

			iOldPrice	= hOldPrice.value;
			iOldMfee	= hOldFee.value;
			iOldQty		= hOldQty.value;
			
			// Make the drop lists
			// Price
			for(iValue = 0; iValue < 100; iValue++)
			{
				if(iValue == iOldPrice)
				{
					strPriceValues	= strPriceValues + '<option value="' + iValue + '" selected>' + iValue + '</option>';
				}
				else
				{
					strPriceValues	= strPriceValues + '<option value="' + iValue + '">' + iValue + '</option>';
				}
			}
			// Members Fee
			for(iValue = 0; iValue < 16; iValue++)
			{
				if(iValue == iOldMfee)
				{
					strFeeValues	= strFeeValues + '<option value="' + iValue + '" selected>' + iValue + '</option>';
				}
				else
				{
					strFeeValues	= strFeeValues + '<option value="' + iValue + '">' + iValue + '</option>';
				}
			}
			// Quantity
			for(iValue = 0; iValue < 250; iValue++)
			{
				if(iValue == iOldQty)
				{
					strQTYValues	= strQTYValues + '<option value="' + iValue + '" selected>' + iValue + '</option>';
				}
				else
				{
					strQTYValues	= strQTYValues + '<option value="' + iValue + '">' + iValue + '</option>';
				}
			}
		
			// Add this ticket to the output
			strTicketInputs	= strTicketInputs + '<tr><td valign="top"><span class="subheader">Day ' + iCount + ':</span></td><td align="center"><select name="price' + iCount + '">' + strPriceValues + '</td><td align="center"><select name="fee' + iCount + '">' + strFeeValues + '</td><td align="center"><select name="qty' + iCount + '">' + strQTYValues + '</td></tr>';
		}
		
		// Complete the ticket output
		strTicketInputs	= '<table width="320" border="0" cellpadding="2" cellspacing="0"><tr><td width="70"><span class="subheader">&nbsp;</span></td><td width="60" align="center"><span class="subheader">Price</span></td><td width="100" align="center"><span class="subheader">Booking Fee</span></td><td width="60" align="center"><span class="subheader">Quantity</span></td></tr>' + strTicketInputs + '</table>';
		
		// Change the span to show the ticket columns
		hTicketSpan				= document.getElementById("ticketSpan");
		hTicketSpan.innerHTML	= strTicketInputs;
	}
	else
	{
		// Clear the span if there is anything there
		hTicketSpan				= document.getElementById("ticketSpan");
		hTicketSpan.innerHTML	= '&nbsp;';
	}
}

function addAshesTicket(iCalID, iDay)
{
	// Initialise variables			
	var	strPriceValues	= '';
	var strFeeValues	= '';
	var strQTYValues	= '';
	var strTicketInputs = '';
	
	// Make the drop lists
	// Price
	for(iValue = 0; iValue < 100; iValue++)
	{
		strPriceValues	= strPriceValues + '<option value="' + iValue + '">' + iValue + '</option>';
	}
	// Booking Fee
	for(iValue = 0; iValue < 16; iValue++)
	{
		strFeeValues	= strFeeValues + '<option value="' + iValue + '">' + iValue + '</option>';
	}
	// Quantity
	for(iValue = 0; iValue < 250; iValue++)
	{
		strQTYValues	= strQTYValues + '<option value="' + iValue + '">' + iValue + '</option>';
	}
	
	// Make the new ticket output
	strTicketInputs	= '<form method="post" name="ticket" action="ashes.php?m=addticket&iCalID=' + iCalID + '&iDay=' + iDay + '"><table width="370" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="5" align="center"><span class="mainheader">New Ticket</span></td></tr><tr><td width="40"><span class="subheader">&nbsp;</span></td><td width="60" align="center"><span class="subheader">Price</span></td><td width="100" align="center"><span class="subheader">Booking Fee</span></td><td width="60" align="center"><span class="subheader">Quantity</span></td></tr><tr><td valign="top"><span class="subheader">Day ' + iDay + ':</span></td><td align="center"><select name="price">' + strPriceValues + '</td><td align="center"><select name="mfee">' + strFeeValues + '</td><td align="center"><select name="qty">' + strQTYValues + '</td></tr><tr><td colspan="5" align="center"><input type="button" name="save" value="  Save  " onClick="document.ticket.submit();">&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" name="cancel" value="Cancel" onClick="hideActionDiv();"></td></tr></table><input type="hidden" name="iCalID" value="' + iCalID + '"><input type="hidden" name="iDay" value="' + iDay + '"></form>';
	
	changeActionDiv(strTicketInputs, 'visible', xMousePos - 200, yMousePos - 50);

}

function confirmAshesReportDelete(iCalID, iRepID, iDay)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this Report?<br><a href="ashes.php?m=reportdelete&iCalID=' + iCalID + '&iRepID=' + iRepID + '&iDay=' + iDay + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function confirmColtsCalDelete(iCalID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this Match?<br><a href="colts.php?m=delete&iCalID=' + iCalID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}




// Event Functions
function confirmEventDelete(iEventID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this Event?<br><a href="events.php?m=delete&iEventID=' + iEventID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function eventChangeImage(iEventID)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="events.php?m=newimage&iEventID=' + iEventID + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change Event Image</span></td></tr><tr><td valign="top">Image:</td><td><input type="file" name="thephoto" size="45" onFocus="select()"><br><span class="failure">This image must be W: 340 x H: 260</span></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 300, yMousePos - 50);
}

function eventDeleteImage(iEventID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Image Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete the image for this event?<br><a href="events.php?m=deleteimage&iEventID=' + iEventID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function confirmEventPurchaseDelete(iEventID, iOrderID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this Order?<br><a href="events.php?m=purchasedelete&iEventID=' + iEventID + '&iOrderID=' + iOrderID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function confirmEventOrderTicketDelete(iEventID, iOrderID, iTicketID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this Guest?<br><a href="events.php?m=purchaseticketdelete&iEventID=' + iEventID + '&iOrderID=' + iOrderID + '&iTicketID=' + iTicketID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function showGuests(iGuests)
{
	// Get the Members, title and country Drop lists
	hMembersDrop		= document.getElementById("membersDrop");
	hTitleDrop			= document.getElementById("titleDrop");
	hCountryDrop		= document.getElementById("countryDrop");
	strMembersDrop		= hMembersDrop.innerHTML.substr(21);
	strTitleDrop		= hTitleDrop.innerHTML.substr(20);
	strCountryDrop		= hCountryDrop.innerHTML.substr(22);

	var strOutput		= '';

	// Create a guest entry for each asked for
	for(iCount = 1; iCount <= iGuests; iCount++)
	{
		// Do some work on the drop lists to make them correct for this loop
		strThisMemberDrop	= '<select name="member' + iCount + '"' + strMembersDrop;
		strThisTitleDrop	= '<select name="title' + iCount + '"' + strTitleDrop;
		strThisCountryDrop	= '<select name="country' + iCount + '"' + strCountryDrop;
		
		// Make the output for this guest
		strOutput			= strOutput + '<tr><td colspan="2"><span class="mainheader">Guest ' + iCount + ' </span></td></tr><tr><td width="80" height="20" valign="top"><span class="subheader">Member:</span></td><td width="500" height="20" valign="top">' + strThisMemberDrop + '</td></tr><tr><td width="80" height="20" valign="top">&nbsp;</td><td width="500" height="20" valign="top"><span class="subheader">OR</span></td></tr><tr><td width="130" height="20" valign="top"><span class="subheader">Title:</span></td><td width="370" height="20" valign="top">' + strThisTitleDrop + '</td></tr><tr><td width="130" height="20" valign="top"><span class="subheader">First Name:</span></td><td width="370" height="20" valign="top"><input type="text" name="firstname' + iCount + '" value="" size="60"  class="required"></td></tr><tr><td width="130" height="20" valign="top"><span class="subheader">Surame:</span></td><td width="370" height="20" valign="top"><input type="text" name="surname' + iCount + '" value="" size="60"  class="required"></td></tr><tr><td width="130" height="20" valign="top"><span class="subheader">Address 1:</span></td><td width="370" height="20" valign="top"><input type="text" name="address1' + iCount + '" value="" size="60"  class="required"></td></tr><tr><td width="130" height="20" valign="top"><span class="subheader">Address 2:</span></td><td width="370" height="20" valign="top"><input type="text" name="address2' + iCount + '" value="" size="60" ></td></tr><tr><td width="130" height="20" valign="top"><span class="subheader">Address 3:</span></td><td width="370" height="20" valign="top"><input type="text" name="address3' + iCount + '" value="" size="60" ></td></tr><tr><td width="130" height="20" valign="top"><span class="subheader">Town:</span></td><td width="370" height="20" valign="top"><input type="text" name="town' + iCount + '" value="" size="60"  class="required"></td></tr><tr><td width="130" height="20" valign="top"><span class="subheader">County:</span></td><td width="370" height="20" valign="top"><input type="text" name="county' + iCount + '" value="" size="60" ></td></tr><tr><td width="130" height="20" valign="top"><span class="subheader">Post Code:</span></td><td width="370" height="20" valign="top"><input type="text" name="postcode' + iCount + '" value="" size="60"  class="required"></td></tr><tr><td width="130" height="20" valign="top"><span class="subheader">Country:</span></td><td width="370" height="20" valign="top">' + strThisCountryDrop + '</td></tr><tr><td width="130" height="20" valign="top"><span class="subheader">Email:</span></td><td width="370" height="20" valign="top"><input type="text" name="email' + iCount + '" value="" size="60"  class="required"></td></tr><tr><td width="130" height="20" valign="top"><span class="subheader">Telephone:</span></td><td width="370" height="20" valign="top"><input type="text" name="telephone' + iCount + '" value="" size="60"  class="required"></td></tr><tr><td colspan="2">&nbsp;</td></tr>';
	}
		
	// Change the span to show the Guest rows
	hTicketSpan				= document.getElementById("extraSpan");
	hTicketSpan.innerHTML	= strOutput;
}




// Roadshow functions
function confirmRoadshowDelete(iRSID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this Roadshow?<br><a href="index.php?m=delete&iRSID=' + iRSID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function roadshowChangeImage(iRSID)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="index.php?m=newimage&iRSID=' + iRSID + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change Roadshow Image</span></td></tr><tr><td valign="top">Image:</td><td><input type="file" name="thephoto" size="45" onFocus="select()"><br><span class="failure">This image must be W: 180 x H: 150</span></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 300, yMousePos - 50);
}

function roadshowDeleteImage(iRSID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Image Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete the image for this roadshow?<br><a href="index.php?m=deleteimage&iRSID=' + iRSID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function roadshowChangeSponsor(iRSID, strSponsor)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="index.php?m=newsponsor&iRSID=' + iRSID + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change Roadshow Sponsor</span></td></tr><tr><td valign="top">Sponsor:</td><td><input type="index" name="sponsor" size="60" value="' + strSponsor +'"></td></tr><tr><td valign="top">Image:</td><td><input type="file" name="thesponsor" size="45" onFocus="select()"><br><span class="failure">Leave blank to just change sponsor\'s name<br>This image must be W: 180 x H: 150.</span></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 300, yMousePos - 50);
}

function roadshowDeleteSponsor(iRSID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Sponsor Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete the image for this roadshow?<br><a href="index.php?m=deletesponsor&iRSID=' + iRSID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}



// Tours
function confirmTourDelete(iTourID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this Tour?<br><a href="tours.php?m=delete&iTourID=' + iTourID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function tourChangeImage(iTourID)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="tours.php?m=newimage&iTourID=' + iTourID + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change Tour Image</span></td></tr><tr><td valign="top">Image:</td><td><input type="file" name="thephoto" size="45" onFocus="select()"><br><span class="failure">This image must be W: 338 x H: 218</span></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 300, yMousePos - 50);
}

function tourDeleteImage(iTourID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Image Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete the image for this tour?<br><a href="tours.php?m=deleteimage&iTourID=' + iTourID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function tourChangePDF(iTourID)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="tours.php?m=newpdf&iTourID=' + iTourID + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change Tour Brochure</span></td></tr><tr><td valign="top">Image:</td><td><input type="file" name="thephoto" size="45" onFocus="select()"><br><span class="failure">This brochure must be a PDF</span></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 300, yMousePos - 50);
}

function tourDeletePDF(iTourID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Image Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete the brochure for this tour?<br><a href="tours.php?m=deletepdf&iTourID=' + iTourID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function confirmTourInterestDelete(iTourID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete ALL the interst on this tour?<br><a href="tours.php?m=deleteallinterest&iTourID=' + iTourID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

// Tour section
function confirmTourSectionDelete(iSectionID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this Tour Section?<br><a href="tours.php?m=deletesection&iSectionID=' + iSectionID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function tourSectionChangeImage(iSectionID)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="tours.php?m=newsectionimage&iSectionID=' + iSectionID + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change Section Image</span></td></tr><tr><td valign="top">Image:</td><td><input type="file" name="thephoto" size="45" onFocus="select()"><br><span class="failure">This image must be W: 338 x H: 218</span></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 300, yMousePos - 50);
}

function tourSectionDeleteImage(iSectionID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Image Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete the image for this tour?<br><a href="tours.php?m=deletesectionimage&iSectionID=' + iSectionID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}



// Home Page fucntions
function edithpimage(strLabel, iWidth, iHeight)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="home.php?m=newimage&iWidth=' + iWidth + '&iHeight=' + iHeight + '&strLabel=' + strLabel + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change Image</span></td></tr><tr><td valign="top">Image:</td><td><input type="file" name="thephoto" size="45" onFocus="select()"><br><span class="failure">This image must be W: ' + iWidth + ' x H: ' + iHeight + '</span></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 140, yMousePos - 50);
}


function edithptext(strLabel, strData)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="home.php?m=newtext&strLabel=' + strLabel + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change Text</span></td></tr><tr><td valign="top">Text:</td><td><input type="text" name="strData" size="45" onFocus="select()" value="' + strData + '"></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 140, yMousePos - 50);
}

function edithpimagenew(strLabel, iWidth, iHeight, id)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="home.php?m=newimage&id=' + id + '&iWidth=' + iWidth + '&iHeight=' + iHeight + '&strLabel=' + strLabel + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change Image</span></td></tr><tr><td valign="top">Image:</td><td><input type="file" name="thephoto" size="45" onFocus="select()"><br><span class="failure">This image must be W: ' + iWidth + ' x H: ' + iHeight + ' or W: 250 x H: ' + iHeight + '</span></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 140, yMousePos - 50);
}


function edithptextnew(strLabel, strData, id)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="home.php?m=newtext&id=' + id + '&strLabel=' + strLabel + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change Text</span></td></tr><tr><td valign="top">Text:</td><td><input type="text" name="strData" size="45" onFocus="select()" value="' + strData + '"></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 140, yMousePos - 50);
}

function confirmImageDelete(id)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this product?<br><a href="home.php?m=delete&id=' + id + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}


// Splash Page fucntions
function editspimage(strLabel, iWidth, iHeight)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="splash.php?m=newimage&iWidth=' + iWidth + '&iHeight=' + iHeight + '&strLabel=' + strLabel + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change Image</span></td></tr><tr><td valign="top">Image:</td><td><input type="file" name="thephoto" size="45" onFocus="select()"><br><span class="failure">This image must be W: ' + iWidth + ' x H: ' + iHeight + '</span></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 140, yMousePos - 50);
}


function editsptext(strLabel, strData)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="splash.php?m=newtext&strLabel=' + strLabel + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change Text</span></td></tr><tr><td valign="top">Text:</td><td><input type="text" name="strData" size="45" onFocus="select()" value="' + strData + '"></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 140, yMousePos - 50);
}



// Email Creation Fucntions
function editemailimage(strLabel, iWidth, iHeight)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="index.php?m=newimage&iWidth=' + iWidth + '&iHeight=' + iHeight + '&strLabel=' + strLabel + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change Image</span></td></tr><tr><td valign="top">Image:</td><td><input type="file" name="thephoto" size="45" onFocus="select()"><br><span class="failure">This image must be W: ' + iWidth + ' x H: ' + iHeight + '</span></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 140, yMousePos - 50);
}


function editemailtext(strLabel, strData)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="index.php?m=newtext&strLabel=' + strLabel + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change Text</span></td></tr><tr><td valign="top">Text:</td><td><input type="text" name="strData" size="45" onFocus="select()" value="' + strData + '"></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 140, yMousePos - 50);
}



// IT Job Fnctions
function addJobDate(strPrefix, iJobID)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="index.php?m=' + strPrefix + 'date&iJobID=' + iJobID + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Estimate Completion</span></td></tr><tr><td valign="top">Date:</td><td><input type="text" name="strData" size="25" value="yyyy-mm-dd"></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 140, yMousePos - 50);
}

function addJobCost(strPrefix, iJobID)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="index.php?m=' + strPrefix + 'cost&iJobID=' + iJobID + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Estimate Cost</span></td></tr><tr><td valign="top">Cost:</td><td>&pound;<input type="text" name="strData" size="25"></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 140, yMousePos - 50);
}






/*	FRONT END FUNCTIONS	*/

function addBookmark(strTitle, strURL)
{
	strURL	=	'http://www.barmyarmy.com/' + strURL;
	
    if (window.sidebar)
	{
		window.sidebar.addPanel(strTitle, strURL,"");
	}
    else if( window.opera && window.print )
    {
	    var mbm = document.createElement('a');
	    mbm.setAttribute('rel', 'sidebar');
	    mbm.setAttribute('href', strURL);
	    mbm.setAttribute('title', strTitle);
	    mbm.click();
    }
    else if (document.all)
	{
		window.external.AddFavorite(strURL, strTitle);
	}
}


function registerUser(strPage)
{	
	/*
	strContent = '
	<table width="400" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td align="center"><h2>Registered Users Only</h2></td>
		</tr>
		<tr>
			<td>To enter Barmy Army competitions, download our magazines, or use the shop you need to be registered with us.</td>
		</tr>
		<tr>
			<td>
				<form action="/pots.php" method="POST" name="pop">
					<div id="float_holder">
						<div id="float_holder2">
							<table width="100% border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td colspan="2" align="center">REGISTERED USERS LOGIN</td>
								</tr>
								<tr>
									<td align="right"><span class="long">Email:</span></td>
									<td align="left"><input type="text" name="un" value="" size="20" ></td>
								</tr>
								<tr>
									<td align="right"><span class="long">Password:</span></td>
									<td align="left"><input type="password" name="pw" value="" size="20" onFocus="select()"></td>
								</tr>
								<tr>
									<td align="right"><span class="long">Remember Me:</span></td>
									<td align="left"><input type="checkbox" name="rm" value="yes" width="1"></td>
								</tr>
							</table>
						</div>
						<div id="float_login">
							<a href="javascript:document.pop.submit();">
								<img src="/images/framework/login.gif" alt="Login" title="Login" border="0">
							</a>
							<a href="/register.php">Register here</a>
						</div>
					</div>
					<input type="hidden" name="m" value="login" id="formmode">
				</form>
				<br>
				If you are not registered with the Barmy Army, please do so <a href="/register.php">here</a>
			</td>
		</tr>
		<tr>
			<td align="right"><a href="#" onClick="hideActionDiv(); return false;">close</a></td>
		</tr>
	</table>';
	*/
	
	strContent = '<table width="200" border="0" cellpadding="0" cellspacing="0"><tr><td align="center"><h2>Registered Users Only</h2></td></tr><tr><td>To enter Barmy Army competitions, download our magazines, or use the Shop you need to be registered with us.</td></tr><tr><td><form action="' + strPage + '" method="POST" name="pop"><div id="float_holder"><div id="float_holder2"><table width="200 border="0" cellpadding="0" cellspacing="0"><tr><td align="right"><span class="long">Email:</span></td><td align="left"><input type="text" name="un" value="" size="20" id="loginUsername" ></td></tr><tr><td align="right"><span class="long">Password:</span></td><td align="left"><input type="password" name="pw" value="" size="20" onFocus="select()" id="loginPassword" ></td></tr><tr><td align="right"><span class="long">Remember Me:</span></td><td align="left"><input type="checkbox" name="rm" value="yes" width="1" id="loginRemember" ></td></tr></table></div><div id="float_login"><a href="javascript:document.pop.submit();"><img src="/images/framework/login.gif" alt="Login" title="Login" border="0"></a></div></div></form><br>If you are not registered with the Barmy Army, please do so <a href="#" onclick="registerFloatingBox(\'' + strPage + '\', \'\', \'\', \'\', \'__Default\', \'\', \'\', \'__Default\', \'__Default\', \'__Default\', \'__Default\', \'\', \'\', \'\'); return false;">here</a>.</td></tr><tr><td align="right"><a href="#" onClick="hideActionDiv(); return false;">close</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', 200, 150);
}


function submitFloatingBox()
{
	// Get the entered username and password
	hLoginUsername			=	document.getElementById("loginUsername");
	hLoginPassword			=	document.getElementById("loginPassword");
	hLoginRemember			=	document.getElementById("loginRemember");
	strUsername				=	hLoginUsername.value;
	strPassword				=	hLoginPassword.value;
	strRemember				=	hLoginRemember.value;
	
	// Add them to the normal login box
	hStandUsername			=	document.getElementById("standardUsername");
	hStandPassword			=	document.getElementById("standardPassword");
	hStandRemember			=	document.getElementById("remember");
	hStandUsername.value	=	strUsername;
	hStandPassword.value	=	strPassword;
	hStandRemember.value	=	strRemember;
	
	// Submit the normal login box
	document.top.submit();
	
	// Hide the JS box
	hideActionDiv();
}


function registerFloatingBox(strURL, strError, strMemNum, strMemEmail, strTitle, strFN, strSN, strDay, strMonth, strYear, strSex, strPC, strEmail, strMob)
{
	// Declare Vars
	var strTitleSelected	=	'';
	var strDaySelected		=	'';
	var	strMWords			=	'';
	var	strMonthSelected	=	'';
	var strYearSelected		=	'';
	
	// Repopulate fields if we need to
	if(strTitle != '__Default')
	{
		strTitleSelected	=	'<option value="' + strTitle + '" selected>' + strTitle + '</option>';
	}
	
	if(strDay != '__Default')
	{
		strDaySelected		=	'<option value="' + strDay + '" selected>' + strDay + '</option>';
	}
	else
	{
		strDaySelected		=	'<option value="" selected></option>';
	}
	
	if(strMonth != '__Default')
	{
		switch(strMonth)
		{
			case '1':
				strMWords	=	'Jan';
				break;
				
			case '2':
				strMWords	=	'Feb';
				break;
				
			case '3':
				strMWords	=	'Mar';
				break;
				
			case '4':
				strMWords	=	'Apr';
				break;
				
			case '5':
				strMWords	=	'May';
				break;
				
			case '6':
				strMWords	=	'Jun';
				break;
				
			case '7':
				strMWords	=	'Jul';
				break;
				
			case '8':
				strMWords	=	'Aug';
				break;
				
			case '9':
				strMWords	=	'Sep';
				break;
				
			case '10':
				strMWords	=	'Oct';
				break;
				
			case '11':
				strMWords	=	'Nov';
				break;
				
			case '12':
				strMWords	=	'Dec';
				break;
		}
		
		strMonthSelected	=	'<option value="' + strMonth + '" selected>' + strMWords + '</option>';
	}
	else
	{
		strMonthSelected	=	'<option value="" selected></option>';
	}
	
	if(strYear != '__Default')
	{
		strYearSelected		=	'<option value="' + strYear + '" selected>' + strYear + '</option>';
	}
	else
	{
		strYearSelected		=	'<option value="" selected></option>';
	}
	
	if(strSex == 'F')
	{
		strSexSelected		=	'<input type="radio" name="sex" value="M" style="width:1.2em;">male<br><input type="radio" name="sex" value="F" checked style="width:1.2em;">female';
	}
	else
	{
		strSexSelected		=	'<input type="radio" name="sex" value="M" checked style="width:1.2em;">male<br><input type="radio" name="sex" value="F" style="width:1.2em;">female';
	}
		
	// Create the content
	strContent	=	'<div id="headline"><h1>Register with the Barmy Army </h1>Register for the website and receive Barmy Army emails and have permission to use the forums and feedback facilities.' + strError + '<form action="' + strURL + '" method="post" name="register"><table class="registerfloat"><tr><td colspan="2" align="left" valign="top"><h3>MEMBERS</h3></td></tr><tr><td align="right" valign="top">* Member No:</td><td valign="top"><input type="text" name="memnum" value="' + strMemNum + '" size="20" ></td></tr><tr><td align="right" valign="top">* Email:</td><td valign="top"><input type="text" name="mememail" value="' + strMemEmail + '" size="20" ></td></tr><tr><td colspan="2"><a href="javascript:document.register.submit()"><img src="/images/framework/register2.jpg" alt="Next step" title="Next step" border="0" class="next"></a></td></tr><tr><td colspan="2" align="left" valign="top"><h3>NON MEMBERS</h3></td></tr><tr><td align="right" valign="top">* Title:</td><td valign="top"><select name="title" size="1">' + strTitleSelected + '<option value="Mr">Mr</option><option value="Mrs">Mrs</option><option value="Miss">Miss</option><option value="Master">Master</option><option value="Dr">Dr</option><option value="Sir">Sir</option><option value="Lord">Lord</option><option value="Lady">Lady</option><option value="Madame">Madame</option></select></td></tr><tr><td align="right" valign="top">* First Name:</td><td valign="top"><input type="text" name="firstname" value="' + strFN + '" size="20" ></td></tr><tr><td align="right" valign="top">* Surname:</td><td valign="top"><input type="text" name="surname" value="' + strSN + '" size="20" ></td></tr><tr><td align="right" valign="top">* Date of Birth:</td><td valign="top"><select name="day" size="1" style="width:5em;"><option value="" selected>' + strDaySelected + '</option><option value="01">01</option><option value="02">02</option><option value="03">03</option><option value="04">04</option><option value="05">05</option><option value="06">06</option><option value="07">07</option><option value="08">08</option><option value="09">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option><option value="24">24</option><option value="25">25</option><option value="26">26</option><option value="27">27</option><option value="28">28</option><option value="29">29</option><option value="30">30</option><option value="31">31</option></select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - <select name="month" size="1" style="width:5em;">' + strMonthSelected + '</option><option value="1">Jan</option><option value="2">Feb</option><option value="3">Mar</option><option value="4">Apr</option><option value="5">May</option><option value="6">Jun</option><option value="7">Jul</option><option value="8">Aug</option><option value="9">Sep</option><option value="10">Oct</option><option value="11">Nov</option><option value="12">Dec</option></select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - <select name="year" size="1" style="width:5em;">' + strYearSelected + '</option><option value="1920">1920</option><option value="1921">1921</option><option value="1922">1922</option><option value="1923">1923</option><option value="1924">1924</option><option value="1925">1925</option><option value="1926">1926</option><option value="1927">1927</option><option value="1928">1928</option><option value="1929">1929</option><option value="1930">1930</option><option value="1931">1931</option><option value="1932">1932</option><option value="1933">1933</option><option value="1934">1934</option><option value="1935">1935</option><option value="1936">1936</option><option value="1937">1937</option><option value="1938">1938</option><option value="1939">1939</option><option value="1940">1940</option><option value="1941">1941</option><option value="1942">1942</option><option value="1943">1943</option><option value="1944">1944</option><option value="1945">1945</option><option value="1946">1946</option><option value="1947">1947</option><option value="1948">1948</option><option value="1949">1949</option><option value="1950">1950</option><option value="1951">1951</option><option value="1952">1952</option><option value="1953">1953</option><option value="1954">1954</option><option value="1955">1955</option><option value="1956">1956</option><option value="1957">1957</option><option value="1958">1958</option><option value="1959">1959</option><option value="1960">1960</option><option value="1961">1961</option><option value="1962">1962</option><option value="1963">1963</option><option value="1964">1964</option><option value="1965">1965</option><option value="1966">1966</option><option value="1967">1967</option><option value="1968">1968</option><option value="1969">1969</option><option value="1970">1970</option><option value="1971">1971</option><option value="1972">1972</option><option value="1973">1973</option><option value="1974">1974</option><option value="1975">1975</option><option value="1976">1976</option><option value="1977">1977</option><option value="1978">1978</option><option value="1979">1979</option><option value="1980">1980</option><option value="1981">1981</option><option value="1982">1982</option><option value="1983">1983</option><option value="1984">1984</option><option value="1985">1985</option><option value="1986">1986</option><option value="1987">1987</option><option value="1988">1988</option><option value="1989">1989</option><option value="1990">1990</option><option value="1991">1991</option><option value="1992">1992</option><option value="1993">1993</option><option value="1994">1994</option><option value="1995">1995</option><option value="1996">1996</option><option value="1997">1997</option><option value="1998">1998</option><option value="1999">1999</option><option value="2000">2000</option><option value="2001">2001</option><option value="2002">2002</option><option value="2003">2003</option><option value="2004">2004</option><option value="2005">2005</option><option value="2006">2006</option><option value="2007">2007</option></select></td></tr><tr><td align="right" valign="top">* Sex:</td><td valign="top">' + strSexSelected + '</td></tr><tr><td align="right" valign="top">Post Code:</td><td valign="top"><input type="text" name="postcode" value="' + strPC + '" size="20" ></td></tr><tr><td align="right" valign="top">Country:</td><td valign="top"><select name="country" size="1"><option value="AF">Afghanistan</option><option value="AL">Albania</option><option value="DZ">Algeria</option><option value="AS">American Samoa</option><option value="AD">Andorra</option><option value="AO">Angola</option><option value="AI">Anguilla</option><option value="AQ">Antarctica</option><option value="AG">Antigua And Barbuda</option><option value="AR">Argentina</option><option value="AM">Armenia</option><option value="AW">Aruba</option><option value="AU">Australia</option><option value="AT">Austria</option><option value="AZ">Azerbaijan</option><option value="BS">Bahamas</option><option value="BH">Bahrain</option><option value="BD">Bangladesh</option><option value="BB">Barbados</option><option value="BY">Belarus</option><option value="BE">Belgium</option><option value="BZ">Belize</option><option value="BJ">Benin</option><option value="BM">Bermuda</option><option value="BT">Bhutan</option><option value="BO">Bolivia</option><option value="BA">Bosnia And Herzegovina</option><option value="BW">Botswana</option><option value="BV">Bouvet Island</option><option value="BR">Brazil</option><option value="IO">British Indian Ocean Territory</option><option value="BN">Brunei Darussalam</option><option value="BG">Bulgaria</option><option value="BF">Burkina Faso</option><option value="BI">Burundi</option><option value="KH">Cambodia</option><option value="CM">Cameroon</option><option value="CA">Canada</option><option value="CV">Cape Verde</option><option value="KY">Cayman Islands</option><option value="CF">Central African Republic</option><option value="TD">Chad</option><option value="CL">Chile</option><option value="CN">China</option><option value="CX">Christmas Island</option><option value="CC">Cocos (keeling) Islands</option><option value="CO">Colombia</option><option value="KM">Comoros</option><option value="CG">Congo</option><option value="CD">Congo</option><option value="CK">Cook Islands</option><option value="CR">Costa Rica</option><option value="CI">Cote D\'ivoire</option><option value="HR">Croatia</option><option value="CU">Cuba</option><option value="CY">Cyprus</option><option value="CZ">Czech Republic</option><option value="DK">Denmark</option><option value="DJ">Djibouti</option><option value="DM">Dominica</option><option value="DO">Dominican Republic</option><option value="TP">East Timor</option><option value="EC">Ecuador</option><option value="EG">Egypt</option><option value="SV">El Salvador</option><option value="GQ">Equatorial Guinea</option><option value="ER">Eritrea</option><option value="EE">Estonia</option><option value="ET">Ethiopia</option><option value="FK">Falkland Islands (malvinas)</option><option value="FO">Faroe Islands</option><option value="FJ">Fiji</option><option value="FI">Finland</option><option value="FR">France</option><option value="GF">French Guiana</option><option value="PF">French Polynesia</option><option value="TF">French Southern Territories</option><option value="GA">Gabon</option><option value="GM">Gambia</option><option value="GE">Georgia</option><option value="DE">Germany</option><option value="GH">Ghana</option><option value="GI">Gibraltar</option><option value="GR">Greece</option><option value="GL">Greenland</option><option value="GD">Grenada</option><option value="GP">Guadeloupe</option><option value="GU">Guam</option><option value="GT">Guatemala</option><option value="GN">Guinea</option><option value="GW">Guinea-bissau</option><option value="GY">Guyana</option><option value="HT">Haiti</option><option value="HM">Heard Island And Mcdonald Islands</option><option value="VA">Holy See (vatican City State)</option><option value="HN">Honduras</option><option value="HK">Hong Kong</option><option value="HU">Hungary</option><option value="IS">Iceland</option><option value="IN">India</option><option value="ID">Indonesia</option><option value="IR">Iran</option><option value="IQ">Iraq</option><option value="IE">Ireland</option><option value="IL">Israel</option><option value="IT">Italy</option><option value="JM">Jamaica</option><option value="JP">Japan</option><option value="JO">Jordan</option><option value="KZ">Kazakstan</option><option value="KE">Kenya</option><option value="KI">Kiribati</option><option value="KP">Korea</option><option value="KR">Korea</option><option value="KW">Kuwait</option><option value="KG">Kyrgyzstan</option><option value="LA">Lao People\'s Democratic Republic</option><option value="LV">Latvia</option><option value="LB">Lebanon</option><option value="LS">Lesotho</option><option value="LR">Liberia</option><option value="LY">Libyan Arab Jamahiriya</option><option value="LI">Liechtenstein</option><option value="LT">Lithuania</option><option value="LU">Luxembourg</option><option value="MO">Macau</option><option value="MK">Macedonia</option><option value="MG">Madagascar</option><option value="MW">Malawi</option><option value="MY">Malaysia</option><option value="MV">Maldives</option><option value="ML">Mali</option><option value="MT">Malta</option><option value="MH">Marshall Islands</option><option value="MQ">Martinique</option><option value="MR">Mauritania</option><option value="MU">Mauritius</option><option value="YT">Mayotte</option><option value="MX">Mexico</option><option value="FM">Micronesia</option><option value="MD">Moldova</option><option value="MC">Monaco</option><option value="MN">Mongolia</option><option value="MS">Montserrat</option><option value="MA">Morocco</option><option value="MZ">Mozambique</option><option value="MM">Myanmar</option><option value="NA">Namibia</option><option value="NR">Nauru</option><option value="NP">Nepal</option><option value="NL">Netherlands</option><option value="AN">Netherlands Antilles</option><option value="NC">New Caledonia</option><option value="NZ">New Zealand</option><option value="NI">Nicaragua</option><option value="NE">Niger</option><option value="NG">Nigeria</option><option value="NU">Niue</option><option value="NF">Norfolk Island</option><option value="MP">Northern Mariana Islands</option><option value="NO">Norway</option><option value="OM">Oman</option><option value="PK">Pakistan</option><option value="PW">Palau</option><option value="PS">Palestinian Territory</option><option value="PA">Panama</option><option value="PG">Papua New Guinea</option><option value="PY">Paraguay</option><option value="PE">Peru</option><option value="PH">Philippines</option><option value="PN">Pitcairn</option><option value="PL">Poland</option><option value="PT">Portugal</option><option value="PR">Puerto Rico</option><option value="QA">Qatar</option><option value="RE">Reunion</option><option value="RO">Romania</option><option value="RU">Russian Federation</option><option value="RW">Rwanda</option><option value="SH">Saint Helena</option><option value="KN">Saint Kitts And Nevis</option><option value="LC">Saint Lucia</option><option value="PM">Saint Pierre And Miquelon</option><option value="VC">Saint Vincent And The Grenadines</option><option value="WS">Samoa</option><option value="SM">San Marino</option><option value="ST">Sao Tome And Principe</option><option value="SA">Saudi Arabia</option><option value="SN">Senegal</option><option value="SC">Seychelles</option><option value="SL">Sierra Leone</option><option value="SG">Singapore</option><option value="SK">Slovakia</option><option value="SI">Slovenia</option><option value="SB">Solomon Islands</option><option value="SO">Somalia</option><option value="ZA">South Africa</option><option value="GS">South Georgia And The South Sandwich Islands</option><option value="ES">Spain</option><option value="LK">Sri Lanka</option><option value="SD">Sudan</option><option value="SR">Suriname</option><option value="SJ">Svalbard And Jan Mayen</option><option value="SZ">Swaziland</option><option value="SE">Sweden</option><option value="CH">Switzerland</option><option value="SY">Syrian Arab Republic</option><option value="TW">Taiwan</option><option value="TJ">Tajikistan</option><option value="TZ">Tanzania</option><option value="TH">Thailand</option><option value="TG">Togo</option><option value="TK">Tokelau</option><option value="TO">Tonga</option><option value="TT">Trinidad And Tobago</option><option value="TN">Tunisia</option><option value="TR">Turkey</option><option value="TM">Turkmenistan</option><option value="TC">Turks And Caicos Islands</option><option value="TV">Tuvalu</option><option value="UG">Uganda</option><option value="UA">Ukraine</option><option value="AE">United Arab Emirates</option><option value="GB" selected>United Kingdom</option><option value="US">United States</option><option value="UM">United States Minor Outlying Islands</option><option value="UY">Uruguay</option><option value="UZ">Uzbekistan</option><option value="VU">Vanuatu</option><option value="VE">Venezuela</option><option value="VN">Vietnam</option><option value="VG">Virgin Islands</option><option value="VI">Virgin Islands</option><option value="WF">Wallis And Futuna</option><option value="EH">Western Sahara</option><option value="YE">Yemen</option><option value="YU">Yugoslavia</option><option value="ZM">Zambia</option><option value="ZW">Zimbabwe</option></select></td></tr><tr><td align="right" valign="top">* Email:</td><td valign="top"><input type="text" name="email" value="' + strEmail + '" size="20" ><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Your password will be sent here</td></tr><tr><td align="right" valign="top">Mobile:</td><td valign="top"><input type="text" name="mobile" value="' + strMob + '" size="20" ></td></tr><tr><td align="right" valign="top">* Contact:</td><td valign="top"><input type="checkbox" name="ce" value="1" checked style="width:1.2em;">Email<br><input type="checkbox" name="cs" value="1" checked style="width:1.2em;">Text<br><input type="checkbox" name="ct" value="1" checked style="width:1.2em;">3rd Parties<br></td></tr><tr><td align="right" valign="top">* Agree:</td><td valign="top"><input type="checkbox" name="accept" value="1" style="width:1.2em;">Please agree to the <a href="http://www.opsi.gov.uk/Acts/Acts1998/ukpga_19980029_en_1" target="_blank">Terms &amp; Conditions</a></td></tr><tr><td colspan="2"><input type="hidden" name="m" value="register" ><input type="hidden" name="p" value="" ><a href="javascript:document.register.submit()"><img src="/images/framework/register2.jpg" alt="Next step" title="Next step" border="0" class="next"></a></td></tr></table></form></div>';
	
	changeActionDiv(strContent, 'visible', 200, 70);
}


function registerFirstLogin(strEmail, strPassword)
{
	
	// Add them to the normal login box
	hStandUsername			=	document.getElementById("standardUsername");
	hStandPassword			=	document.getElementById("standardPassword");
	hStandUsername.value	=	strEmail;
	hStandPassword.value	=	strPassword;
	
	// Submit the normal login box
	document.top.submit();
	
	// Hide the JS box
	hideActionDiv();
}


function changeAshesTshirt()
{
	hTShirtDrop			=	document.getElementById("tshirtsize");
	hTShirtDrop.options[0].selected = true;
}


function checkNicknameSize(strVar)
{
	var strTShirtWarningString;
	var iTShirtText;
	var strTShirtText;
	
	// Do we have an strVar?
	if(!strVar)
	{
		var strVar = "";
	}
	
	hTShirtText		=	document.getElementById("tshirtinput" + strVar);
	hTShirtSpan		=	document.getElementById("tshirtcharsspan" + strVar);
	iTShirtText		=	hTShirtText.value.length;
	
	if(iTShirtText < 13)
	{
		strTShirtWarningString	=	'&pound;7.50 (' + iTShirtText + ' of 12 characters)';
		hTShirtSpan.innerHTML	=	strTShirtWarningString;
	}
	else
	{
		alert('You have reached the maximum length of 12 characters');
		strTShirtWarningString	=	'&pound;7.50- Maximum length reached';
		hTShirtSpan.text		=	strTShirtWarningString;
		strTShirtText			=	hTShirtText.value.substring(0,12);
		hTShirtText.value		=	strTShirtText;
	}
}


function downloadCalendar()
{
	strContent = '<table width="250" border="0" cellpadding="0" cellspacing="0"><tr><td align="center"><h2>Download Summer 10 Calendar</h2></td></tr><tr><td align="center"><br />Instructions for using with Outlook are included</td></tr><tr><td align="center"><br /><a href="http://www.barmyarmy.com/downloads/calendars/summer10.zip">download</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;">close</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', (xMousePos - 125), (yMousePos - 50));
}




//AFC functions



function insertElemTag(vElem, sStartTag, sEndTag, sDflt)
{
    if (vElem)
    {
        vElem.focus();
        
        if (document.selection) 
        {
            vCurSel = document.selection.createRange();
            
            if (vCurSel.text.length)
                vCurSel.text = sStartTag + vCurSel.text + sEndTag;
            else
                vCurSel.text = sDflt;
			}
			else if (vElem.selectionStart || vElem.selectionStart == '0') 
			{
				var nStart = vElem.selectionStart;
				var nEnd = vElem.selectionEnd;
				
				if (nStart != nEnd)
				{
					vElem.value = vElem.value.substring(0, nStart) + sStartTag + vElem.value.substring(nStart, nEnd) + sEndTag + vElem.value.substring(nEnd, vElem.value.length);
				}
				else
					vElem.value = vElem.value.substring(0, nStart) + sDflt + vElem.value.substring(nEnd, vElem.value.length);
			} 
			else 
			{
				vElem.value = vElem.value + sTag;
			}
    }
}

function getSel()
{
    if (document.selection) 
    {
        return document.selection;
	}
	else if (window.getSelection)
    {
    	  return window.getSelection();
    }
    else if (document.getSelection)
    {
        return document.getSelection();
    }
    
    return null;
}



function drawToolbar()
{
	document.write('<div id="msgToolbar"><table class="msgToolbar"><tr>' +
				 '	<td onClick="insertTag(\'b\');" title="Bold"><img src="../../../images/framework/b.gif" /></td>' + 
				 '	<td onClick="insertTag(\'i\');" title="Italic"><img src="../../../images/framework/i.gif" /></td>' + 
				 '	<td onClick="insertTag(\'u\');" title="Underline"><img src="../../../images/framework/u.gif" /></td>' + 
				 '	<td onClick="insertTag(\'strike\');" title="Strikethrough"><img src="../../../images/framework/strike.gif" /></td>' + 
				 '	<td onClick="insertMailTo(\'mail\');" title="Mail Hyperlink"><img src="../../../images/framework/email.png" /></td>' + 
				 '	<td onClick="insertiLink(\'ilink\');" title="Internal Hyperlink"><img src="../../../images/framework/link.gif" /></td>' + 
				 '	<td onClick="inserteLink(\'elink\');" title="External Hyperlink"><img src="../../../images/framework/web_link.png" /></td>' + 
				 '</tr></table></div>');
}


function insertTag(sTag)
{
    vElem = getElem('content');
    
    nOpenTags = countInstancesOf(vElem.value, '<' + sTag + '>');
    nCloseTags = countInstancesOf(vElem.value, '</' + sTag + '>');
    
    sDflt = nOpenTags > nCloseTags ? '</' + sTag + '>' : '<' + sTag + '>';
    
    insertElemTag(vElem, '<' + sTag + '>', '</' + sTag + '>', sDflt);
}

function countInstancesOf(sHaystack, sNeedle)
{
    var nTotal = 0;
    
    i = sHaystack.indexOf(sNeedle);
    
    while (i >= 0)
    {
        nTotal++;
        sHaystack = sHaystack.substring(i + sNeedle.length);
        i = sHaystack.indexOf(sNeedle);
    }
    
    return nTotal;
}

function insertBtml(sTag)
{
    vElem = getElem('msgInput');
    insertElemTag(vElem, '<' + sTag + '=', '>', '<' + sTag + '=>');
}

function insertMailTo(sTag)
{
    
    link = prompt('Please enter the desired email address',"editor@barmyarmy.com");
    
    vElem = getElem('content');
    insertElemTag(vElem, '<a href="mailto:' + link + '">', '</a>', '<a href="mailto:' + link + '">YOUR_TEXT_HERE</a>');
}

function insertiLink(sTag)
{
    
    link = prompt('Please enter the link URL',"http://www.barmyarmy.com/");
    
    vElem = getElem('content');
    insertElemTag(vElem, '<a href="' + link + '">', '</a>', '<a href="' + link + '">YOUR_TEXT_HERE</a>');
}

function inserteLink(sTag)
{
    
    link = prompt('Please enter the link URL',"http://www.battrick.org");
    
    vElem = getElem('content');
    insertElemTag(vElem, '<a href="' + link + ' " target="_blank">', '</a>', '<a href="' + link + '" target="_blank">YOUR_TEXT_HERE</a>');
}



function getElem(sId)
{
    return document.getElementById(sId);
}




// Shop Functions
function shopChangeImage(iProductID)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="index.php?m=newimage&iProductID=' + iProductID + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change Product Image</span></td></tr><tr><td valign="top">Image:</td><td><input type="file" name="thephoto" size="45" onFocus="select()"><br><span class="failure">This image must be W:  650 x H:  700</span></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 300, yMousePos - 50);
}

function confirmShopDelete(iProductID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this product?<br><a href="index.php?m=delete&iProductID=' + iProductID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function shopDeleteImage(iProductID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Image Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete the image for this product?<br><a href="index.php?m=deleteimage&iProductID=' + iProductID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}
function shopChangeCImage(iProductID)
{
	strContent = '<form method="POST" enctype="multipart/form-data" action="index.php?m=newcatimage&iProductID=' + iProductID + '"><table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td colspan="2" align="center"><span class="mainheader">Change Catagory Image</span></td></tr><tr><td valign="top">Image:</td><td><input type="file" name="thephoto" size="45" onFocus="select()"><br><span class="failure">This image must be W:  650 x H:  700</span></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" value="Save">&nbsp;&nbsp;&nbsp;<input type="button" onClick="hideActionDiv(); return false;" value="Cancel"></td></tr></table></form>';

	changeActionDiv(strContent, 'visible', xMousePos - 300, yMousePos - 50);
}

function confirmShopCDelete(iProductID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete this catagory?<br><a href="index.php?m=deletecatagory&iProductID=' + iProductID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}

function shopDeleteCImage(iProductID)
{
	strContent = '<table width="200" border="0" cellpadding="2" cellspacing="0"><tr><td align="center"><span class="mainheader">Confirm Image Deletion</span></td></tr><tr><td align="center">Are you sure you want to delete the image for this catagory?<br><a href="index.php?m=deletecatagoryimage&iProductID=' + iProductID + '" class="subheaderlink">YES</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onClick="hideActionDiv(); return false;" class="subheaderlink">NO</a></td></tr></table>';
	
	changeActionDiv(strContent, 'visible', xMousePos - 100, yMousePos - 50);
}