	
	
		//alert ("javascript is loading");
	
	
	function deleteCookie(name, path, domain) {
	
	/*
		Deletes the specified cookie.
		
		name	name of the cookie
		path	path of the cookie (must be same as path used to create cookie)
		domain	domain of the cookie (must be same as domain used to create cookie)
	*/
		
	    if (getCookie(name)) {
	        document.cookie = name + "=" + 
	            ((path) ? "; path=" + path : "") +
	            ((domain) ? "; domain=" + domain : "") +
	            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
	    }
	}
	
	
	
	
	function firstFocus() {
	
		if (document.forms.length > 0) {
	
			var TForm = document.forms[0];
	
			for (i=0;i<TForm.length;i++) {
	
				if (
						(TForm.elements[i].type=="text")||
						(TForm.elements[i].type=="textarea")||
						(TForm.elements[i].type.toString().charAt(0)=="s")
																			) {
					document.forms[0].elements[i].focus();
					break;
				}
			}
		}
	}
	
	
	
	
	function focusField(em) {

		em.select();
	}
	
	
	
	
	function getCookie(name) {
	
		/**
		* Gets the value of the specified cookie.
		*
		* name  Name of the desired cookie.
		*
		* Returns a string containing value of specified cookie, or null if cookie does not exist.
		*/
	    
	    var dc = document.cookie;
	    var prefix = name + "=";
	    var begin = dc.indexOf("; " + prefix);
	    
	    if (begin == -1) {
	        begin = dc.indexOf(prefix);
	        if (begin != 0) return null;
	    } else {
	        begin += 2;
	    }
	    
	    var end = document.cookie.indexOf(";", begin);
	    
	    if (end == -1) {
	        end = dc.length;
	    }
	    
	    return unescape(dc.substring(begin + prefix.length, end));
	}
	
	
	

	function getElementsByClass(elem, classname) {
	
		classes = new Array();
		
		alltags = document.getElementsByTagName(elem);
		
			for (i=0; i<alltags.length; i++) {
			
				if (alltags[i].className == classname) {
				
					classes[classes.length] = alltags[i];
				}
			}
			
		return classes;
	}




	function prepare_elements () {
	
			//alert ("preparing elements...");
	
	//	Build rollovers for the new reviews in the list
		var review_links = getElementsByClass('a', 'review_link');
		
		for (var i=0; i< review_links.length; i++) {
			
			var the_link_id	= review_links[i].getAttribute('id');
			var the_link	= document.getElementById(the_link_id);
				
			the_link.onmouseover = function () {
			
			//	Don't declare this with var, else it won't be globally available to the onmouseout function			
					the_original_pic_src	= document.getElementById('newest_review_cover').getAttribute('src');
				
				var the_link_id_pieces		= this.getAttribute('id').split('_');
				var the_new_pic_src			= '___media/reviews/' + the_link_id_pieces[2] + 's/_page/' + the_link_id_pieces[2] + '_covers/large/' + the_link_id_pieces[4];
				
				if (the_link_id_pieces[2] != 'film') {
				
					the_new_pic_src = the_new_pic_src + '_' + the_link_id_pieces[5] + '.jpg';
				
				} else {
				
					the_new_pic_src = the_new_pic_src + '.jpg';
				}
				
				document.getElementById('newest_review_cover').setAttribute('src', the_new_pic_src);		
			}
			
			the_link.onmouseout = function () {
				
				document.getElementById('newest_review_cover').setAttribute('src', the_original_pic_src);
			}
		
		//	While we're at it, we may as well preload the graphic for the rollover
			
			var the_link_id_pieces	= the_link_id.split('_');
			
			var the_pic_src	= '___media/reviews/' + the_link_id_pieces[2] + 's/_page/' + the_link_id_pieces[2] + '_covers/large/' + the_link_id_pieces[4];
			
			if (the_link_id_pieces[2] != 'film') {
			
				the_pic_src = the_pic_src + '_' + the_link_id_pieces[5] + '.jpg';
			
			} else {
			
				the_pic_src = the_pic_src + '.jpg';
			}
			
			var preloaded_image 	= new Image();
				preloaded_image.src = the_pic_src;
	
				//alert ("Not broken...");
		}
	
	
	//	Add popups to the show pics links
		if (document.getElementById('link_show_pics')) {
			
			document.getElementById('link_show_pics').onclick = function () {
				
				window.open(this, 'showpics', 'width=800,height=660,resizable=no,scrollbars=yes');
				
				return false;
			}
		}
	
	
			//alert ('elements prepared');
	}	
	
	
	
	
	function layer_show(sel){

		var on = document.getElementById('layer_'+ll);
		var nn = document.getElementById('layer_'+sel.value);

		if(on != null){

			on.style.display = 'none';
		}

		if(nn != null){

			nn.style.display = 'block';
		}

		ll = sel.value;

		//-------

		if(Ea_z.length == 0){

			for(var j=0; j<a_z.length; j++){

				Ea_z[j] = document.getElementById('pulldown_'+a_z[j]);
			}
		}

		for(var i=0; i < a_z.length; i++){

			if(Ea_z[i] != null){

				Ea_z[i].value = '';
				Ea_z[i].selectedIndex = 0;
			}
		}
	}
	
	function layer_set(let){

		var on = document.getElementById('layer_'+ll);
		var nn = document.getElementById('layer_'+let);

		if(on != null){

			on.style.display = 'none';
		}

		if(nn != null){

			nn.style.display = 'block';
		}

		ll = let;
		var e = document.getElementById('pulldown_a_z');

		if(e != null){

			for(var i=0; i< e.options.length; i++){

				if(e.options[i].value == let){

					e.value = let;
					e.selectedIndex = i;
					return;
				}
			}
		}

		//-------

		if(Ea_z.length == 0){

			for(var j=0; j<a_z.length; j++){

				Ea_z[j] = document.getElementById('pulldown_'+a_z[j]);
			}
		}
		
		for(var i=0; i < a_z.length; i++){
		
			if(Ea_z[i] != null){
		
				Ea_z[i].value = '';
				Ea_z[i].selectedIndex = 0;
			}
		}
	}




	function layer_toggle(layer1,layer2){
	
			//alert ('toggling layer');
	
	//	If the array used to store which layers are open hasn't been created, create it
		//if (getCookie(the_open_layers) == null) {
		
			//var the_open_layers = new Array();
			//setCookie('the_open_layers_cookie', the_open_layers);
			
				//alert ("creating the_open_layers...");
		//}
		
		var l1 = document.getElementById(layer1);
		var l2 = document.getElementById(layer2);
	
		if(l1 != null){
	
			if(l1.style.display == 'none'){
	
				l1.style.display = 'block';
			
			//	Note that this layer is now open by adding to the_open_layers
				//the_open_layers = getCookie(the_open_layers);
				//the_open_layers ['layer1'] = "open"
				//setCookie('the_open_layers_cookie', the_open_layers);

	
			}else if(l1.style.display == 'block'){
	
				l1.style.display = 'none'
				
			//	Note that this layer is no longer open by deleting it from the_open_layers
				//the_open_layers = getCookie('the_open_layers_cookie');
				//delete the_open_layers ['layer1'];
				//setCookie('the_open_layers_cookie', the_open_layers);
			}
		}
	
		if(l2 != null){
	
			if(l2.style.display == 'none'){
	
				l2.style.display = 'block';
			
			//	Note that this layer is now open in the_open_layers array
				//the_open_layers = getCookie('the_open_layers_cookie');
				//the_open_layers ['layer2'] = "open"
				//setCookie('the_open_layers_cookie', the_open_layers);
	
			}else if(l2.style.display == 'block'){
	
				l2.style.display = 'none'
				
			//	Note that this layer is no longer open by deleting it from the_open_layers
				//the_open_layers = getCookie('the_open_layers_cookie');
				//delete the_open_layers ['layer2'];
				//setCookie('the_open_layers_cookie', the_open_layers);
			}
		}
	}
	
	





//	MISCELLANEOUS FUNCTIONS

	function print_page () {

		 window.print();
	}
	
	
	
	
	function select_change (sel) {

		if (Ea_z.length == 0) {

			for (var j=0; j<a_z.length; j++) {

				Ea_z[j] = document.getElementById('pulldown_'+a_z[j]);
			}
		}

		for (var i=0; i < a_z.length; i++) {

			if ('pulldown_'+a_z[i] != sel.id) {

				if (Ea_z[i] != null){

					Ea_z[i].value = '';
					Ea_z[i].selectedIndex = 0;
				}
			}
		}
	}
	
	
	
	
	function setCookie (name, value, expires, path, domain, secure) {
	
		/**
		* Sets a Cookie with the given name and value.
		*
		* name       Name of the cookie
		* value      Value of the cookie
		* [expires]  Expiration date of the cookie (default: end of current session)
		* [path]     Path where the cookie is valid (default: path of calling document)
		* [domain]   Domain where the cookie is valid
		*              (default: domain of calling document)
		* [secure]   Boolean value indicating if the cookie transmission requires a
		*              secure transmission
		*/
		
	    document.cookie= name + "=" + escape(value) +
	        ((expires) ? "; expires=" + expires.toGMTString() : "") +
	        ((path) ? "; path=" + path : "") +
	        ((domain) ? "; domain=" + domain : "") +
	        ((secure) ? "; secure" : "");
	}
		
	
	
	
	
	
//	VARIABLES

//	This is the javascsript used by the multi-level dropdown menus

	var a_z = new Array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','misc');
	var Ea_z = new Array();
	
	var ll = 'blank';
	
	
	
	
	
	
	
	
//	CODE
	window.onload = prepare_elements;
	
	
	
	
	
	
