function searchAssociateAdmin(Url) {
	searchLoading();
	folder = document.associateViews.level.value;
	str = document.associateViews.Search.value;
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Your browser does not support AJAX!");
		return;
	} 
	var url=SITE_ADDRESS_SECURE + "associates/" + folder + "/searchsort.php";
	url=url+"?q="+str;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=searchStateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function associateBlock_on(myId,me) {
	me.className = "associateViewText_on";
}
function associateBlock_off(myId,me) {
	myValue = document.associateViews.user_id.value;
	if (myId != myValue) {
		me.className = "associateViewText";
	}
}
function setAssociate(myId,me) {
	myValue = document.associateViews.user_id.value;
	if (myValue != 0) {
		myName = "associate" + myValue;
		document.getElementById(myName).className = "associateViewText";
	}
	document.associateViews.user_id.value = myId;
	me.className = "associateViewText_on";
}
function associateHandler(myType) {
	//menuLoading();
	if (document.associateViews.user_id.value != 0 || myType == "search" || myType == "sort") {
		if (myType == "edit") {
			myValue = document.associateViews.user_id.value;
			storeElements('store/admin.php','target=associates&mode=edit&ax=true&user_id='+myValue);
		}else if (myType == "deactivate") {
			document.associateViews.mode.value = "deactivate";
			document.associateViews.action = "store/admin.php";
			if (document.associateViews.action != "") {
				document.associateViews.submit();
			}
		}else if (myType == "activate") {
			document.associateViews.mode.value = "activate";
			document.associateViews.action = "store/admin.php";
			if (document.associateViews.action != "") {
				document.associateViews.submit();
			}
		}else if (myType == "search" || myType == "sort") {
			document.associateViews.mode.value = "searchsort";
			document.associateViews.action = "store/admin.php";
			if (document.associateViews.action != "") {
				document.associateViews.submit();
			}
		}
	}else{
		alert('Please select an associate.');
	}
}
function activeIcon(myId) {
	myElement = "active" + myId;
	mySRC = document.getElementById(myElement).src;
	myPos = mySRC.lastIndexOf("/");
	myPos += 1;
	myLocation = mySRC.substring(0,myPos);
	//alert(myLocation);
	document.getElementById(myElement).src = myLocation + "active_associate.gif";
}
function inactiveIcon(myId) {
	myElement = "active" + myId;
	mySRC = document.getElementById(myElement).src;
	myPos = mySRC.lastIndexOf("/");
	myPos += 1;
	myLocation = mySRC.substring(0,myPos);
	//alert(myLocation);
	document.getElementById(myElement).src = myLocation + "inactive_associate.gif";
}