	// PopUp WIndow
	
	function soopaPop(URL, width, height, resize, scroll) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=' + scroll + ',location=0,statusbar=0,menubar=0,resizable=' + resize +',width=' + width + ',height=' + height + ',innerWidth=' + width + ',innerHeight=' + height + ',screenX=150,screenY=150,left=150,right=150');");
	}

	var currentSector = 9;
	
	function scrollContent(newSector){

		var count = 0;
		var startingX = (currentSector - 9) * 407;
		var newX = (newSector - 9) * 407;
	
		if(startingX < newX){
			while(startingX < newX){
				count = count + 0.01;			
				window.frames.screenshots.scrollBy((startingX/newX)*count,0);
				startingX+=count;
			}
		}else if(startingX > newX){
			while(startingX > newX){
				count = count + 0.01;			
				window.frames.screenshots.scrollBy(-count,0);
				startingX-=count;
			}
		}
		window.frames.screenshots.scrollTo(newX,0);
		currentSector = newSector;
	}


	function shiftRanks(form, rank, clientId){

		//rank: the new rank value
		//clientId: the client whos rank is changing
	
		var str;
		var currentClientId;

		//if the rank is currently in use then shift all >= ranks
		if(isRankBeingUsed(form,rank,clientId)){

			//go throught each form field
			for(x=0; x < form.length; x++){
			
				str = new String(form.elements[x].name);
				currentClientId = str.substring(7,str.indexOf("][rank]"));
					
				//if it is a rank form field, and the value >= rank, and it is not the field where the onchange event came from
				if(str.indexOf("[rank]") >= 0 && form.elements[x].value >= rank && currentClientId != clientId){ 
		
					form.elements[x].value = parseInt(form.elements[x].value) + 1;
					
				}
			
			}	

		}
	
	}
	
	
	
	function isRankBeingUsed(form, rank, clientId){
	
		//rank: the new rank value
		//clientId: the client whos rank is changing
	
		var str;
		var currentClientId;

		for(x=0; x < form.length; x++){
		
			str = new String(form.elements[x].name);
			currentClientId = str.substring(7,str.indexOf("][rank]"));

			if(str.indexOf("[rank]") >= 0 && form.elements[x].value == rank && currentClientId != clientId){ 

				return true;
			
			}
					
		}	

		return false;
	
	}
	
	
	// Function to 'activate' images.
	function imgOn(imgName) {
	        if (document.images) {
	            document[imgName].src = eval(imgName + "on.src");
	        }
	}
	
	// Function to 'deactivate' images.
	function imgOff(imgName) {
	        if (document.images) {
	            document[imgName].src = eval(imgName + "off.src");
	        }
	}
	
	// -->

