	i0 = new Image();
	i0.src = "http://behance.vo.llnwd.net/srch_overview_roll.gif";

	i1 = new Image();
	i1.src = "http://behance.vo.llnwd.net/srch_projects_roll.gif";

	i2 = new Image();
	i2.src = "http://behance.vo.llnwd.net/srch_people_roll.gif";

	i3 = new Image();
	i3.src = "http://behance.vo.llnwd.net/srch_circles_roll.gif";

	i4 = new Image();
	i4.src = "http://behance.vo.llnwd.net/srch_tips_roll.gif";

	i5= new Image();
	i5.src = "http://behance.vo.llnwd.net/srch_gigs_roll.1.gif";

	window.onload = function() {
		
		if (typeof(pickShouts) == 'function') pickShouts('inlinePane', 0);

		if ($('overview')) {
			$('overview').onmouseover = function(){
				projectsOrig = this.src;
				this.src="http://behance.vo.llnwd.net/srch_overview_roll.gif";
			}
			$('overview').onmouseout = function() {
				this.src = projectsOrig;
			}
		}
		
		if ($('projects')) {
			$('projects').onmouseover = function(){
				projectsOrig = this.src;
				this.src="http://behance.vo.llnwd.net/srch_projects_roll.gif";
			}
			$('projects').onmouseout = function() {
				this.src = projectsOrig;
			}
		}
		
		if ($('people')) {
			$('people').onmouseover = function() {
				peopleOrig = this.src;
				this.src="http://behance.vo.llnwd.net/srch_people_roll.gif";
			}
			$('people').onmouseout = function() {
				this.src = peopleOrig;
			}
		}
		
		if ($('circles')) {
			$('circles').onmouseover = function() {
				circlesOrig = this.src;
				this.src="http://behance.vo.llnwd.net/srch_circles_roll.gif";
			}
			$('circles').onmouseout = function() {
				this.src = circlesOrig;
			}
		}
		
		if ($('tips')) {
			$('tips').onmouseover = function() {
				tipsOrig = this.src;
				this.src="http://behance.vo.llnwd.net/srch_tips_roll.gif";
			}
			$('tips').onmouseout = function() {
				this.src = tipsOrig;
			}
		}
			
		if ($('gigs')) {
			$('gigs').onmouseover = function() {
				gigOrig = this.src;
				this.src="http://behance.vo.llnwd.net/srch_gigs_roll.1.gif";
			}
			$('gigs').onmouseout = function() {
				this.src = gigOrig;
			}
		}

	}
	if (typeof(pickShouts) == 'function') window.onresize = function() { pickShouts('inlinePane', 0); }
	
function advSearchSubmit() {
	var countryDropDown = $('country');
	var countryValue = countryDropDown.options[countryDropDown.selectedIndex].innerHTML;
			if(countryValue!='All Countries') var country = countryValue; 
			
	var stateORprovValue = $F('stateORprov');
			if(stateORprovValue!='State / Province') var stateORprov = stateORprovValue;
			
	var cityValue = $F('city');
			if(cityValue!='City') var city = cityValue;
	
	$('country').disable();
	$('stateORprov').disable();
	$('city').disable();
	
	if(country!=undefined || stateORprov!=undefined || city !=undefined ) {
		$('location').value = (city || '')+'|'+(stateORprov || '')+'|'+ (country || '');
	} else {
		$('location').remove();
	}
}

function changeFreeText(elm) {
	$('advanced-search').setAttribute('name', elm.value);
}

function countryChange(elm) {
	if(elm.value!="US" && elm.value!="CA" && elm.value!='All Countries') {
		$('stateORprov').disable();
	} else {
		$('stateORprov').enable();
	}
}

function stateORprovChange() {
	var params = $H({'country' : $F('country'), 'prov' : $F('stateORprov'), 'search' : 'prov'}).toQueryString();
	
	if($F('country')!='All Countries') {
	
					new Ajax.Request('/service/BC_location2.php', {
						method: 'post',
						parameters : params,
						onComplete : function(transport) {
							$('prov-list').update(transport.responseText);
						}
					});
	}
}

function cityChange() {
	var params = $H({'country' : $F('country'), 'prov' :  $F('stateORprov') ,'city' : $F('city'), 'search' : 'city'}).toQueryString();
	
	if($F('country')!='All Countries') {
			new Ajax.Request('/service/BC_location2.php', {
				method: 'post',
				parameters : params,
				onComplete : function(transport) {
					$('city-list').update(transport.responseText);
				}
			});
	}
}

function addLocationListItem(category, string) {
	var keys = {'prov' : 'stateORprov', 'city' : 'city'};
	
	$(keys[category]).value = string;
	$(category+'-list').update();
}


function selectSearch(elm) {
	
	qs = window.location.search;
	qs = new Hash( qs.toQueryParams() );
	qs.unset('page');
	qs.unset('x');
	qs.unset('y');
	
	qs.set(elm.name, elm.value);
	
	//nuke the defaults
	if(elm.value=="All Circles") 					qs.unset( "circle" ); 
	if(elm.value=="All Creative Fields") 	qs.unset( "realm" );
	if(elm.value=="Past Curators") 				qs.unset( "curator" );
	
	if(elm.name!='curator') qs.unset('curator');
	
	qs = qs.toQueryString();
	qs = qs.replace(/%2B/g, '+');
	window.location = (window.location.pathname + '?' + qs);

}

function showCurator(id) {
	new Ajax.Request('/ajax/replacements/showCurator.php?id='+id, {
		onSuccess : function(transport) {
			$('innerDIV').update(transport.responseText);
		}
	});
}
