//###########################################
//# Title: 		content.js          		#
//#-----------------------------------------#
//# Editors:	Mark Overy        	      	#
//# 			James Worsdall				#
//#-----------------------------------------#
//# Created:	01-06-2010					#
//# Modified:	25-01-2011					#
//#-----------------------------------------#
//# Version:	1.0							#
//###########################################

var gCategory = ""
var gAboutState = ""

function setupBigPanel(panelFocus,strVar){
window.location.hash = panelFocus;
switch(panelFocus)
{
	case 'bp1':
		document.getElementById('bPanelTitle').firstChild.nodeValue='Pets';
		if (jsKeyOwner == 'True'){ 
			document.getElementById('newPanel').firstChild.nodeValue='add pet';
			document.getElementById('newPanel').onclick=function(){setupFloatPanel('addPet')};
			document.getElementById('bPanelButton').style.display = "block";
		}else{
			document.getElementById('bPanelButton').style.display = "none";
		}
		document['bPanelImg'].src = 'images/interface/orbPaw.png';
		document['bPanelImg'].style.margin = '0px 0px 0px 2px';
		ajaxLoad('/scripts/asp/ajaxPets.asp?page=1&pt=A','bPanelContent');
		break;
	case 'bp2':
		document.getElementById('bPanelTitle').firstChild.nodeValue='Businesses';
		if (jsKeyOwner == 'True'){ 
			document.getElementById('newPanel').firstChild.nodeValue='add business';
			document.getElementById('newPanel').onclick=function(){setupFloatPanel('signupBusiness','&st=2&stp=eu&sv=1&ss=1','your business');};
			document.getElementById('bPanelButton').style.display = "block";
		}else{
			document.getElementById('bPanelButton').style.display = "none";
		}
		document['bPanelImg'].src = 'images/interface/orbStar.png';
		document['bPanelImg'].style.margin = '0px 0px 0px 2px';
		ajaxLoad('/scripts/asp/ajaxBusinesses.asp?page=1','bPanelContent');
		break;
	case 'bp3':
		document.getElementById('bPanelTitle').firstChild.nodeValue='Companions';
		if (jsKeyOwner == 'True'){ 
			document.getElementById('newPanel').firstChild.nodeValue='add companion';
			document.getElementById('newPanel').onclick=function(){};
			document.getElementById('bPanelButton').style.display = "none";
		}else{
			document.getElementById('bPanelButton').style.display = "none";
		}
		document['bPanelImg'].src = 'images/interface/orbTick.png';
		document['bPanelImg'].style.margin = '0px 0px 0px 2px';
		ajaxLoad('/scripts/asp/ajaxCompanions.asp?page=1&ct=C','bPanelContent');
		break;
	case 'bp4':
		document.getElementById('bPanelTitle').firstChild.nodeValue='Groups';
		if (jsKeyOwner == 'True'){ 
			document.getElementById('newPanel').firstChild.nodeValue='create new group';
			document.getElementById('newPanel').onclick=function(){setupFloatPanel('addGroup')};
			document.getElementById('bPanelButton').style.display = "block";
		}else{
		document.getElementById('bPanelButton').style.display = "none";
		}
		document['bPanelImg'].src = 'images/interface/orbGroup.png';
		document['bPanelImg'].style.margin = '0px 0px 0px 2px';
		ajaxLoad('/scripts/asp/ajaxGroups.asp?page=1&bpgt=H','bPanelContent');
		break;
	case 'bp5':
		document.getElementById('bPanelTitle').firstChild.nodeValue='Photo gallery';
		if (jsKeyOwner == 'True'){ 
			document.getElementById('newPanel').firstChild.nodeValue='create new album';
			document.getElementById('newPanel').onclick=function(){};
			document.getElementById('bPanelButton').style.display = "block";
		}else{
			document.getElementById('bPanelButton').style.display = "none";
		}
		document['bPanelImg'].src = 'images/interface/interestIcon.png';
		//ajaxRequest('/scripts/asp/ajaxPhotoGallery.asp?page=1','bPanelContent');
		break;
	case 'bp6':
		document.getElementById('bPanelTitle').firstChild.nodeValue='Edit Profile';
		if (jsKeyOwner == 'True'){ 
			document.getElementById('bPanelButton').style.display = "none";
		}else{
			document.getElementById('bPanelButton').style.display = "none";
		}
		document['bPanelImg'].src = 'images/interface/orbProfile.png';
		document['bPanelImg'].style.margin = '0px 0px 0px 2px';
		ajaxLoad('/scripts/asp/ajaxProfileEdit.asp?page=1&ld=1','bPanelContent');
		break;
	case 'bp7':
		document.getElementById('bPanelTitle').firstChild.nodeValue='Comments';
		document.getElementById('bPanelButton').style.display = "block";
		document.getElementById('newPanel').firstChild.nodeValue='add comment';
		document.getElementById('newPanel').onclick=function(){document.addComments.addComment.focus();};
		document['bPanelImg'].src = 'images/interface/orbComment.png';
		document['bPanelImg'].style.margin = '0px 0px 0px 2px';
		ajaxLoad('/scripts/asp/ajaxComments.asp?page=1&comm=C','bPanelContent');
		break;
	case 'bp8':
		if (typeof strVar === 'undefined'){strVar = "Current"}
		document.getElementById('bPanelTitle').firstChild.nodeValue=strVar + ' Members';
		if (jsKeyOwner == 'True'){ 
			document.getElementById('newPanel').firstChild.nodeValue='add ' + strVar.toLowerCase() + ' member';
			document.getElementById('bPanelButton').style.display = "none";
		}else{
			document.getElementById('bPanelButton').style.display = "none";
		}
		document['bPanelImg'].src = 'images/interface/orb' + strVar + '.png';
		document['bPanelImg'].style.margin = '0px 0px 0px 2px';
		ajaxLoad('/scripts/asp/ajaxGroupMembers.asp?page=1&gmt=G','bPanelContent');
		break;
	case 'bp9':
		document.getElementById('bPanelTitle').firstChild.nodeValue='Block List';
		if (jsKeyOwner == 'True'){ 
			document.getElementById('bPanelButton').style.display = "none";
		}else{
			document.getElementById('bPanelButton').style.display = "none";
		}
		document['bPanelImg'].src = 'images/interface/orbGroup.png';
		document['bPanelImg'].style.margin = '0px 0px 0px 2px';
		ajaxLoad('/scripts/asp/ajaxBlocked.asp?page=1&bet=d','bPanelContent');
		break;
	case 'bp10':
		document.getElementById('bPanelTitle').firstChild.nodeValue='Search results for pets';
		document.getElementById('bPanelButton').style.display = "none";
		changeText('mainBlockTitle', 'Searching the PetCompare Community for pets');
		searchClick('pets')
		document['bPanelImg'].src = 'images/interface/orbSearch.png';
		document['bPanelImg'].style.margin = '0px 0px 0px 2px';
		document.getElementById('addPetCategory').value = 'All';
		document.getElementById('addPetCategory').disabled = false;
		gCategory = 'pets';
		ajaxPost('/scripts/asp/ajaxControls.asp?page=1','categoryDropdown','ajc=ddc');
		if (strVar == "new"){
			ajaxLoad('/scripts/asp/ajaxSearch.asp?search=pets&page=1','bPanelContent');
		}else{
			ajaxLoad('/scripts/asp/ajaxSearch.asp?search=pets','bPanelContent');
		}
		break;
	case 'bp11':
		document.getElementById('bPanelTitle').firstChild.nodeValue='Search results for people';
		document.getElementById('bPanelButton').style.display = "none";
		changeText('mainBlockTitle', 'Searching the PetCompare Community for people');
		searchClick('people')
		document['bPanelImg'].src = 'images/interface/orbSearch.png';
		document['bPanelImg'].style.margin = '0px 0px 0px 2px';
		document.getElementById('addPetCategory').value = 'All';
		document.getElementById('addPetCategory').disabled = true;
		gCategory = 'people';
		ajaxPost('/scripts/asp/ajaxControls.asp?page=1','categoryDropdown','ajc=ddc');
		if (strVar == "new"){		
			ajaxLoad('/scripts/asp/ajaxSearch.asp?search=people&page=1','bPanelContent');
		}else{
			ajaxLoad('/scripts/asp/ajaxSearch.asp?search=people','bPanelContent');
		}
		break;
	case 'bp12':
		document.getElementById('bPanelTitle').firstChild.nodeValue='Search results for groups';
		document.getElementById('bPanelButton').style.display = "none";
		changeText('mainBlockTitle', 'Searching the PetCompare Community for groups');
		searchClick('groups')
		document['bPanelImg'].src = 'images/interface/orbSearch.png';
		document['bPanelImg'].style.margin = '0px 0px 0px 2px';
		document.getElementById('addPetCategory').value = 'All';
		document.getElementById('addPetCategory').disabled = false;
		gCategory = 'groups';
		ajaxPost('/scripts/asp/ajaxControls.asp?page=1','categoryDropdown','ajc=ddc');
		if (strVar == "new"){
			ajaxLoad('/scripts/asp/ajaxSearch.asp?search=groups&page=1','bPanelContent');
		}else{
			ajaxLoad('/scripts/asp/ajaxSearch.asp?search=groups','bPanelContent');
		}
		break;
	case 'bp13':
		document.getElementById('bPanelTitle').firstChild.nodeValue='Search results for businesses';
		document.getElementById('bPanelButton').style.display = "none";
		changeText('mainBlockTitle', 'Searching the PetCompare Community for businesses');
		searchClick('businesses')
		document['bPanelImg'].src = 'images/interface/orbSearch.png';
		document['bPanelImg'].style.margin = '0px 0px 0px 2px';
		document.getElementById('addPetCategory').value = 'All';
		document.getElementById('addPetCategory').disabled = false;
		gCategory = 'businesses';
		ajaxPost('/scripts/asp/ajaxControls.asp?page=1','categoryDropdown','ajc=ddb');
		if (strVar == "new"){
			ajaxLoad('/scripts/asp/ajaxSearch.asp?search=businesses&page=1','bPanelContent');
		}else{
			ajaxLoad('/scripts/asp/ajaxSearch.asp?search=businesses','bPanelContent');
		}
		break;
	case 'bp14':
		document.getElementById('bPanelTitle').firstChild.nodeValue='Create New Event';
		if (jsKeyOwner == 'True'){ 
			document.getElementById('bPanelButton').style.display = "none";
		}else{
			document.getElementById('bPanelButton').style.display = "none";
		}
		document['bPanelImg'].src = 'images/interface/orbCalendar.png';
		document['bPanelImg'].style.margin = '0px 0px 0px 2px';
		ajaxLoad('/scripts/asp/ajaxEventsEdit.asp?page=1&e=n','bPanelContent');
		break;
	case 'bp77':
		document.getElementById('bPanelTitle').firstChild.nodeValue='Manage lists';
		if (jsKeyOwner == 'True'){ 
			document.getElementById('bPanelButton').style.display = "none";
		}else{
			document.getElementById('bPanelButton').style.display = "none";
		}
		document['bPanelImg'].src = 'images/interface/orbHeart.png';
		document['bPanelImg'].style.margin = '0px 0px 0px 2px';
		ajaxLoad('/scripts/asp/ajaxLists.asp?page=1&vu=1','bPanelContent');
		break;
	case 'bp78':
		document.getElementById('bPanelTitle').firstChild.nodeValue='Manage emails';
		if (jsKeyOwner == 'True'){ 
			document.getElementById('bPanelButton').style.display = "none";
		}else{
			document.getElementById('bPanelButton').style.display = "none";
		}
		document['bPanelImg'].src = 'images/interface/orbHeart.png';
		document['bPanelImg'].style.margin = '0px 0px 0px 2px';
		ajaxLoad('/scripts/asp/ajaxEmail.asp?page=1&vu=1','bPanelContent');
		break;
	default:
		document.getElementById('bPanelTitle').firstChild.nodeValue='An error has occured';
		document.getElementById('bPanelButton').style.display = "none";
		document['bPanelImg'].src = 'images/interface/interestIcon.png';
		ajaxLoad('/scripts/asp/ajaxError.asp?page=1','bPanelContent');
	}
} //end of setup bigPanel

var previousTab = window.location.hash.substring(1,5) //on refesh nav to default tab

function setupTabPanel(tabFocus,strVar){
if (tabFocus != window.location.hash.substring(1,6)){previousTab = window.location.hash.substring(1,6);};
window.location.hash = tabFocus;
switch(tabFocus)
{
	case 'tab2':
		document.getElementById('tPanelTitle').firstChild.nodeValue='View Profile';
		if (jsKeyOwner == 'True'){ 
			document.getElementById('newTab').firstChild.nodeValue='edit profile';
			document.getElementById('newTab').onclick=function(){setupBigPanel('bp6'); changePanel('bigPanel','tabPanel');};
			document.getElementById('addButtonImage').className='addButton';
			document.getElementById('newTabs').style.display = "block";
		}else{
			document.getElementById('newTabs').style.display = "none";
		}
		document['tPanelImg'].src = 'images/interface/orbProfile.png';
		document['tPanelImg'].style.margin = '0px 0px 0px 2px';
		ajaxLoad('/scripts/asp/ajaxProfile.asp?page=1','tPanelContent');
		break;
	case 'tab3':
		document.getElementById('tPanelTitle').firstChild.nodeValue='Events';
		if (jsKeyOwner == 'True'){ 
			document.getElementById('newTab').firstChild.nodeValue='add event';
			document.getElementById('newTab').onclick=function(){setupBigPanel('bp14'); changePanel('bigPanel','tabPanel');};
			document.getElementById('addButtonImage').className='addButton';
			document.getElementById('newTabs').style.display = "block";
		}else{
			document.getElementById('newTabs').style.display = "none";
		}
		document['tPanelImg'].src = 'images/interface/orbCalendar.png';
		document['tPanelImg'].style.margin = '0px 0px 0px 2px';
		ajaxLoad('/scripts/asp/ajaxEvents.asp?page=1&bpEt=H','tPanelContent');
		break;
	case 'tab4':
		document.getElementById('tPanelTitle').firstChild.nodeValue='View Comments';
		document.getElementById('newTab').firstChild.nodeValue='add comment';
		document.getElementById('newTab').onclick=function(){document.addComments.addComment.focus();};
		document.getElementById('addButtonImage').className='addButton';
		document.getElementById('newTabs').style.display = "block";
		document['tPanelImg'].src = 'images/interface/orbComment.png';
		document['tPanelImg'].style.margin = '0px 0px 0px 2px';
		ajaxLoad('/scripts/asp/ajaxComments.asp?page=1&comm=C','tPanelContent');
		break;
	case 'tab5':
		document.getElementById('tPanelTitle').firstChild.nodeValue='New Messages';
		if (jsKeyOwner == 'True'){ 
			document.getElementById('newTab').firstChild.nodeValue='new message';
			document.getElementById('newTab').onclick=function(){setupTabPanel('tab5c');};
			document.getElementById('addButtonImage').className='addButton';
			document.getElementById('newTabs').style.display = "block";
		}else{
			document.getElementById('newTabs').style.display = "none";
		}
		document['tPanelImg'].src = 'images/interface/orbEnvelope.png';
		document['tPanelImg'].style.margin = '0px 0px 0px 2px';
		ajaxLoad('/scripts/asp/ajaxMessages.asp?page=1&mt=i','tPanelContent');
		break;
	case 'tab5c':
		document.getElementById('tPanelTitle').firstChild.nodeValue='Create New Message';
		if (jsKeyOwner == 'True'){ 
			document.getElementById('newTab').firstChild.nodeValue='abandon message';
			document.getElementById('newTab').onclick=function(){tabPanelPreviousPage(previousTab);};
			document.getElementById('addButtonImage').className='closeButton';
			document.getElementById('newTabs').style.display = "block";
		}else{
			document.getElementById('newTabs').style.display = "none";
		}
		document['tPanelImg'].src = 'images/interface/orbEnvelope.png';
		document['tPanelImg'].style.margin = '0px 0px 0px 2px';
		ajaxLoad('/scripts/asp/ajaxMessagesNew.asp?page=1&mt=w','tPanelContent');
		break;
	case 'tab5n':
		document.getElementById('tPanelTitle').firstChild.nodeValue='New Messages';
		if (jsKeyOwner == 'True'){
			document.getElementById('newTab').firstChild.nodeValue='new message';
			document.getElementById('newTab').onclick=function(){setupTabPanel('tab5c');};
			document.getElementById('addButtonImage').className='addButton';
			document.getElementById('newTabs').style.display = "block";
		}else{
			document.getElementById('newTabs').style.display = "none";
		}
		document['tPanelImg'].src = 'images/interface/orbEnvelope.png';
		document['tPanelImg'].style.margin = '0px 0px 0px 2px';
		ajaxLoad('/scripts/asp/ajaxMessages.asp?page=1&mt=n','tPanelContent');
		changeHash('n');
		break;
	case 'tab5i': 
		document.getElementById('tPanelTitle').firstChild.nodeValue='Message Mailbox';
		if (jsKeyOwner == 'True'){
			document.getElementById('newTab').firstChild.nodeValue='new message';
			document.getElementById('newTab').onclick=function(){setupTabPanel('tab5c');};
			document.getElementById('addButtonImage').className='addButton';
			document.getElementById('newTabs').style.display = "block";
		}else{
			document.getElementById('newTabs').style.display = "none";
		}
		document['tPanelImg'].src = 'images/interface/orbEnvelope.png';
		document['tPanelImg'].style.margin = '0px 0px 0px 2px';
		ajaxLoad('/scripts/asp/ajaxMessages.asp?page=1&mt=i','tPanelContent');
		changeHash('i');
		break;
	case 'tab5d':
		document.getElementById('tPanelTitle').firstChild.nodeValue='Deleted Messages';
		if (jsKeyOwner == 'True'){
			document.getElementById('newTab').firstChild.nodeValue='new message';
			document.getElementById('newTab').onclick=function(){setupTabPanel('tab5c');};
			document.getElementById('addButtonImage').className='addButton';
			document.getElementById('newTabs').style.display = "block";
		}else{
			document.getElementById('newTabs').style.display = "none";
		}
		document['tPanelImg'].src = 'images/interface/orbEnvelope.png';
		document['tPanelImg'].style.margin = '0px 0px 0px 2px';
		ajaxLoad('/scripts/asp/ajaxMessages.asp?page=1&mt=d','tPanelContent');
		changeHash('d');
		break;
	case 'tab5v':
		document.getElementById('tPanelTitle').firstChild.nodeValue='View Message';
		if (jsKeyOwner == 'True'){
			document.getElementById('newTab').firstChild.nodeValue='close message';
			document.getElementById('newTab').onclick=function(){tabPanelPreviousPage(previousTab);};
			document.getElementById('addButtonImage').className='closeButton';
			document.getElementById('newTabs').style.display = "block";
		}else{
			document.getElementById('newTabs').style.display = "none";
		}
		document['tPanelImg'].src = 'images/interface/orbEnvelope.png';
		document['tPanelImg'].style.margin = '0px 0px 0px 2px';
		ajaxLoad('/scripts/asp/ajaxMessagesView.asp?item='+ strVar,'tPanelContent');
		window.location.hash = 'tab5i';
		break;
	case 'tab5e':
		document.getElementById('tPanelTitle').firstChild.nodeValue='View Deleted Message';
		if (jsKeyOwner == 'True'){
			document.getElementById('newTab').firstChild.nodeValue='close message';
			document.getElementById('newTab').onclick=function(){tabPanelPreviousPage(previousTab);}; 
			document.getElementById('addButtonImage').className='closeButton';
			document.getElementById('newTabs').style.display = "block";
		}else{
			document.getElementById('newTabs').style.display = "none";
		}
		document['tPanelImg'].src = 'images/interface/orbEnvelope.png';
		document['tPanelImg'].style.margin = '0px 0px 0px 2px';
		ajaxLoad('/scripts/asp/ajaxMessagesView.asp?item='+ strVar + '&mt=d','tPanelContent');
		window.location.hash = 'tab5d';
		break;
	case 'tab5w':
		document.getElementById('tPanelTitle').firstChild.nodeValue='New Message';
		if (jsKeyOwner == 'True'){
			document.getElementById('newTab').firstChild.nodeValue='close message';
			document.getElementById('newTab').onclick=function(){tabPanelPreviousPage(previousTab);}; 
			document.getElementById('addButtonImage').className='closeButton';
			document.getElementById('newTabs').style.display = "block";
		}else{
			document.getElementById('newTabs').style.display = "none";
		}
		document['tPanelImg'].src = 'images/interface/orbEnvelope.png';
		document['tPanelImg'].style.margin = '0px 0px 0px 2px';
		ajaxLoad('/scripts/asp/ajaxMessagesNew.asp?page=1&mt=w','tPanelContent');
		changeHash('w');
		break;
	default:
		document.getElementById('tPanelTitle').firstChild.nodeValue='An error has occured';
		document.getElementById('newTabs').style.display = "none";
		document['tPanelImg'].src = 'images/interface/interestIcon.png';
		ajaxLoad('/scripts/asp/ajaxError.asp?page=1','tPanelContent');
	}
} //end of setup tabPanel

function tabPanelPreviousPage(tab){
setupTabPanel(tab)
}

function setupFloatPanel(floatFocus,strVar1, strVar2, strVar3){

		document.getElementById('fPanelBtnPanel').style.display = 'block';
switch(floatFocus)
{
	case 'Terms':
		document.getElementById('fPanelContent').className='fPanelContentScroll';
		document.getElementById('fPanel').className='fPanelLrg';
		document.getElementById('fPanelTitle').firstChild.nodeValue='Terms of Use';
		document.getElementById('fPanelBtnPanel').style.display = 'none';
		hideshowPanel('fPanel');
		ajaxLoad('/scripts/asp/ajaxTermsOfUse.asp?page=1' + strVar1,'fPanelContent');
		break;
	case 'TermsEnh':
		document.getElementById('fPanelContent').className='fPanelContentScroll';
		document.getElementById('fPanel').className='fPanelLrg';
		document.getElementById('fPanelTitle').firstChild.nodeValue='Terms of Use For Enhanced Listings';
		document.getElementById('fPanelBtnPanel').style.display = 'none';
		hideshowPanel('fPanel');
		ajaxLoad('/scripts/asp/ajaxTermsOfUseEnh.asp?page=1','fPanelContent');
		break;
	case 'addPet':
		document.getElementById('fPanelTitle').firstChild.nodeValue='Register a Pet with PetCompare';
		document.getElementById('fPanelContent').className='fPanelContentMedSml';
		document.getElementById('fPanel').className='fPanelMedSml';
		document.getElementById('fPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('fPanelBtn1').onclick=function(){hideshowPanel('fPanel');}; 
		document.getElementById('fPanelBtn2').firstChild.nodeValue='Register';
		document.getElementById('fPanelBtn2').onclick=function(){if (validateAddPetForm() == true){ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1','ajc=ap&pn=' + escape(document.getElementById('addPetName').value) + '&pg=' + document.getElementById('addPetGender').value + '&pc=' + escape(document.getElementById('addPetCategory').value) + '&pb=' + escape(document.getElementById('ajaxPetBreed').value) + '&pt=' + escape(document.getElementById('addPetTagline').value)); hideshowPanel('fPanel'); updatePetElements();};};
		hideshowPanel('fPanel');
		ajaxLoad('/scripts/asp/ajaxAddPet.asp?page=1','fPanelContent');
		break;
	case 'addGroup':
		document.getElementById('fPanelTitle').firstChild.nodeValue='Create a new group with PetCompare';
		document.getElementById('fPanelContent').className='fPanelContentAuto';
		document.getElementById('fPanel').className='fPanel';
		document.getElementById('fPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('fPanelBtn1').onclick=function(){hideshowPanel('fPanel');}; 
		document.getElementById('fPanelBtn2').firstChild.nodeValue='Register';
		document.getElementById('fPanelBtn2').onclick=function(){if (validateAddGroupForm() == true){ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1','ajc=ag&gn=' + escape(document.getElementById('addGroupName').value) + '&gt=' + escape(document.getElementById('addGroupTagline').value) + '&gc=' + escape(document.getElementById('addGroupCategory').value) + '&gb=' + escape(document.getElementById('ajaxPetBreed').value) + '&gp=' + returnCheckedOption('addGroupPrivacy','2')); hideshowPanel('fPanel'); setupBigPanel('bp4');};};
		hideshowPanel('fPanel');
		ajaxLoad('/scripts/asp/ajaxAddGroup.asp?page=1','fPanelContent');
		break;
	case 'signupUser':
		document.getElementById('fPanelTitle').firstChild.nodeValue='Register a new account with PetCompare';
		document.getElementById('fPanelContent').className='fPanelContentLrg';
		document.getElementById('fPanel').className='fPanelLrg';
		document.getElementById('fPanelBtnPanel').style.display = 'none';
		hideshowPanel('fPanel');
		ajaxLoad2('/scripts/asp/ajaxSignupUser.asp?page=1','fPanelContent');
		break;
	case 'signupBusiness':
		document.getElementById('fPanelTitle').firstChild.nodeValue='Register ' + strVar2 + ' with PetCompare';
		document.getElementById('fPanelContent').className='fPanelContentLrg';
		document.getElementById('fPanel').className='fPanelLrg';
		document.getElementById('fPanelBtnPanel').style.display = 'none';
		hideshowPanel('fPanel');
		ajaxLoad('/scripts/asp/ajaxSignupBusiness.asp?page=1' + strVar1,'fPanelContent');
		break;
	case 'ReportEntity':
		document.getElementById('fPanelTitle').firstChild.nodeValue='Report violation';
		document.getElementById('fPanelContent').className='fPanelContentAuto';
		document.getElementById('fPanel').className='fPanelMedMed';
		document.getElementById('fPanelBtn1').style.display = 'block';
		document.getElementById('fPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('fPanelBtn1').onclick=function(){hideshowPanel('fPanel');}; 
		document.getElementById('fPanelBtn2').firstChild.nodeValue='Send';
		document.getElementById('fPanelBtn2').onclick=function(){};
		document.getElementById('fPanelBtn2').className='zButton';
		hideshowPanel('fPanel');
		ajaxLoad('/scripts/asp/ajaxReportEntity.asp?page=1','fPanelContent');
		break;
	case 'ReportFault':
		document.getElementById('fPanelTitle').firstChild.nodeValue='Report fault on this page';
		document.getElementById('fPanelContent').className='fPanelContentAuto';
		document.getElementById('fPanel').className='fPanelMedMed';
		document.getElementById('fPanelBtn1').style.display = 'block';
		document.getElementById('fPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('fPanelBtn1').onclick=function(){hideshowPanel('fPanel');}; 
		document.getElementById('fPanelBtn2').firstChild.nodeValue='Send';
		document.getElementById('fPanelBtn2').onclick=function(){}; 
		document.getElementById('fPanelBtn2').className='zButton';
		hideshowPanel('fPanel');
		ajaxLoad('/scripts/asp/ajaxReportFault.asp?page=1','fPanelContent');
		break;
	case 'ReportMessage':
		document.getElementById('fPanelTitle').firstChild.nodeValue='Report message violation';
		document.getElementById('fPanelContent').className='fPanelContentAuto';
		document.getElementById('fPanel').className='fPanelMedMed';
		document.getElementById('fPanelBtn1').style.display = 'block';
		document.getElementById('fPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('fPanelBtn1').onclick=function(){hideshowPanel('fPanel');}; 
		document.getElementById('fPanelBtn2').firstChild.nodeValue='Send';
		document.getElementById('fPanelBtn2').onclick=function(){};
		document.getElementById('fPanelBtn2').className='zButton';
		hideshowPanel('fPanel');
		ajaxLoad('/scripts/asp/ajaxReportMessage.asp?mid=' + strVar1 + '&maid=' + strVar2 + '&maty=' + strVar3,'fPanelContent');
		break;
	case 'EditCategory':
		document.getElementById('fPanelTitle').firstChild.nodeValue='Edit Business Category';
		document.getElementById('fPanelContent').className='fPanelContentAuto';
		document.getElementById('fPanel').className='fPanelSml';
		document.getElementById('fPanelBtn1').style.display = 'block';
		document.getElementById('fPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('fPanelBtn1').onclick=function(){hideshowPanel('fPanel');}; 
		document.getElementById('fPanelBtn2').firstChild.nodeValue='Save';
		document.getElementById('fPanelBtn2').onclick=function(){}; 
		document.getElementById('fPanelBtn2').className='zButton';
		hideshowPanel('fPanel');
		ajaxLoad('/scripts/asp/ajaxBusinessCategory.asp?cct=' + escape(strVar1),'fPanelContent');
		returnTickedStars('feature',9,'featureRating');
		break;
	case 'EditContacts':
		document.getElementById('fPanelTitle').firstChild.nodeValue='Business Contacts';
		document.getElementById('fPanelContent').className='fPanelContentLrg';
		document.getElementById('fPanel').className='fPanelLrg';
		document.getElementById('fPanelBtnPanel').style.display = 'none';
		hideshowPanel('fPanel');
		ajaxLoad('/scripts/asp/ajaxBusinessContacts.asp?ld=1','fPanelContent');
		break;
	case 'recGroup':
		document.getElementById('fPanelTitle').firstChild.nodeValue='Reccomend a Group';
		document.getElementById('fPanelContent').className='fPanelContentMedLon';
		document.getElementById('fPanel').className='fPanelMedLon';
		document.getElementById('fPanelBtnPanel').style.display = 'none';
		hideshowPanel('fPanel');
		ajaxLoad('/scripts/asp/ajaxReccomendGroup.asp?page=1&cg=1','fPanelContent');
		break;
	case 'changePw':
		document.getElementById('fPanelTitle').firstChild.nodeValue='Change password';
		document.getElementById('fPanelBtnPanel').style.display = 'none';
		document.getElementById('fPanelContent').className='fPanelContentMin';
		document.getElementById('fPanel').className='fPanelMin';
		hideshowPanel('fPanel');
		ajaxLoad('/scripts/asp/ajaxChangePw.asp?page=1' + strVar1,'fPanelContent');
		break;
	case 'FAQ':
		document.getElementById('fPanel').className='fPanel';
		document.getElementById('fPanelTitle').firstChild.nodeValue='FAQ - Frequently asked questions';
		document.getElementById('fPanelContent').className='fPanelContentScroll';
		document.getElementById('fPanelBtn1').style.display = 'none';
		document.getElementById('fPanelBtn2').firstChild.nodeValue='Close';
		document.getElementById('fPanelBtn2').onclick=function(){hideshowPanel('fPanel');};
		document.getElementById('fPanelBtn2').className='cButton';
		hideshowPanel('fPanel');
		ajaxLoad('/scripts/asp/pageHelp.asp?page=1','fPanelContent');
		break;
	default:
		document.getElementById('fPanel').className='fPanel';
		document.getElementById('fPanelTitle').firstChild.nodeValue='An error has occured';
		document.getElementById('fPanelContent').className='fPanelContentAuto';
		document.getElementById('fPanelBtn1').style.display = 'none';
		document.getElementById('fPanelBtn2').style.display = 'block';
		document.getElementById('fPanelBtn2').firstChild.nodeValue='Close';
		document.getElementById('fPanelBtn2').className='cButton';
		document.getElementById('fPanelBtn2').onclick=function(){hideshowPanel('fPanel');};
		hideshowPanel('fPanel');
		ajaxLoad('/scripts/asp/ajaxError.asp?page=1','fPanelContent');
}
} // end of setup floatPanel

function setupUploadPanel(uploadFocus,strVar1, strVar2){

switch(uploadFocus)
{
	case 'Profile':
		document.getElementById('uPanelTitle').firstChild.nodeValue='Upload Profile Picture';
		document.getElementById('uPanelBtn1').style.display = "none";
		document.getElementById('uPanelBtn2').firstChild.nodeValue='Close';
		document.getElementById('uPanelBtn2').onclick=function(){location.reload(true);};
		hideshowPanel('uPanel');
		ajaxLoad('/scripts/asp/ajaxProfileUpload.asp?page=1','uPanelContent');
		break;
	case 'Gallery':
		document.getElementById('uPanelTitle').firstChild.nodeValue='Upload Gallery Pictures';
		document.getElementById('uPanelBtn1').style.display = "none";
		document.getElementById('uPanelBtn2').firstChild.nodeValue='Close';
		document.getElementById('uPanelBtn2').onclick=function(){location.reload(true);};
		hideshowPanel('uPanel');
		ajaxLoad('/scripts/asp/ajaxGalleryUpload.asp?album=' + strVar1,'uPanelContent');
		break;
	default:
		document.getElementById('uPanelTitle').firstChild.nodeValue='An error has occured';
		hideshowPanel('uPanel');
		ajaxLoad('/scripts/asp/ajaxError.asp?page=1','fPanelContent');
}
} // end of setup uploadPanel

function setupDialogPanel(dialogFocus,strVar1,strVar2,strVar3,strVar4){
//default
document.getElementById('dPanelBtn1').style.display = 'block';
switch(dialogFocus)
{
	case 'remComment':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Confirm comment deletion';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');}; 
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Confim';
		document.getElementById('dPanelBtn2').onclick=function(){ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1',''+ strVar1 +''); Effect.Squish(''+ strVar2 +''); hideshowPanel('dPanel');}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=remComment');
		hideshowPanel('dPanel');
		break;
	case 'remReply':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Confirm reply deletion';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');}; 
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Confirm';
		document.getElementById('dPanelBtn2').onclick=function(){ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1',''+ strVar1 +''); Effect.toggle(''+ strVar2 +'', 'appear'); hideshowPanel('dPanel');}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=remReply');
		hideshowPanel('dPanel');
		break;
	case 'remMessage':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Confirm message deletion';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');}; 
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Confirm';
		document.getElementById('dPanelBtn2').onclick=function(){ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1',''+ strVar1 +''); Effect.Squish(''+ strVar2 +''); hideshowPanel('dPanel'); setTimeout("ajaxRequest('/scripts/asp/ajaxCounts.asp?ajc=cm','mcPanelContent',false);",1000);}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=remMessage');
		hideshowPanel('dPanel');
		break;
	case 'remMessageView':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Confirm message deletion';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');}; 
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Confirm';
		document.getElementById('dPanelBtn2').onclick=function(){ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1',''+ strVar1 +''); hideshowPanel('dPanel'); tabPanelPreviousPage('tab5');}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=remMessageView');	
		hideshowPanel('dPanel');
		break;
	case 'unDeleteMessage':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Confirm message undelete';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');}; 
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Confirm';
		document.getElementById('dPanelBtn2').onclick=function(){ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1',''+ strVar1 +''); Effect.Squish(''+ strVar2 +''); hideshowPanel('dPanel'); tabPanelPreviousPage('tab5');}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=unDeleteMessage');	
		hideshowPanel('dPanel');
		break;
	case 'markUnreadMessage':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Confirm mark message unread';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');}; 
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Confirm';
		document.getElementById('dPanelBtn2').onclick=function(){ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1',''+ strVar1 +''); hideshowPanel('dPanel'); document['mailIco'].src = 'images/interface/unreadMailIcon.png'; updateEntityCounts();}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=markUnreadMessage');	
		hideshowPanel('dPanel');
		break;
	case 'permDeleteMessage':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Confirm permanent message deletion';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');}; 
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Confirm';
		document.getElementById('dPanelBtn2').onclick=function(){ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1',''+ strVar1 +''); hideshowPanel('dPanel'); tabPanelPreviousPage('tab5');}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=permDeleteMessage');
		hideshowPanel('dPanel');
		break;
	case 'remCompanion':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Confirm companion removal';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');}; 
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Confirm';
		document.getElementById('dPanelBtn2').onclick=function(){ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1',''+ strVar1 +''); hideshowPanel('dPanel');updateBrowseElements()}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=remCompanion');
		hideshowPanel('dPanel');
		break;
	case 'blockEntity':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Confirm block';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');}; 
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Confirm';
		document.getElementById('dPanelBtn2').onclick=function(){ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1','' + strVar1 + ''); hideshowPanel('dPanel');updateBrowseElements()}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=blockEntity');
		hideshowPanel('dPanel');
		break;
	case 'blockGroup':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Confirm block';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');}; 
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Confirm';
		document.getElementById('dPanelBtn2').onclick=function(){ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1','' + strVar1 + ''); hideshowPanel('dPanel');updateBrowseElements()}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=blockGroup');
		hideshowPanel('dPanel');
		break;
	case 'UnblockGroup':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Confirm unblock';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');}; 
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Confirm';
		document.getElementById('dPanelBtn2').onclick=function(){ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1','' + strVar1 + ''); hideshowPanel('dPanel');updateBrowseElements()}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=UnblockGroup');
		hideshowPanel('dPanel');
		break;
	case 'unblockEntity':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Confirm unblock';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');}; 
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Confirm';
		document.getElementById('dPanelBtn2').onclick=function(){ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1','' + strVar1 + ''); hideshowPanel('dPanel');updateBrowseElements()}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=UnblockGroup');
		hideshowPanel('dPanel');
		break;
	case 'changePetStatus':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Change status';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');}; 
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Confirm';
		document.getElementById('dPanelBtn2').onclick=function(){ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1','' + strVar1 + '&ps=' + document.getElementById('status').value + ''); hideshowPanel('dPanel');updateBrowseElements();}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=changePetStatus');
		hideshowPanel('dPanel');
		break;
	case 'sendRequest':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Send companion request';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');}; 
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Confirm';
		document.getElementById('dPanelBtn2').onclick=function(){ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1','' + strVar1 + ''); hideshowPanel('dPanel');updateBrowseElements();}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=sendRequest');
		hideshowPanel('dPanel');
		break;
	case 'acceptInvite':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Accept companion invite';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');}; 
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Confirm';
		document.getElementById('dPanelBtn2').onclick=function(){ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1','' + strVar1 + ''); hideshowPanel('dPanel');updateBrowseElements();}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=acceptInvite');
		hideshowPanel('dPanel');
		break;
	case 'declineInvite':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Decline companion invite';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');}; 
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Decline';
		document.getElementById('dPanelBtn2').onclick=function(){ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1','' + strVar1 + ''); hideshowPanel('dPanel');updateBrowseElements();}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=declineInvite');
		hideshowPanel('dPanel');
		break;
	case 'levGroup':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Confirm leave group';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');}; 
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Confirm';
		document.getElementById('dPanelBtn2').onclick=function(){ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1',''+ strVar1 +''); hideshowPanel('dPanel');updateBrowseElements()}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=levGroup');
		hideshowPanel('dPanel');
		break;
	case 'changeGroupStatus':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Change status';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');}; 
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Confirm';
		document.getElementById('dPanelBtn2').onclick=function(){ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1',''+ strVar1 + '&gs=' + document.getElementById('status').value + ''); hideshowPanel('dPanel');updateBrowseElements()}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=changeGroupStatus');
		hideshowPanel('dPanel');
		break;
	case 'changeGroupStatusTrash':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Change status';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');}; 
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Confirm';
		document.getElementById('dPanelBtn2').onclick=function(){ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1',''+ strVar1 + '&gs=' + document.getElementById('status').value + ''); hideshowPanel('dPanel');updateBrowseElements()}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=changeGroupStatusTrash');
		hideshowPanel('dPanel');
		break;
	case 'acceptGroupInvite':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Accept group invite';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');}; 
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Confirm';
		document.getElementById('dPanelBtn2').onclick=function(){ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1','' + strVar1 + ''); hideshowPanel('dPanel');updateBrowseElements();}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=acceptGroupInvite');
		hideshowPanel('dPanel');
		break;
	case 'declineGroupInvite':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Decline group invite';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');};
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Decline';
		document.getElementById('dPanelBtn2').onclick=function(){ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1','' + strVar1 + ''); hideshowPanel('dPanel');updateBrowseElements();}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=declineGroupInvite');
		hideshowPanel('dPanel');
		break;
	case 'sendGroupRequest':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Send membership request';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');}; 
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Confirm';
		document.getElementById('dPanelBtn2').onclick=function(){ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1','' + strVar1 + ''); hideshowPanel('dPanel');updateBrowseElements();}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=sendGroupRequest');
		hideshowPanel('dPanel');
		break;
	case 'removeCategory':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Remove business category';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');}; 
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Confirm';
		document.getElementById('dPanelBtn2').onclick=function(){ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1','' + strVar1 + ''); hideshowPanel('dPanel'); ajaxLoad('/scripts/asp/conBusinessFeatures.asp?Page=1','features'); ajaxLoad2('/scripts/asp/conBusinessFeaturesAdd.asp?Page=1','featuresAdd');}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=removeCategory');
		hideshowPanel('dPanel');
		break;
	case 'addBusinessCompanion':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Add business companion';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');}; 
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Confirm';
		document.getElementById('dPanelBtn2').onclick=function(){ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1','' + strVar1 + ''); hideshowPanel('dPanel');}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=addBusinessCompanion');
		hideshowPanel('dPanel');
		break;
	case 'signOut':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Sign out';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');}; 
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Confirm';
		document.getElementById('dPanelBtn2').onclick=function(){window.location.href='/scripts/asp/dataPutSignout.asp'; hideshowPanel('dPanel');}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=signOut');
		hideshowPanel('dPanel');
		break;
	case 'messageSent':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Message confirmation';
		document.getElementById('dPanelBtn1').style.display = 'none';
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Continue';
		document.getElementById('dPanelBtn2').onclick=function(){hideshowPanel('dPanel');}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=messageSent');
		hideshowPanel('dPanel');
		break;
	case 'replySent':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Message reply confirmation';
		document.getElementById('dPanelBtn1').style.display = 'none';
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Continue';
		document.getElementById('dPanelBtn2').onclick=function(){hideshowPanel('dPanel');}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=replySent');
		hideshowPanel('dPanel');
		break;
	case 'createAlbum':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Create new photo album';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');}; 
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Create';
		document.getElementById('dPanelBtn2').onclick=function(){actionDialogButton('createAlbum');}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=createAlbum');
		hideshowPanel('dPanel');
		document.albumForm.albumName.focus()
		break;
	case 'deletePhoto':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Delete photo';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');}; 
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Delete';
		document.getElementById('dPanelBtn2').onclick=function(){actionDialogButton('deletePhoto');}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=deletePhoto');
		hideshowPanel('dPanel');
		break;
	case 'deleteAlbum':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Delete photo album';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');}; 
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Delete';
		document.getElementById('dPanelBtn2').onclick=function(){actionDialogButton('deleteAlbum');}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=deleteAlbum');
		hideshowPanel('dPanel');
		break;
	case 'addCaption':
		document.getElementById('dPanelTitle').firstChild.nodeValue='Add caption';
		document.getElementById('dPanelBtn1').firstChild.nodeValue='Cancel';
		document.getElementById('dPanelBtn1').onclick=function(){hideshowPanel('dPanel');}; 
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Add';
		document.getElementById('dPanelBtn2').onclick=function(){actionDialogButton('addCaption');}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=addCaption');
		hideshowPanel('dPanel');
		document.captionForm.captionText.focus()
		break;
	default:
		document.getElementById('dPanelTitle').firstChild.nodeValue='An error has occured';
		document.getElementById('dPanelBtn1').style.display = 'none';
		document.getElementById('dPanelBtn2').style.display = 'block';
		document.getElementById('dPanelBtn2').firstChild.nodeValue='Close';
		document.getElementById('dPanelBtn2').onclick=function(){hideshowPanel('dPanel');}; 
		ajaxPost('/scripts/asp/ajaxDialogPanel.asp?page=1','dPanelContent','ajc=none');
		hideshowPanel('dPanel');
	}
} // end of setup floatPanel

function setupSearchPanel(panelFocus,strVar){

switch(panelFocus)
{
	case 'pets':
		document.getElementById('sPanelTitle').firstChild.nodeValue='Search results for pets';
		document.getElementById('sPanelButton').style.display = "none";
		changeText('mainBlockTitle', 'Searching the PetCompare Community for pets');
		searchClick('pets')
		document['sPanelImg'].src = 'images/interface/orbSearch.png';
		document['sPanelImg'].style.margin = '0px 0px 0px 2px';
		document.getElementById('addPetCategory').value = 'All';
		document.getElementById('addPetCategory').disabled = false;
		gCategory = 'pets';
		ajaxPost('/scripts/asp/ajaxControls.asp?page=1','categoryDropdown','ajc=ddc');
		if (strVar == "new"){
			ajaxLoad('/scripts/asp/ajaxSearch.asp?search=pets&page=1','sPanelContent');
		}else{
			ajaxLoad('/scripts/asp/ajaxSearch.asp?search=pets','sPanelContent');
		}
		break;
	case 'people':
		document.getElementById('sPanelTitle').firstChild.nodeValue='Search results for people';
		document.getElementById('sPanelButton').style.display = "none";
		changeText('mainBlockTitle', 'Searching the PetCompare Community for people');
		searchClick('people')
		document['sPanelImg'].src = 'images/interface/orbSearch.png';
		document['sPanelImg'].style.margin = '0px 0px 0px 2px';
		document.getElementById('addPetCategory').value = 'All';
		document.getElementById('addPetCategory').disabled = true;
		gCategory = 'people';
		ajaxPost('/scripts/asp/ajaxControls.asp?page=1','categoryDropdown','ajc=ddc');
		if (strVar == "new"){		
			ajaxLoad('/scripts/asp/ajaxSearch.asp?search=people&page=1','sPanelContent');
		}else{
			ajaxLoad('/scripts/asp/ajaxSearch.asp?search=people','sPanelContent');
		}
		break;
	case 'groups':
		document.getElementById('sPanelTitle').firstChild.nodeValue='Search results for groups';
		document.getElementById('sPanelButton').style.display = "none";
		changeText('mainBlockTitle', 'Searching the PetCompare Community for groups');
		searchClick('groups')
		document['sPanelImg'].src = 'images/interface/orbSearch.png';
		document['sPanelImg'].style.margin = '0px 0px 0px 2px';
		document.getElementById('addPetCategory').value = 'All';
		document.getElementById('addPetCategory').disabled = false;
		gCategory = 'groups';
		ajaxPost('/scripts/asp/ajaxControls.asp?page=1','categoryDropdown','ajc=ddc');
		if (strVar == "new"){
			ajaxLoad('/scripts/asp/ajaxSearch.asp?search=groups&page=1','sPanelContent');
		}else{
			ajaxLoad('/scripts/asp/ajaxSearch.asp?search=groups','sPanelContent');
		}
		break;
	case 'businesses':
		document.getElementById('sPanelTitle').firstChild.nodeValue='Search results for businesses';
		document.getElementById('sPanelButton').style.display = "none";
		changeText('mainBlockTitle', 'Searching the PetCompare Community for businesses');
		searchClick('businesses')
		document['sPanelImg'].src = 'images/interface/orbSearch.png';
		document['sPanelImg'].style.margin = '0px 0px 0px 2px';
		document.getElementById('addPetCategory').value = 'All';
		document.getElementById('addPetCategory').disabled = false;
		gCategory = 'businesses';
		ajaxPost('/scripts/asp/ajaxControls.asp?page=1','categoryDropdown','ajc=ddb');
		if (strVar == "new"){
			ajaxLoad('/scripts/asp/ajaxSearch.asp?search=businesses&page=1','sPanelContent');
		}else{
			ajaxLoad('/scripts/asp/ajaxSearch.asp?search=businesses','sPanelContent');
		}
		break;
}
}

function actionFloatButton(btnFocus,strVar1,strVar2){

switch(btnFocus)
{
	case 'actionCategories':
		document.getElementById('fPanelBtn2').onclick=function(){ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1','' + strVar1 + ''); ajaxLoad('/scripts/asp/conBusinessFeatures.asp?Page=1','features'); ajaxLoad2('/scripts/asp/conBusinessFeaturesAdd.asp?Page=1','featuresAdd'); hideshowPanel('fPanel'); }; 
		document.getElementById('fPanelBtn2').className='cButton';
		break;
	case 'actionContacts':
		document.getElementById('businessContactsBtn2').className='cButton';
		document.getElementById('businessContactsBtn2').onclick=function(){
		ajaxPost('/scripts/asp/ajaxBusinessContacts.asp?page=1','fPanelContent','ajc=ebc&cd=1&pbi='
		+ escape(document.getElementById('profileID').value) + '&pbn='  
		+ escape(document.getElementById('profileBusName').value) + '&pbt=' 
		+ escape(document.getElementById('profileTagline').value) + '&pbc=' 
		+ escape(document.getElementById('profileCountry').value) + '&pbp=' 
		+ escape(document.getElementById('profilePostcode').value) + '&pba=' 
		+ escape(document.getElementById('ajaxLocality').value) + '&pbad=' 
		+ escape(document.getElementById('profileAddress').value) + '&pbwa=' 
		+ escape(document.getElementById('profileWebsite').value) + '&pbem=' 
		+ escape(document.getElementById('profileEmail').value) + '&pbim=' 
		+ escape(document.getElementById('profileIMID').value) + '&pbit=' 
		+ escape(document.getElementById('profileIMType').value) + '&pbbn=' 
		+ escape(document.getElementById('profileBusinessNum').value) + '&pbfx=' 
		+ escape(document.getElementById('profileFax').value) + '&pbmn=' 
		+ escape(document.getElementById('profileMobileNum').value) + '&pbdc='
		+ document.getElementById('profileDisplayCountry').checked + '&pbdp='
		+ document.getElementById('profileDisplayPostcode').checked + '&pbda='
		+ document.getElementById('ajaxDisplayLocality').checked + '&pbdad='
		+ document.getElementById('profileDisplayAddress').checked + '&pbdwa='
		+ document.getElementById('profileDisplayWebsite').checked + '&pbdem='
		+ document.getElementById('profileDisplayEmail').checked + '&pbdim='
		+ document.getElementById('profileDisplayIMID').checked + '&pbdbn='
		+ document.getElementById('profileDisplayBusinessNum').checked + '&pbdfx='
		+ document.getElementById('profileDisplayFax').checked + '&pbdmn='
		+ document.getElementById('profileDisplayMobileNum').checked);};
		break;
	case 'recGroup':
		document.getElementById('group' + strVar1).onclick=function(){ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1','ajc=sgi&gid=' + strVar1 + '&oid=' + strVar2 + ''); hideshowPanel('fPanel'); updateEntityCounts();};
		break;
	case 'busSignupAgree':
		document.getElementById('agreeTerms').className='cButton';
		document.getElementById('agreeTerms').onclick=function(){
		ajaxPost('/scripts/asp/ajaxSignupBusiness.asp?page=1','fPanelContent','st=4&sb=1');};
		break;
	case 'busSignupNotAgree':
		document.getElementById('agreeTerms').className='zButton';
		document.getElementById('agreeTerms').onclick=function(){};
		break;
}
}

function actionPanelButton(btnFocus){

switch(btnFocus){
	
	case 'actionProfileEdit0':
		document.getElementById('profileEditSave').className='cButton';
		document.getElementById('profileEditSave').onclick=function(){
		ajaxPost('/scripts/asp/ajaxProfileEdit.asp?page=1','bPanelContent','cd=1&pbn='  
		+ escape(document.getElementById('profileName').value) + 
		'&pbt=' + escape(document.getElementById('profileTagline').value) + 
		'&pbc=' + escape(document.getElementById('profileCountry').value) + 
		'&pbp=' + escape(document.getElementById('profilePostcode').value) + 
		'&pbco=' + escape(document.getElementById('ajaxLocality').value) + 
		'&pbto=' + escape(document.getElementById('ajaxTown').value) + 
		'&pba=' + escape(document.getElementById('profileAddress').value) + 
		'&pbwa=' + escape(document.getElementById('profileWebsite').value) + 
		'&pbem=' + escape(document.getElementById('profileEmail').value) + 
		'&pbim=' + escape(document.getElementById('profileIMID').value) + 
		'&pbit=' + escape(document.getElementById('profileIMType').value) + 
		'&pbbn=' + escape(document.getElementById('profileBusNum').value) + 
		'&pbfx=' + escape(document.getElementById('profileFax').value) + 
		'&pbmn=' + escape(document.getElementById('profileMobile').value) + 
		'&pbdc=' + document.getElementById('profileDisplayCountry').checked + 
		'&pbdp=' + document.getElementById('profileDisplayPostcode').checked + 
		'&pbdco=' + document.getElementById('ajaxDisplayCounty').checked + 
		'&pbda=' + document.getElementById('profileDisplayAddress').checked + 
		'&pbdwa=' + document.getElementById('profileDisplayWebsite').checked + 
		'&pbdem=' + document.getElementById('profileDisplayEmail').checked + 
		'&pbdim=' + document.getElementById('profileDisplayIM').checked + 
		'&pbdbn=' + document.getElementById('profileDisplayBusNum').checked + 
		'&pbdfx=' + document.getElementById('profileDisplayFax').checked + 
		'&pbdmn=' + document.getElementById('profileDisplayMobile').checked + 
		'&pbdto=' + document.getElementById('ajaxDisplayTown').checked + 
		'&pbsa=' + document.getElementById('profileShowAbout').checked + 
		'&pbsc=' + document.getElementById('profileShowCategories').checked + 
		'&pbsph=' + document.getElementById('profileShowPhotos').checked + 
		'&pbsco=' + document.getElementById('profileShowContact').checked + 
		'&pbsm=' + document.getElementById('profileShowMap').checked + 
		'&pbwt=' + escape(document.getElementById('profileWebsiteText').value));};
		break;
		
	case 'actionProfileEdit1':
		document.getElementById('profileEditSave').className='cButton';
		document.getElementById('profileEditSave').onclick=function(){
		ajaxPost('/scripts/asp/ajaxProfileEdit.asp?page=1','bPanelContent','cd=1&pbn='  
		+ escape(document.getElementById('profileName').value) + 
		'&pbt=' + escape(document.getElementById('profileTagline').value) + 
		'&pbc=' + escape(document.getElementById('profileCountry').value) + 
		'&pbp=' + escape(document.getElementById('profilePostcode').value) + 
		'&pbco=' + escape(document.getElementById('ajaxLocality').value) + 
		'&pbto=' + escape(document.getElementById('ajaxTown').value) + 
		'&pba=' + escape(document.getElementById('profileAddress').value) + 
		'&pbwa=' + escape(document.getElementById('profileWebsite').value) + 
		'&pbem=' + escape(document.getElementById('profileEmail').value) + 
		'&pbim=' + escape(document.getElementById('profileIMID').value) + 
		'&pbit=' + escape(document.getElementById('profileIMType').value) + 
		'&pbbn=' + escape(document.getElementById('profileBusNum').value) + 
		'&pbfx=' + escape(document.getElementById('profileFax').value) + 
		'&pbmn=' + escape(document.getElementById('profileMobile').value) + 
		'&pbdc=' + document.getElementById('profileDisplayCountry').checked + 
		'&pbdp=' + document.getElementById('profileDisplayPostcode').checked + 
		'&pbdco=' + document.getElementById('ajaxDisplayCounty').checked + 
		'&pbda=' + document.getElementById('profileDisplayAddress').checked + 
		'&pbdwa=' + document.getElementById('profileDisplayWebsite').checked + 
		'&pbdem=' + document.getElementById('profileDisplayEmail').checked + 
		'&pbdim=' + document.getElementById('profileDisplayIM').checked + 
		'&pbdbn=' + document.getElementById('profileDisplayBusNum').checked + 
		'&pbdfx=' + document.getElementById('profileDisplayFax').checked + 
		'&pbdmn=' + document.getElementById('profileDisplayMobile').checked + 
		'&pbdto=' + document.getElementById('ajaxDisplayTown').checked + 
		'&pbpr=' + escape(document.getElementById('profilePrice').value) + 
		'&pbsp=' + document.getElementById('profileShowPrice').checked + 
		'&pbsa=' + document.getElementById('profileShowAbout').checked + 
		'&pbsph=' + document.getElementById('profileShowPhotos').checked + 
		'&pbsco=' + document.getElementById('profileShowContact').checked + 
		'&pbsm=' + document.getElementById('profileShowMap').checked + 
		'&pbpd=' + escape(document.getElementById('profilePriceDescription').value) + 
		'&pbwt=' + escape(document.getElementById('profileWebsiteText').value));};
		break;
		
	case 'actionLists1':
		document.getElementById('listsSubmit').className='cButton';
		document.getElementById('listsSubmit').onclick=function(){
		ajaxPost('/scripts/asp/ajaxLists.asp?page=1','bPanelContent','sp=1&pd=' + escape(document.getElementById('password').value))};
		break;
		
	case 'actionLists2':
		document.getElementById('postcodeSubmit').className='cButton';
		document.getElementById('postcodeSubmit').onclick=function(){
		ajaxPost('/scripts/asp/ajaxLists.asp?page=1','bPanelContent','ps=1&gd=1&pc=' + escape(document.getElementById('postcode').value))};
		break;
		
	case 'actionLists3':
		document.getElementById('submitChanges').className='cButton';
		document.getElementById('submitChanges').onclick=function(){
		ajaxPost('/scripts/asp/ajaxLists.asp?page=1','bPanelContent','sd=1&bid='
		+ escape(document.getElementById('businessID').value) + '&na=' 
		+ escape(document.getElementById('businessName').value) + 
		'&ad=' + escape(document.getElementById('businessAddress').value) + 
		'&to=' + escape(document.getElementById('businessTown').value) + 
		'&cu=' + escape(document.getElementById('businessCounty').value) + 
		'&po=' + escape(document.getElementById('businessPostcode').value) + 
		'&cr=' + escape(document.getElementById('businessCountry').value) + 
		'&lg=' + escape(document.getElementById('businessLongt').value) + 
		'&la=' + escape(document.getElementById('businessLat').value) + 
		'&ph=' + escape(document.getElementById('businessPhone').value) + 
		'&fx=' + escape(document.getElementById('businessFax').value) + 
		'&we=' + escape(document.getElementById('businessURL').value) + 
		'&em=' + escape(document.getElementById('businessEmail').value) + 
		'&mo=' + escape(document.getElementById('businessMobile').value))};
		break;
		
	case 'advSearchOn':
		document.getElementById('advancedFilter').className='topmenucontainertext';
		document.getElementById('searchFilter').className='cButton';
		document.getElementById('searchFilter').onclick=function(){ajaxLoad('/scripts/asp/ajaxAdvSearch.asp?page=1&cat=' + escape(document.getElementById('scategory').value) 
													+ '&sco=' + escape(document.getElementById('profileCountry').value) 
													+ '&slo=' + escape(document.getElementById('ajaxLocality').value)
													+ '&sto=' + escape(document.getElementById('ajaxTown').value)
													+ '&st=newbasic','advSearch');
													recordSearch('l');};
		ajaxRequest('scripts/asp/ajaxAdvCatFilterPanel.asp?page=1&cat=' + escape(document.getElementById('scategory').value),'advancedCatFilterPanel');
		break;
		
	case 'advSearchOff':
		document.getElementById('searchFilter').className='ztopmenucontainertext';
		document.getElementById('searchFilter').onclick=function(){};
		break;
		
	case 'advCatSearchOn':
		document.getElementById('advancedFilter').className='topmenucontainertext';
		document.getElementById('advancedFilter').onclick=function(){actionIncludeButton('advCatSearchOn');};
		break;
		
	case 'advCatSearchOff':
		document.getElementById('searchFilter').className='ztopmenucontainertext';
		document.getElementById('advancedFilter').onclick=function(){};
		document.getElementById('advancedFilter').style.display='block';
		document.getElementById('basicFilter').style.display='none';
		document.getElementById('searchFilter').style.display='block';
		document.getElementById('searchCatFilter').style.display='none';
		document.getElementById('advancedCatFilterPanel').style.display='none';
		break;
		
	case 'postCommentHome':
		document.getElementById('homeCommentLink').className='boldText';
		document.getElementById('homeVideoLink').className='boldActionLink';
		document.getElementById('addCommentsHomeVideo').style.display='none';
		document.getElementById('homeTabCommentsError').innerHTML=''
		document.getElementById('homeTabCommentsError').style.display='none'
		document.getElementById('homeTabAddVideo').value=document.getElementById('homeTabAddVideo').defaultValue;
		if (document.getElementById('addCommentsHome').addComment.value == document.getElementById('addCommentsHome').addComment.defaultValue)
		{
			document.getElementById('imgCancelH').style.display = 'none';
			document.getElementById('linkAddCH').style.display = 'none';
		}
		document.getElementById('sendCommentHome').onclick=function(){commentValidation(document.getElementById('addCommentsHome'),'homeTab');}
		break;
		
	case 'postCommentTab':
		document.getElementById('tabCommentLink').className='boldText';
		document.getElementById('tabVideoLink').className='boldActionLink';
		document.getElementById('addCommentsTabVideo').style.display='none';
		document.getElementById('commentTabCommentsError').innerHTML=''
		document.getElementById('commentTabCommentsError').style.display='none'
		document.getElementById('commentTabAddVideo').value=document.getElementById('commentTabAddVideo').defaultValue;
		if (document.getElementById('addComments').addComment.value == document.getElementById('addComments').defaultValue)
		{
			document.getElementById('imgCancel').style.display = 'none';
			document.getElementById('linkAddC').style.display = 'none';
		}
		document.getElementById('sendCommentTab').onclick=function(){commentValidation(document.getElementById('addComments'),'commentTab');}
		break;
		
	case 'manageEmailVerify':
		document.getElementById('manageEmailVerifySubmit').className='cButton';
		document.getElementById('manageEmailVerifySubmit').onclick=function(){ajaxPost('/scripts/asp/ajaxEmail.asp?page=1','bPanelContent','sp=1&pd=' + escape(document.getElementById('manageEmailPassword').value));};
		break;
		
	case 'eventEdit':
		document.getElementById('eventEditSave').className='cButton';
		document.getElementById('eventEditSave').onclick=function(){
		ajaxPost('scripts/asp/ajaxEventsEdit.asp?page=1','bPanelContent','e=c&ess=' + document.getElementById('eventShowSchedule').checked +
															'&esa=' + document.getElementById('eventShowAbout').checked +
															'&esp=' + document.getElementById('eventShowPhotos').checked +
															'&esc=' + document.getElementById('eventShowContact').checked +
															'&esm=' + document.getElementById('eventShowMap').checked +
															'&en=' + escape(document.getElementById('eventName').value) +
															'&et=' + escape(document.getElementById('eventTagline').value) +
															'&estd=' + escape(document.getElementById('eventStartDay').value) +
															'&estm=' + escape(document.getElementById('eventStartMonth').value) +
															'&esty=' + escape(document.getElementById('eventStartYear').value) +
															'&esth=' + escape(document.getElementById('eventStartHour').value) +
															'&estmi=' + escape(document.getElementById('eventStartMinute').value) +
															'&eftd=' + escape(document.getElementById('eventFinishDay').value) +
															'&eftm=' + escape(document.getElementById('eventFinishMonth').value) +
															'&efty=' + escape(document.getElementById('eventFinishYear').value) +
															'&efth=' + escape(document.getElementById('eventFinishHour').value) +
															'&eftmi=' + escape(document.getElementById('eventFinishMinute').value) +
															'&ecr=' + escape(document.getElementById('eventCountry').value) +
															'&ecrd=' + document.getElementById('eventDisplayCountry').checked +
															'&ep=' + escape(document.getElementById('eventPostcode').value) +
															'&epd=' + document.getElementById('eventDisplayPostcode').checked +
															'&eco=' + escape(document.getElementById('ajaxLocality').value) +
															'&ecod=' + document.getElementById('ajaxDisplayCounty').checked +
															'&eto=' + escape(document.getElementById('ajaxTown').value) +
															'&etod=' + document.getElementById('ajaxDisplayTown').checked +
															'&ea=' + escape(document.getElementById('eventAddress').value) +
															'&ead=' + document.getElementById('eventDisplayAddress').checked +
															'&ee=' + escape(document.getElementById('eventEmail').value) +
															'&eed=' + document.getElementById('eventDisplayEmail').checked +
															'&ew=' + escape(document.getElementById('eventWebsite').value) +
															'&ewd=' + document.getElementById('eventDisplayWebsite').checked +
															'&ewt=' + escape(document.getElementById('eventWebsiteText').value) +
															'&eph=' + escape(document.getElementById('eventBusNum').value) +
															'&ephd=' + document.getElementById('eventDisplayBusNum').checked +
															'&ef=' + escape(document.getElementById('eventFax').value) +
															'&efd=' + document.getElementById('eventDisplayFax').checked +
															'&em=' + escape(document.getElementById('eventMobile').value) +
															'&emd=' + document.getElementById('eventDisplayMobile').checked +
															'&ei=' + escape(document.getElementById('eventIMID').value) +
															'&eit=' + escape(document.getElementById('eventIMType').value) +
															'&eid=' + document.getElementById('eventDisplayIM').checked +
															'&ec=' + escape(document.getElementById('eventCategory').value) +
															'&eb=' + escape(document.getElementById('ajaxPetBreed').value) +
															'&epr=' + document.getElementById('eventPrivacy1').checked +
															'&eet=' + document.getElementById('eventID').value
															);
		}
		break;
		
	case 'eventEditProfile':
		document.getElementById('eventEditProfileSave').className='cButton';
		document.getElementById('eventEditProfileSave').onclick=function(){
		ajaxPost('scripts/asp/ajaxProfileEdit.asp?page=1','bPanelContent','e=c&ess=' + document.getElementById('eventShowSchedule').checked +
															'&esa=' + document.getElementById('eventShowAbout').checked +
															'&esp=' + document.getElementById('eventShowPhotos').checked +
															'&esc=' + document.getElementById('eventShowContact').checked +
															'&esm=' + document.getElementById('eventShowMap').checked +
															'&en=' + escape(document.getElementById('eventName').value) +
															'&et=' + escape(document.getElementById('eventTagline').value) +
															'&estd=' + escape(document.getElementById('eventStartDay').value) +
															'&estm=' + escape(document.getElementById('eventStartMonth').value) +
															'&esty=' + escape(document.getElementById('eventStartYear').value) +
															'&esth=' + escape(document.getElementById('eventStartHour').value) +
															'&estmi=' + escape(document.getElementById('eventStartMinute').value) +
															'&eftd=' + escape(document.getElementById('eventFinishDay').value) +
															'&eftm=' + escape(document.getElementById('eventFinishMonth').value) +
															'&efty=' + escape(document.getElementById('eventFinishYear').value) +
															'&efth=' + escape(document.getElementById('eventFinishHour').value) +
															'&eftmi=' + escape(document.getElementById('eventFinishMinute').value) +
															'&ecr=' + escape(document.getElementById('eventCountry').value) +
															'&ecrd=' + document.getElementById('eventDisplayCountry').checked +
															'&ep=' + escape(document.getElementById('eventPostcode').value) +
															'&epd=' + document.getElementById('eventDisplayPostcode').checked +
															'&eco=' + escape(document.getElementById('ajaxLocality').value) +
															'&ecod=' + document.getElementById('ajaxDisplayCounty').checked +
															'&eto=' + escape(document.getElementById('ajaxTown').value) +
															'&etod=' + document.getElementById('ajaxDisplayTown').checked +
															'&ea=' + escape(document.getElementById('eventAddress').value) +
															'&ead=' + document.getElementById('eventDisplayAddress').checked +
															'&ee=' + escape(document.getElementById('eventEmail').value) +
															'&eed=' + document.getElementById('eventDisplayEmail').checked +
															'&ew=' + escape(document.getElementById('eventWebsite').value) +
															'&ewd=' + document.getElementById('eventDisplayWebsite').checked +
															'&ewt=' + escape(document.getElementById('eventWebsiteText').value) +
															'&eph=' + escape(document.getElementById('eventBusNum').value) +
															'&ephd=' + document.getElementById('eventDisplayBusNum').checked +
															'&ef=' + escape(document.getElementById('eventFax').value) +
															'&efd=' + document.getElementById('eventDisplayFax').checked +
															'&em=' + escape(document.getElementById('eventMobile').value) +
															'&emd=' + document.getElementById('eventDisplayMobile').checked +
															'&ei=' + escape(document.getElementById('eventIMID').value) +
															'&eit=' + escape(document.getElementById('eventIMType').value) +
															'&eid=' + document.getElementById('eventDisplayIM').checked +
															'&ec=' + escape(document.getElementById('eventCategory').value) +
															'&eb=' + escape(document.getElementById('ajaxPetBreed').value) +
															'&epr=' + document.getElementById('eventPrivacy1').checked +
															'&eet=' + document.getElementById('eventID').value
															);
		}
		break;
}
}

function actionIncludeButton(btnFocus,strVar1,strVar2){

switch(btnFocus)
{
	case 'advCatSearchOn':
		document.getElementById('searchFilter').style.display='none'; 
		document.getElementById('advancedFilter').style.display='none'; 
		document.getElementById('basicFilter').style.display='block'; 
		document.getElementById('searchCatFilter').style.display='block'; 
		document.getElementById('advancedCatFilterPanel').style.display='block';
		document.getElementById('searchCatFilter').onclick=function(){ajaxLoad('/scripts/asp/ajaxAdvSearch.asp?page=1&cat=' + escape(document.getElementById('scategory').value) 
													+ '&sco=' + escape(document.getElementById('profileCountry').value) 
													+ '&slo=' + escape(document.getElementById('ajaxLocality').value)
													+ '&sto=' + escape(document.getElementById('ajaxTown').value)
													+ '&sf0=' + document.getElementById('catFeature0').checked
													+ '&sf1=' + document.getElementById('catFeature1').checked
													+ '&sf2=' + document.getElementById('catFeature2').checked
													+ '&sf3=' + document.getElementById('catFeature3').checked
													+ '&sf4=' + document.getElementById('catFeature4').checked
													+ '&sf5=' + document.getElementById('catFeature5').checked
													+ '&sf6=' + document.getElementById('catFeature6').checked
													+ '&sf7=' + document.getElementById('catFeature7').checked
													+ '&sf8=' + document.getElementById('catFeature8').checked
													+ '&sf9=' + document.getElementById('catFeature9').checked
													+ '&st=newfeatures','advSearch');
													recordSearch('l');};
		break;
		
	case 'advSearchOn':
		recordSearch('l');
		ajaxLoad('/scripts/asp/ajaxAdvSearch.asp?page=1&cat=' + escape(document.getElementById('scategory').value) 
													+ '&sco=' + escape(document.getElementById('profileCountry').value) 
													+ '&slo=' + escape(document.getElementById('ajaxLocality').value)
													+ '&sto=' + escape(document.getElementById('ajaxTown').value)
													+ '&st=newbasic','advSearch');
		break;
		
	case 'recommendVideoHome':
		document.getElementById('homeCommentLink').className='boldActionLink';
		document.getElementById('homeVideoLink').className='boldText';
		document.getElementById('addCommentsHomeVideo').style.display='block';
		document.getElementById('homeTabCommentsError').innerHTML=''
		document.getElementById('homeTabCommentsError').style.display='none'
		document.getElementById('homeCommentLink').onclick=function(){actionPanelButton('postCommentHome');};
		document.getElementById('sendCommentHome').onclick=function(){commentValidation(document.getElementById('addCommentsHome'),'homeTab','video');}
		break;
		
	case 'commentHomeCancel':
		document.getElementById('addCommentsHome').addComment.value = document.getElementById('addCommentsHome').addComment.defaultValue;
		document.getElementById('homeTabAddVideo').value = document.getElementById('homeTabAddVideo').defaultValue;
		document.getElementById('imgCancelH').style.display = 'none';
		document.getElementById('linkAddCH').style.display = 'none';
		resizeArea(document.getElementById('addCommentsHome').addComment);
		break;
		
	case 'recommendVideoTab':
		document.getElementById('tabCommentLink').className='boldActionLink';
		document.getElementById('tabVideoLink').className='boldText';
		document.getElementById('addCommentsTabVideo').style.display='block';
		document.getElementById('commentTabCommentsError').innerHTML=''
		document.getElementById('commentTabCommentsError').style.display='none'
		document.getElementById('tabCommentLink').onclick=function(){actionPanelButton('postCommentTab');};
		document.getElementById('sendCommentTab').onclick=function(){commentValidation(document.getElementById('addComments'),'commentTab','video');}
		break;
		
	case 'commentTabCancel':
		document.getElementById('addComments').addComment.value = document.getElementById('addComments').addComment.defaultValue;
		document.getElementById('commentTabAddVideo').value = document.getElementById('commentTabAddVideo').defaultValue;
		document.getElementById('imgCancel').style.display = 'none';
		document.getElementById('linkAddC').style.display = 'none';
		resizeArea(document.getElementById('addComments').addComment);
		break;
		
	case 'manageEmailClose':
		ajaxPost('/scripts/asp/ajaxEmail.asp?page=1','bPanelContent','cl=1');
		break;
		
	case 'manageEmailUsers':
		
		break;
		
	case 'manageEmailGroups':
		
		break;
		
	case 'manageEmailBusinesses':
		
		break;
		
	case 'manageEmailEnhanced':
		
		break;
		
	case 'articleVideo':
		ajaxLoad('/scripts/asp/ajaxArticleVideo.asp?page=1&vi=' + strVar1 + '&vf=' + strVar2,'articleVideo');
		break;
		
	case 'signup':
		ajaxLoad('/scripts/asp/ajaxSignup.asp?page=1&cd=1&fn=' + escape(document.getElementById('signupFirstName').value)
														+ '&ln=' + escape(document.getElementById('signupLastName').value)
														+ '&em=' + escape(document.getElementById('signupEmail').value)
														+ '&ce=' + escape(document.getElementById('signupConfirmEmail').value)
														+ '&pa=' + escape(document.getElementById('signupPassword').value)
														+ '&cp=' + escape(document.getElementById('signupConfirmPassword').value)
														+ '&qu=' + escape(document.getElementById('signupQuestion').value)
														+ '&an=' + escape(document.getElementById('signupAnswer').value)
														+ '&te=' + document.getElementById('signupAgree').checked
														,'signupForm');
		break;
		
	case 'newEvent':
		
		break;
		
	case 'cancelEvent':
		
		break;
		
	case 'newMessage':
		setupTabPanel('tab5c');
		break;
}
}

function actionDialogButton(btnFocus,strVar1,strVar2){

switch(btnFocus)
{
	case 'createAlbum':
		ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1','ajc=cab&abn=' + escape(document.getElementById('albumName').value));
		window.location = "page.asp?page=gal&album=" + escape(document.getElementById('albumName').value)
		break;
	case 'deletePhoto':
		ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1','ajc=dph&phi=' + queryString('id') + '&abn=' + queryString('album'));
		window.location = "page.asp?page=gal&album=" + queryString('album');
		break;
	case 'deleteAlbum':
		ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1','ajc=dab&abn=' + queryString('album'));
		window.location = "page.asp?page=gal";
		break;
	case 'addCaption':
		ajaxFunctions('/scripts/asp/ajaxFunctions.asp?page=1','ajc=cap&phi=' + queryString('id') + '&abn=' + queryString('album') + '&cap=' + escape(document.getElementById('captionText').value));
		location.reload(true);
		break;
}
}
