window.name="AGFMAIN";
function ShowOrg(URL){
	window.open(URL,"OrganisationDetails","toolbar=false,width=700,height=600,scrollbars=yes,resizable=yes");
}
function checkSection(){
	if (document.form2.searchsection.value == ""){
		alert("Please select a section to search");
		return false;
	} 
	if (document.form2.criteria.value == "") {
		alert("Please enter search text");
		return false;
	}
}
function sitetour() {
	var k;
	k = window.open('tour/index.cfm?language=Tlang','tour','toolbar=no,scrollbars=yes,width=738,height=497');
}
function ResettingForm(x) {
	if (confirm("Are you sure you want to reset the changes")) {
		window.location.href=x;
	}
}
function OpenWindow(x) {
	var k = window.open(x,"NewWindow","width=600,height=500,resizable=yes,scrollbars=yes");
}

function showError() {
	if(jsArrError) alert(jsStrError + jsArrError.join('- '));
}

function changeSortOrder(field, order){
	with(document.forms["search-properties"]) {
		if(searchColumn.selectedIndex==field) {
			order=searchColumnOrder.selectedIndex==1?0:1;
		}
		searchColumn.selectedIndex=field;
		searchColumnOrder.selectedIndex=order;
//		searchColumnOrder.selectedIndex=searchColumnOrder.selectedIndex==0?1:0;
		submit();
	}
}

function isRejected(status){
	if(status=="rejected"){
		alert("\n    Items that have already been rejected by AlphaGalileo cannot be edited        \n\n");
		return false;
	}
	return true;
}
function canViewContent(typeArr, userTypeId){
	
	var b=typeArr.splice(userTypeId);
	if(!b.length) {
//		alert("You must be registered to view this content");
		return true;
	}
	return true;
}
