	function sitetest() {
			alert('site.js successfully tested');
		}


	function expand(asdf) {
			crnt = document.getElementById(asdf).rows;
			document.getElementById(asdf).rows = (crnt + 4);
	  }

	function contract(asdf) {
			crnt = document.getElementById(asdf).rows;
			newRows = (crnt - 4);
		if(newRows < 4){
			newRows = 4;
			}
		document.getElementById(asdf).rows = newRows;
	  }

	function changeVisibility(asdf,qwer) {
		crnt = document.getElementById(asdf).style.display;
		if((crnt == '') || (crnt == 'block')) {
			document.getElementById(asdf).style.display = 'none';
			plus = (document.getElementById(qwer).innerHTML);
			document.getElementById(qwer).innerHTML = plus.replace(/\-/,"+");
		}
		else {
			document.getElementById(asdf).style.display = 'block';
			minus = (document.getElementById(qwer).innerHTML);
			document.getElementById(qwer).innerHTML = minus.replace(/\+/,"-");

		}
	}

	function keepFile(myField) {
		mySource = myField.replace(/filename/,"fileKeep");
		document.getElementById(mySource).value = document.getElementById(myField).value;
	}

  function testKeyCode(e) {
    var keycode;
    if (window.event) keycode = window.event.keyCode;
    else if (e) keycode = e.which;
    var e = e || window.event;
    if(keycode==80 && e.altKey){
      alert("alt-p was pressed");
    }
  }
  document.onkeydown = testKeyCode;



function showAction(qwer) {
	var radioLength = qwer.length;
	for(var i = 0; i < radioLength; i++) {
		if(qwer[i].checked) {
			myVal = (qwer[i].value);
		}
	}
	if(myVal == 'Child/children') {
			document.getElementById('forChildren').style.display = 'block';
			document.getElementById('forFamilies').style.display = 'none';
	}
	if(myVal == 'A family/families') {
			document.getElementById('forChildren').style.display = 'none';
			document.getElementById('forFamilies').style.display = 'block';
	}

}


function fred2() {
var fred = document.getSelection();
alert(fred);
}




/*
$(document).ready(function(){
    setInterval(function(){
        $('#flag1').load("/random.lasso", { 'abc':'xyz' });
    }, 5000);
});
*/

$(document).ready(function() {
	var searchLabel = 'Username';
	$('#form101x label').remove().text();
	$('#x1001').addClass('fieldPlaceholder').val(searchLabel).focus(function() {
	if(this.value == searchLabel) {
		$(this).removeClass('fieldPlaceholder').val('');
	};
	}).blur(function() {
	if(this.value == '') {
		$(this).addClass('fieldPlaceholder').val(searchLabel);
	};
	});

	$('#x1002').hide()
	var searchLabel2 = 'Password';
	$('#y1002').addClass('fieldPlaceholder').val(searchLabel2).focus(function() {
	if(this.value == searchLabel2) {
		$(this).removeClass('fieldPlaceholder').val('');
		$('#y1002').hide()
		$('#x1002').show().focus();
	};
	});

	var searchLabel2 = 'Password';
	$('#x1002').blur(function() {
	if(this.value == '') {
		$('#x1002').hide();
		$('#y1002').show();
		$('#y1002').addClass('fieldPlaceholder').val(searchLabel2).blur();
	};
	});


/*
2010-01-24: Next function changed to get PTB working in IE7
	$(this).attr({
		id: newTrigger,
	 });
changed to
	$(this).attr(
		'id','newTrigger'
	 );
I have no idea if this works - it is part of the edit help system which is embryonic, and not in use;
*/
	$('p.newClause').live("click", function() {
	var oldTrigger = this.id;
	var oldTrigger = oldTrigger.replace('newClause', '');
	var newTrigger = oldTrigger + "1";
	var newCounter = oldTrigger + "2"
	$(this).attr(
		'id','newTrigger'
	 );
	$('<p id="newClause' + newCounter + '" class="newClause">New clause here</p><p>Clause heading: <input name=\"clauseHeading' + newCounter + '\" id=\"clauseHeading' + newCounter + '\" type=\"text\" size=\"35\" value=\"New heading' + newCounter + '\" /></p><p>Clause intro: <textarea id=\"clauseText' + newCounter + '\" name=\"clauseText' + newCounter + '\" rows=\"2\" cols=\"55\">New clause' + newCounter + '</textarea></p>')
		.insertBefore('#' + newTrigger);
	});
});

function myclick() {
$('p.newClause').click(function() {
var oldTrigger = this.id;
var oldTrigger = oldTrigger.replace('newClause', '');
 newTrigger = oldTrigger + "1";
var newCounter = oldTrigger + "2"
	$(this).attr(
		'id','newTrigger'
	 );


	$('<p id="newClause' + newCounter + '" class="newClause"><a href="javascript:myclick()">New clause here</a></p><p>Clause heading: <input name=\"clauseHeading' + newCounter + '\" id=\"clauseHeading' + newCounter + '\" type=\"text\" size=\"35\" value=\"New heading' + newCounter + '\" /></p><p>Clause intro: <textarea id=\"clauseText' + newCounter + '\" name=\"clauseText' + newCounter + '\" rows=\"2\" cols=\"55\">New clause' + newCounter + '</textarea></p>')
	.insertBefore('#' + newTrigger);
});
}

$(document).ready(function(){


	$('#haveyoursay').addClass('haveyoursay').val('Have your say').focus(function() {
		if(this.value == 'Have your say') {
			$(this).removeClass('haveyoursay').val('');
		};
		}).blur(function() {
		if(this.value==''){
			$(this).addClass('haveyoursay').val('Have your say');
		};
	});


$('#newGroup11').click(function() {
	$('<fieldset class="" id="fieldset2" style="display:block;"><p>Group heading: <input name="groupHeading11" id="groupHeading11" type="text" size="35" /></p><p>Group intro: <textarea id="groupIntro11" name="groupIntro11" rows="2" cols="55"></textarea></p><p id="fred">Clause heading: <input name="clauseHeading11" id="clauseHeading11" type="text" size="35" /></p><p>Clause text: <textarea id="clauseText11" name="clauseText11" rows="2" cols="55"></textarea></p><p id="newClause13" class="hover">New clause here</p></fieldset>')
	.insertBefore('#fieldset2');
});
});

// Uses jquery.countdown from http://keith-wood.name/countdown.html
function myCounter(myyear,mymonth,myday,myhour,myminute,target) {
	$(function () {
		$(target).countdown({until: new Date(myyear,mymonth,myday,myhour,myminute), compact:true, layout:'{dn}:{hnn}:{mnn}:{snn}'});
	});
}


// Uses jquery.countdown from http://keith-wood.name/countdown.html
function myCounter2(leadTime,target) {
	now = new Date();
	nowMilliSecs = now.getTime();
	var trgtMilliSecs = (nowMilliSecs + (leadTime * 1000));
	$(function () {
		$(target).countdown({until: new Date(trgtMilliSecs), compact:true, layout:'{dn}:{hnn}:{mnn}:{snn}'});
	});
}

// Uses jquery.countdown from http://keith-wood.name/countdown.html
function myCounter3(leadTime,target) {
	now = new Date();
	nowMilliSecs = now.getTime();
	var trgtMilliSecs = (nowMilliSecs + (leadTime * 1000));
	$(function () {
		if(leadTime <= 60 * 60) {
			$(target).countdown({until: new Date(trgtMilliSecs), compact:true, layout:'{mn} m {sn} s', onExpiry: liftOff});
		} else {
			$(target).countdown({until: new Date(trgtMilliSecs), compact:true, layout:'{hn} hour {mn} minutes {sn} seconds', onExpiry: liftOff});
		}
	});
}

function liftOff() {
    $('#centralCell').replaceWith('<p class="alert">This bucket is now closing</p>');
}



function showMoreLess(counter, total, myShortHost) {

   $('#projectsBar').replaceWith('<span id="projectsBar" onclick="openAll(' + total + ')"><img  src="http://' +
   myShortHost + '.pickthebucket.org.uk/site/media/images/common/flippy_black_right.gif"  id="flipTriangleRight' + counter + '"style="vertical-align:-2px" alt="" /> Show details of all ' +
   total + ' projects</span>');

   $('#here' + counter).replaceWith('<tr><td colspan="3" style="padding-left:12px"><p class="nsba" id="flipProjRight' +
   counter + '" onclick="flippyOpen(' + counter + ', \'' + myShortHost + '\')" style="cursor:pointer"><img  src="http://' +
   myShortHost + '.pickthebucket.org.uk/site/media/images/common/flippy_black_right.gif"  id="flipTriangleRight' + counter + '"style="vertical-align:-2px" alt="" /> More about this project</p></tr></td>');


	$('#projectBody' + counter).hide();
/*	$('.rank').hide();*/
}

function flippyOpen(counter, myShortHost){
	$('#flipProjRight' + counter).replaceWith('<p class="nsba" id="flipProjRight' + counter + '" onclick="flippyClose(' + counter + ', \'' + myShortHost + '\')" style="cursor:pointer"><img  src="http://' + myShortHost + '.pickthebucket.org.uk/site/media/images/common/flippy_black_down.gif"  id="flipTriangleDown' + counter + '"style="vertical-align:-2px" alt="" /> Less about this project</p>');
	$('#projectBody' + counter).show();
}

function flippyClose(counter, myShortHost){
	$('#flipProjRight' + counter).replaceWith('<p class="nsba" id="flipProjRight' + counter + '" onclick="flippyOpen(' + counter + ', \'' + myShortHost + '\');" style="cursor:pointer"><img  src="http://' + myShortHost + '.pickthebucket.org.uk/site/media/images/common/flippy_black_right.gif"  id="flipTriangleDown' + counter + '"style="vertical-align:-2px" alt="" /> More about this project</p>');
	$('#projectBody' + counter).hide();
}

function openAll(total, myShortHost) {
var myShortHost = 'dev';
	for (i=1;i<=total;i++) {
		flippyOpen(i, myShortHost);
	};
	$('#projectsBar').replaceWith('<span id="projectsBar" onclick="closeAll(' + total + ', \'' + myShortHost + '\')">' +
	'<img  src="http://' + myShortHost + '.pickthebucket.org.uk/site/media/images/common/flippy_black_down.gif"  id="flipTriangleRight' + '"style="vertical-align:-2px" alt="" />' +
   ' Hide details of all ' + total + ' projects</a>');
}

function closeAll(total, myShortHost) {
var myShortHost = 'dev';
	for (i=1;i<=total;i++) {
		flippyClose(i, myShortHost);
 	};
   $('#projectsBar').replaceWith('<span id="projectsBar" onclick="javascript:openAll(' + total + ', \'' + myShortHost + '\')">' +
	'<img  src="http://' + myShortHost + '.pickthebucket.org.uk/site/media/images/common/flippy_black_right.gif"  id="flipTriangleDown' + '"style="vertical-align:-2px" alt="" />' +
   ' Show details of all ' + total + ' projects</a>');
}



function flippyOpenA(mySelector, targetSelector, toOpenLabel, toCloseLabel){
	if(toOpenLabel == null) {
		toOpenLabel = 'Show details';
	}
	if(toCloseLabel == null) {
		toCloseLabel = 'Hide details';
	}
	$('#' + mySelector).replaceWith(
	'<p id="' + mySelector + '" onclick="flippyCloseA(\'' + mySelector + '\',\'' + targetSelector + '\',\'' + toOpenLabel + '\',\'' + toCloseLabel + '\')" style="cursor:pointer" class="flippyTriangle">' +
		'<img  src="/site/media/images/common/flippy_black_down.gif" id="flipTriangleDown" style="vertical-align:-2px;margin-right:3px" alt="" />' +
		toCloseLabel +
	'</p>');
	$('#' + targetSelector).show();
}

function flippyCloseA(mySelector, targetSelector, toOpenLabel, toCloseLabel){
	if(toOpenLabel == null) {
		toOpenLabel = 'Show details';
	}
	if(toCloseLabel == null) {
		toCloseLabel = 'Hide details';
	}
	$('#' + mySelector).replaceWith(
	'<p id="' + mySelector + '" onclick="flippyOpenA(\'' + mySelector + '\',\'' + targetSelector + '\',\'' + toOpenLabel + '\',\'' + toCloseLabel + '\')" style="cursor:pointer" class="flippyTriangle">' +
		'<img  src="/site/media/images/common/flippy_black_right.gif" id="flipTriangleDown" style="vertical-align:-2px;margin-right:3px" alt="" />' +
		toOpenLabel +
	'</p>');
	$('#' + targetSelector).hide();
}



//	Sets the first letter of targetText to uppercase.
function firstToUpper(targetText) {
	myOutputFirst = targetText.slice(0,1).toUpperCase();
	myOutputRest = targetText.slice(1);
	return myOutputFirst + myOutputRest;
}

function firstToLower(targetText) {
	myOutputFirst = targetText.slice(0,1).toLowerCase();
	myOutputRest = targetText.slice(1);
	return myOutputFirst + myOutputRest;
}

function elementFirstToLower(targetElement) {
	var inputString = document.getElementById(targetElement).value;
	document.getElementById(targetElement).value = ((inputString.substring(0,1)).toLowerCase() + inputString.substring(1));
}



function moneyFormat(inputInPence) {

	pence = (inputInPence.toString()).slice(-2);

	var pounds = '';
	input = (inputInPence.toString()).slice(0, -2);
	while (input.length >= 3) {
		output = (input.substring((input.length)-3,input.length));
		pounds = output + ',' + pounds;
		input = (input.substring(0,(input.length)-3));
	}
	pounds = input + ',' + pounds;
	if (pounds.charAt(pounds.length-1) == ',') {
		pounds = pounds.slice(0,-1);
	}

	if (pounds.charAt(0) == ',') {
		pounds = pounds.slice(1);
	}

	if(pounds.length == 0) {
		pounds = '0';
	}

	if(pence.length == 1) {
		pence = '0' + pence;
	}

	return pounds + '.' + pence;

}




function wordCountdown(allowed, targetArea) {
	source = document.getElementById(targetArea).value;
	asArray = source.split(/\s+/);
	document.getElementById('countdown').innerHTML = 'Words left: ' + (allowed + 1 - (asArray.length));
	if((asArray.length) > allowed) {
		document.getElementById(targetArea).value = (asArray.slice(0,allowed)).join(' ');
	}
}


//== == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==


function arrayContains(theValue, theArray) {
	var found = false;
	for(var j = 0; j < theArray.length; j++) {
		if(theValue == theArray[j]) {
			found = true;
		}
	}
	return found;
}


function convert() {
	var changeTheseToLower = new Array('riskLevel', 'riskDetails', 'directAction', 'directBnft', 'indirectBnfcrs', 'indirectBnft');
	for(var i = 0; i < arguments.length; i++) {
		var scratchString = document.getElementById(arguments[i] + 'Src').innerHTML;
		if(arrayContains(arguments[i], changeTheseToLower)) {
			document.getElementById(arguments[i] + 'Trgt').value = firstToLower(scratchString.replace(/<br>/g, '\r'));
		} else {
			document.getElementById(arguments[i] + 'Trgt').value = scratchString.replace(/<br>/g, '\r');
		}
		document.getElementById(arguments[i] + 'Trgt').focus();
	}
}

// Introduction/Timing

function convertTiming(startImmediate,startWhenDate) {
	var statement = '';
	if(startImmediate == 'Y') {
		 statement += ('immediately');
	} else  {
		 statement += (startWhenDate);
	}
	document.getElementById('timing' + 'Trgt').value = statement;
}

//	Effects/Benefits

function convertChildren(lowestAge, highestAge, childTally) {
	var statement = '';
	if(lowestAge == highestAge) {
		 statement += (childTally  +  ' child' + (childTally > 1 ? 'ren' : '') + ' aged ' + highestAge);
	} else if(childTally == 2) {
		 statement += (childTally  + ' children aged ' + lowestAge + ' and ' + highestAge);
	} else {
		 statement += (childTally  + ' children aged ' + lowestAge + ' to ' + highestAge);
	}
	document.getElementById('directBnftWho' + 'Trgt').value = statement;
}

function convertGroup() {
	document.getElementById('directBnftWho' + 'Trgt').value = (document.getElementById('groupTally' + 'Src').innerHTML) + ' children in ' +
	(document.getElementById('groupDesc' + 'Src').innerHTML) + ' known as ' +
	(document.getElementById('groupName' + 'Src').innerHTML);
}

function convertHousehold() {
	document.getElementById('directBnftWho' + 'Trgt').value = (parseInt(document.getElementById('householdBoysTally' + 'Src').innerHTML) + parseInt(document.getElementById('householdGirlsTally' + 'Src').innerHTML)) + ' children in the ' +
	(document.getElementById('householdName' + 'Src').innerHTML) + ' household';
}

//	Risks/Checks

function convertSteps(input) {
	document.getElementById('noWaste' + 'Trgt').value = input.replace(/%%%/g, '\r');
}

//	Finance

function convertBudgetFigures(totalBudget) {
	var exchangeRate = document.getElementById('exchangeRate').value;
	var overheadPercent = document.getElementById('overheadPercent').value;
	var scratchDecimal = (totalBudget / exchangeRate * ((100 + parseInt(overheadPercent))/100));
	scratchDecimal = (Math.round(scratchDecimal * 100)) / 100;
	document.getElementById('budgetFigures' + 'Trgt').value = scratchDecimal.toFixed(2);
}

function convertBudgetItems() {
	var statement = '';
	for(var i = 0; i < arguments.length; i++) {
		statement += arguments[i] + '\r';
	}
	statement = statement.replace(/<br \/>/g, '\r');
	statement = statement.replace(/other \(please list\)/g, '');
	statement = statement.replace(/\r+/g, '\r');
	statement = statement.substr(0, ((statement.length)-1));
	document.getElementById('budgetItems' + 'Trgt').value = statement;
}

//	Sidebar
function convertParents() {
	var fatherPresent = (document.getElementById('householdFatherPrsnt' + 'Src').innerHTML)
	var motherPresent = (document.getElementById('householdMotherPrsnt' + 'Src').innerHTML)
	var statement = '';
	if(fatherPresent == 'Y') {
		statement += 'The children\'s father is present\r';
	}
	if(fatherPresent == 'N') {
		statement += 'The children\'s father is not present\r';
	}
	if(motherPresent == 'Y') {
		statement += 'The children\'s mother is present\r';
	}
	if(motherPresent == 'N') {
		statement += 'The children\'s mother is not present\r';
	}
	statement = statement.substr(0, ((statement.length)-1));
	document.getElementById('parents' + 'Trgt').value = statement;
}

function convertHhCircs() {
	var scratchString = document.getElementById('householdCircs' + 'Src').innerHTML;
	var scratchArray = scratchString.split('<br>');
	for(var i = 0; i < scratchArray.length; i++) {
		scratchArray[i] = firstToUpper(scratchArray[i]);
	}
	scratchString = 	scratchArray.join('\r');
	document.getElementById('householdCircs' + 'Trgt').value = scratchString;
	document.getElementById('householdCircs' + 'Trgt').focus();
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

//	2010-03-03: These appear to no longer be used.
// function convert2(identifier) {
// 	document.getElementById('kidTallyTrgt').value = (document.getElementById('kidTallySrc').innerHTML);
// 	if(identifier == 'oneAge') {
// 		document.getElementById('kidLowAge').value = (document.getElementById('lowestAge').innerHTML);
// 	}
// 	if(identifier == 'twoKids' || identifier == 'other') {
// 		document.getElementById('kidLowAge').value = (document.getElementById('lowestAge').innerHTML);
// 		document.getElementById('kidHighAge').value = (document.getElementById('highestAge').innerHTML);
// 	}
// }

// function convert3(identifier) {
// 		document.getElementById('office' + 'Trgt').value = (document.getElementById('office' + 'Src').innerHTML);
// document.getElementById('office' + 'Trgt').focus();
// 		document.getElementById('country' + 'Trgt').value = (document.getElementById('country' + 'Src').innerHTML);
// document.getElementById('country' + 'Trgt').focus();
// }

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


function convertSctn(identifier, param1, param2) {
	if(identifier == 'introduction') {
		convert('projName', 'office', 'country', 'directAction')
	}
	if(identifier == 'timing') {
		convert('actionDuration', 'finalReport','interimReport');
		convertTiming(param1, param2);
	}
	if(identifier == 'benefits') {
		convert('directBnft', 'bnftDuration', 'indirectBnftTally', 'indirectBnfcrs', 'indirectBnft');
	}
	if(identifier == 'otherInformation') {
		convert('householdCircs');
		convertParents();
	}
}


//== == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==



function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;



$(document).ready(function() {

	var toProjLabel = "Queries to Project";
	$('.toProj').focus(function() {
		if(this.value == toProjLabel) {
			$(this).removeClass('placeholder').val('');
		};
	}).blur(function() {
		if(this.value == '') {
			$(this).addClass('placeholder').val(toProjLabel);
		};
	});

	var toOpsLabel = "Queries to Operations";
	$('.toOps').focus(function() {
		if(this.value == toOpsLabel) {
			$(this).removeClass('placeholder').val('');
		};
	}).blur(function() {
		if(this.value == '') {
			$(this).addClass('placeholder').val(toOpsLabel);
		};
	});

//	For image rollovers
		$(".rollover").hover(function(){
			$(this).attr('src',$(this).attr('src').replace('_up','_ov'));
		},function(){
			$(this).attr('src',$(this).attr('src').replace('_ov','_up'));
		});


//	For handing changes to the allocation popup
	$('#allocation').change(function () {
		var alreadyPaid = (document.getElementById('alreadyPaid').value);
		if(this.value != alreadyPaid) {
			$('#giveButton').attr('src',$('#giveButton').attr('src').replace('_faint','_up'));
			$('#pressGiveAlert').show();
			$('#giveText').html('I\'d like to give');
		} else {
			$('#giveButton').attr('src',$('#giveButton').attr('src').replace('_up','_faint'));
			$('#pressGiveAlert').hide();
			$('#giveText').html('I\'m giving');
		};
	});

	$('#giveButton').click(function () {
		var alreadyPaid = (document.getElementById('alreadyPaid').value);
		var allocation = (document.getElementById('allocation').value);
		if(allocation != alreadyPaid) {
			$("#giveAllocation").submit();

		};
	});

	$('#giveOther').click(function () {
		var allocation = (Math.floor(document.getElementById('otherAmount').value));
		if (allocation > 0) {
			allocation = allocation.toFixed(0);
			$('<option value="' + allocation + '">&pound;' + allocation + '</option>').insertAfter('#otherOption');
			$('#allocation').val(allocation);
			$("#otherValue").hide();
			$("#giveButton").trigger('click');
		}
		return false;
	});

});

function photoDupe() {
	document.getElementById('photoFileName2').value = document.getElementById('photoFileName').value;
}


//== == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
/* Functions for menu display */

$(document).ready(function(){
	$('.menuPanelTBody').hide();
});

function menuDisplay(panelID, triangleColour) {
	crnt = document.getElementById(panelID + '_tbody').style.display;
	if(crnt == 'block') {
		document.getElementById(panelID + '_tbody').style.display = 'none';
		(document.getElementById(panelID + '_triangle').innerHTML) =
		'<img  src="/site/media/images/common/flippy_' + triangleColour + '_right.gif"  id="' + panelID + '_triangle" class="menuTriangle" alt="Open panel" />';
	} else {
		document.getElementById(panelID + '_tbody').style.display = 'block';
		(document.getElementById(panelID + '_triangle').innerHTML) =
		'<img  src="/site/media/images/common/flippy_' + triangleColour + '_down.gif"  id="' + panelID + '_triangle" class="menuTriangle" alt="Close panel" />';
	}
}

//== == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
/* Unobtrusive JavaScript! */

$(document).ready(function(){
	$('#cancelFeedback').click(function () {
		window.close();return false;
	});
});



//== == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==


function showBiog(projBiogID) {

	var bucketTypeOffset = 0;
	if (arguments.length > 1) {
		bucketTypeOffset = arguments[1]
	}

	var picPosition = $("#" + projBiogID).position();
	var topOfPic = picPosition.top - 116;
	var leftOfPic = (bucketTypeOffset * -1);

	$('#biogsPanel').css("top",topOfPic + "px");
	$('#biogsPanel').css("left",leftOfPic + "px");
	$('#biogsPanel').show("slide", { direction: "right" }, 2000);$('.biography').hide();
	$('#' + projBiogID.substr(16,16) + '_biog').show();
}


$(document).ready(function(){
	$('.multiNote').click(function () {
		$('#multiNotePanel').show();
	});
});


//== == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
/* Registrations - how did you hear */

$(document).ready(function(){

	$('#howHearOtherAll').hide();

	$('#howHear').change(function () {
		if(this.value == 'other') {
	$('#howHearOtherAll').slideDown('slow');
		} else {
	$('#howHearOtherAll').slideUp('fast');
		};
	});

});



// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//	Scripts for handling project trees

	$(document).ready(function(){

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//	Confirm user does want to replay the selected project
		$('.replayLink').click(function() {

		$('#cell' + this.id).css('background-color', '#F33');	//	red
			proceed=confirm('Do you wish to proceed with replay?');
			if(proceed){
				window.location = "/admin/projneeds/projectTreeOK.lasso?id=" + this.id
			} else {
				$('#cell' + this.id).css('background-color', '#CC9');	// original pale olive
			}
		});

	});

