//
// copyright allurstuff inc. 2006-2007 (all rights reserved)
// 


var aus_tiny_icon = new GIcon();
aus_tiny_icon.image = "/static/mm_20_red.png";
aus_tiny_icon.shadow = "/static/mm_20_shadow.png";
aus_tiny_icon.iconSize = new GSize(12, 20);
aus_tiny_icon.shadowSize = new GSize(22, 20);
aus_tiny_icon.iconAnchor = new GPoint(6, 20);
aus_tiny_icon.infoWindowAnchor = new GPoint(5, 1);

var aus_cloud_icon = new GIcon();
aus_cloud_icon.image = "/static/cloud-icon.png";
aus_cloud_icon.shadow = "/static/cloud-icon-shadow.png";
aus_cloud_icon.iconSize = new GSize(28, 18);
aus_cloud_icon.shadowSize = new GSize(28, 18);
aus_cloud_icon.iconAnchor = new GPoint(14, 18);
aus_cloud_icon.infoWindowAnchor = new GPoint(5, 1);

function showMapPopup(id, latitude, longitude, top) {
	showMapPopup(id, latitude, longitude, top, 6);
}

function showMapPopup(id, latitude, longitude, top, accuracy) {

		myLightbox.startBlank(640,480);

	if (GBrowserIsCompatible()) {

		var hoverNav = document.getElementById("hoverNav");
		hoverNav.style.display='none';
		hoverNav = document.getElementById("objMapDiv");
		hoverNav.style.display='';
		hoverNav.innerHTML = "<div style='width:640px; height:480px; margin:10px;' id='hoverNavMap'></div>";
		var map = new GMap2( document.getElementById("hoverNavMap") );
		var geocoder = new GClientGeocoder();
		map.addControl(new GLargeMapControl());
		var point = new GLatLng(latitude,longitude);
		map.setCenter(point, Math.round(4+1.5*accuracy));
		var marker = new GMarker(point);
		map.addOverlay(marker);

	}
}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

function updateLatLong(f) {
	updateLatLong(f,null);
}
function updateLatLong(f,on_success) {
	var geocoder = new GClientGeocoder();
	geocoder.getLocations(
		f.location.value,
		function(response) {
			if (!response || response.Status.code != 200) {
				alert( "sorry, i couldn't locate that address. try a zip code,\n two intersecting streets and a city, etc.");
			} else {
				var place = response.Placemark[0];
				var point = new GLatLng(place.Point.coordinates[1], place.Point.coordinates[0]);
				site_js_obj.last_geolocated_point = point;
				site_js_obj.last_geolocated_accuracy = place.AddressDetails.Accuracy;
				f.location.value = place.address.toLowerCase();
				f.latitude.value = point.lat();
				f.longitude.value = point.lng();
				f.accuracy.value = place.AddressDetails.Accuracy;
				if( typeof on_success == 'function' ) on_success();
				else if( on_success!=null ) setTimeout(on_success,0);
			}
		}
	);
	return false;
}

function toggleDisplay(t, o) { return toggleDisplay(t, o, null); }
function toggleDisplay(t, o, init_func) {
	if( o.style.display == 'none' ) {
		t.innerHTML = t.innerHTML.replace(/\(off\)/g, '(on)')
		t.innerHTML = t.innerHTML.replace(/\(show\)/g, '(hide)')
		o.style.display = '';
		if( init_func ) init_func();
	}
	else {
		t.innerHTML = t.innerHTML.replace(/\(hide\)/g, '(show)')
		o.style.display = 'none';
	}
}

function show_search_as_list() {
	document.getElementById("map_container").style.display='none';
	for (i=0; i < document.styleSheets.length; i++ ) {
		if (document.styleSheets[i].title=="show_search_as_list") {
			document.styleSheets[i].disabled = false;
		}	
		if (document.styleSheets[i].title=="show_search_as_map") {
			document.styleSheets[i].disabled = true;
		}	
		if (document.styleSheets[i].title=="show_search_as_big_map") {
			document.styleSheets[i].disabled = true;
		}
	}
	site_js_obj['show_search_as_map'] = false;
	var all_posts_container = document.getElementById("all_posts_container");
	all_posts_container.style.width = '';
	all_posts_container.style.height = '';
	document.getElementById("hidden_iframe").src = "/do.set_default_search_view?search_view=list"
} 
function show_search_as_map() {
	var map_container = document.getElementById("map_container");
	map_container.style.display='';
	for (i=0; i < document.styleSheets.length; i++ ) {
		if (document.styleSheets[i].title=="show_search_as_list") {
			document.styleSheets[i].disabled = true;
		}	
		if (document.styleSheets[i].title=="show_search_as_map") {
			document.styleSheets[i].disabled = false;
		}	
		if (document.styleSheets[i].title=="show_search_as_big_map") {
			document.styleSheets[i].disabled = true;
		}
	}
	site_js_obj['show_search_as_map'] = true;
	site_js_obj['show_search_as_big_map'] = false;
	resize_stuff();
	showMap();
	document.getElementById("hidden_iframe").src = "/do.set_default_search_view?search_view=map"
} 
function show_search_as_big_map() {
	var map_container = document.getElementById("map_container");
	map_container.style.display='';
	for (i=0; i < document.styleSheets.length; i++ ) {
		if (document.styleSheets[i].title=="show_search_as_list") {
			document.styleSheets[i].disabled = true;
		}	
		if (document.styleSheets[i].title=="show_search_as_map") {
			document.styleSheets[i].disabled = true;
		}	
		if (document.styleSheets[i].title=="show_search_as_big_map") {
			document.styleSheets[i].disabled = false;
		}
	}
	showMap();
	site_js_obj['show_search_as__map'] = false;
	site_js_obj['show_search_as_big_map'] = true;
	resize_stuff();
	document.getElementById("hidden_iframe").src = "/do.set_default_search_view?search_view=big_map"
} 

function resize_stuff() {
	if( site_js_obj['show_search_as_map'] ) {
		var map_container = document.getElementById("map_container");
		var all_posts_container = document.getElementById("all_posts_container");
		var windowHeight;
		if (self.innerHeight) {	// all except Explorer
			windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) { // other Explorers
			windowHeight = document.body.clientHeight;
		}	
		
		var pos = findPos(map_container);
		map_container.style.height=(windowHeight-pos[1]-23)+'px';
		all_posts_container.style.height=(windowHeight-pos[1]-23)+'px';		
		
		var windowWidth;
		if (self.innerWidth) {	// all except Explorer
			windowWidth = self.innerWidth;
		} else 
		if (document.documentElement && document.documentElement.clientWidth) { // Explorer 6 Strict Mode
			windowWidth = document.documentElement.clientWidth;
		} else if (document.body) { // other Explorers
			windowWidth = document.body.clientWidth;
		}
		map_container.style.width=(windowWidth/2-12)+'px';
		all_posts_container.style.width=(windowWidth/2-12)+'px';
	}	
	
	if( site_js_obj['show_search_as_big_map'] ) {
		var map_container = document.getElementById("map_container");
		var all_posts_container = document.getElementById("all_posts_container");
		var windowHeight;
		if (self.innerHeight) {	// all except Explorer
			windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) { // other Explorers
			windowHeight = document.body.clientHeight;
		}	
		
		var pos = findPos(map_container);
		map_container.style.height=(windowHeight-pos[1]-23)+'px';
		
		var windowWidth;
		if (self.innerWidth) {	// all except Explorer
			windowWidth = self.innerWidth;
		} else 
		if (document.documentElement && document.documentElement.clientWidth) { // Explorer 6 Strict Mode
			windowWidth = document.documentElement.clientWidth;
		} else if (document.body) { // other Explorers
			windowWidth = document.body.clientWidth;
		}
		map_container.style.width=(windowWidth-18)+'px';
	}	
	
	if (map) { map.checkResize(); }

	// lightbox
	if( typeof myLightbox != 'undefined' ) myLightbox.resize();
}

function get_window_width() {
	var windowWidth;
	if (document.documentElement && document.documentElement.clientWidth) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
	}
	return windowWidth;
}
function get_window_height() {
	var windowHeight;
	if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowHeight = document.body.clientHeight;
	}
	return windowHeight;
}

var map
markers = {}
function createMarker( id, latitude, longitude ) {
  return createMarker( id, latitude, longitude, 8.0 );
}
function createMarker( id, latitude, longitude, accuracy ) {
  var marker = null;
  var latlng = new GLatLng( latitude, longitude );
  if( accuracy < 5 ) marker = new GMarker( latlng, aus_cloud_icon );
  else if( accuracy < 8 ) marker = new GMarker( latlng, aus_tiny_icon );
  else marker = new GMarker( latlng );
  GEvent.addListener(marker, "click", function() {
    marker.openInfoWindowHtml( document.getElementById('post_simpletitle_'+id).innerHTML, {maxWidth: 200} );
  });
  markers[id] = marker;
  return marker;
}
function showOnMap( id, latitude, longitude ) {
	if (GBrowserIsCompatible()) {
		var center = new GLatLng( latitude, longitude );
		map.panTo(center);
		markers[id].openInfoWindowHtml( document.getElementById('post_simpletitle_'+id).innerHTML, {maxWidth: 200} );
	}
}


function showPhotoHoverControls(id) {
	clearPhotoHoverControlTimeout(id);
	var img = document.getElementById("img"+id);
	var coords = findPos(img);
	var ctl = 	document.getElementById('img'+id+'ctl');
	ctl.style.display='';
	ctl.style.top = coords[1] + 'px';
	ctl.style.left = coords[0] + 'px';
}
function getPhotoIdFromUrl(url) {
	var re = new RegExp("(\\d+[.]\\d+[.]\\w+)[.]\\w+");
	var m = re.exec(url);
	return m[1];
}
hoverPhotoControlHandler = {};
function hidePhotoHoverControls(id) {
	var handler = window.setTimeout("document.getElementById('img"+id+"ctl').style.display='none';", 10);
	hoverPhotoControlHandler['img'+id+'ctl'] = handler;
}
function clearPhotoHoverControlTimeout(id) {
	clearTimeout( hoverPhotoControlHandler['img'+id+'ctl'] );
}
function deletePhoto(id, url) {
	document.getElementById('img'+url).style.display='none';
	document.getElementById('img'+url+'ctl').style.display='none';
	document.post.delete_photo_ids.value += id+",";
}



function updateRateit(v, s) {
	var o = document.getElementById('rateit');
	if( o.childNodes[0].style.cursor=='' ) return;
	for( var i=0; i<o.childNodes.length-1; ++i ) {
		if( i<Math.round(v) ) o.childNodes[i].src = "/static/rateit-star.png";
		else o.childNodes[i].src = "/static/rateit-star-gray.png";
	}
	o.childNodes[o.childNodes.length-1].innerHTML = " "+s;
}
function rateit(v) {
	var o = document.getElementById('rateit');
	for( var i=0; i<o.childNodes.length-1; ++i ) {
		o.childNodes[i].style.cursor = "";
	}
	document.getElementById('hidden_iframe').src = "/do.vote?post_id={{ post.id }}&vote="+v;
	o.childNodes[o.childNodes.length-1].innerHTML = "";
	o.title = "you have already voted";
}
function flagit(t,v) {
	var message = "are you sure you want to flag this as "+ v +"?\n(please flag honestly and accurately)";
	if( confirm(message) ) {
		document.getElementById('hidden_iframe').src = "/do.vote?post_id={{ post.id }}&"+v+"=true";
		t.value = 'flagged as '+ v;
		t.disabled = true;
	}
	t.blur();
}

function show_email_this(post_id) {
	var hoverNav = document.getElementById("hoverNav");
	hoverNav.style.display='none';
	hoverNav = document.getElementById("objMapDiv");
	hoverNav.style.display='';
	hoverNav.innerHTML = "<div id='email_this_div'><form action='/do.recommend_post' target='hidden_iframe' method='post'><table><tr><th><label>to:</label></th><td><input class='growable' name='email_to'></td></tr>"
	+"<tr><th><label>from:</label></th><td><input class='growable' name='email_from'></td></tr><tr><th><label></label></th><td><textarea "
	+"class='growable' style='height:190px' name='email_body'>hey, check out this bulletin I found on allurstuff.com!\n\n    http://allurstuff.com/post/"
	+post_id+".html\n\nttyl,\n(your name here)\n</textarea></td></tr></table><p align='center'><input type='submit' class='button' "
	+"value='send email' id='email_this_submit' onclick=\"submit_protect(this, 'sending email...')\"></p><input type='hidden' name='post_id' value='"+ post_id +"'</form></div>";

	myLightbox.startBlank(640,0);
	myLightbox.disableKeyboardNav();
}

function trim(str) { return str.replace(/^\s+|\s+$/g, ''); }

function show_ask_this(post_id) {
	var hoverNav = document.getElementById("hoverNav");
	hoverNav.style.display='none';
	hoverNav = document.getElementById("objMapDiv");
	hoverNav.style.display='';
	hoverNav.innerHTML = "<div id='email_this_div'><p align='center'>ask your question...and we'll send you an email when the seller responds.  remember this is anonymous (the seller will never see your email address), but he or she can publish your question (along with their response) at the bottom of their ad.</p><form action='/do.ask_question' target='hidden_iframe' method='post'><table>"
	+"<tr><th><label>email:</label></th><td><input class='growable' name='email_from'></td></tr><tr><th><label></label></th><td><textarea "
	+"class='growable' style='height:190px' name='question_body'></textarea></td></tr></table><p align='center'><input type='submit' class='button' "
	+"value='ask question' id='ask_this_submit' onclick=\"if( trim(this.form.question_body.value).length==0 ) { alert('did you forget to type in a question?'); return false; } else submit_protect(this, 'submitting question...')\"></p><input type='hidden' name='post_id' value='"+ post_id +"'</form></div>";

	myLightbox.startBlank(640,0);
	myLightbox.disableKeyboardNav();
}

function show_query_alert(query_id) {
	var hoverNav = document.getElementById("hoverNav");
	hoverNav.style.display='none';
	hoverNav = document.getElementById("objMapDiv");
	hoverNav.style.display='';
	hoverNav.innerHTML = "<div id='email_this_div'><p align='center'>if you give us your email address, we will automatically email you links to new posts as they come up...<br>(if they match your current search of course)</p><form action='/do.create_query_alert' target='hidden_iframe' method='post'><table>"
	+"<tr><th width='1%'><label>email:</label></th><td><input class='growable' name='email'></td></tr></table><p align='center'><input type='submit' class='button' "
	+"value='create email alert' id='query_alert_submit' onclick=\"if( trim(this.form.email.value).length==0 ) { alert('you have to type in an email address for this to work'); return false; } else submit_protect(this, 'creating alert...')\"></p><input type='hidden' name='query_id' value='"+ query_id +"'</form></div>";
	
	myLightbox.startBlank(380,0);
	myLightbox.disableKeyboardNav();
}

function submit_protect(o,m) {
	o.value=m;
	o.disabled=true;
	o.blur();
	o.form.submit();
}

function trim (str) {
	return str.replace(/^\s*|\s*$/g,'');
}

function check_for_needed_empty_row() {
	var max = get_max_row_id();
	var dataset_input_attribute_max = document.post['dataset_input_attribute_'+max];
	if( max==0 || dataset_input_attribute_max.value!='' && dataset_input_attribute_max.value!='(data type)' ) {
		add_row(max+1, null, null);
	}
}

function get_max_row_id() {
	var max=0;
	var dataset_input_array = document.post.dataset_inputs.value.split(' ');
	for( var i=0; i<dataset_input_array.length; ++i ) {
		var f = parseInt(dataset_input_array[i]);
		if( max<f && document.getElementById('dataset_tr_'+f)!=null ) max = f;
	}
	return max;
}

function del_last_row_if_empty() {
	var max = get_max_row_id();
	if( document.getElementById('dataset_tr_'+max)!=null ) {
		if( document.post['dataset_input_attribute_'+max].value=='(data type)' ) {
			if( document.post['dataset_input_value_'+max].value=='(value)' ) {
				del_row(max,false);
			}
		}
	}
}

function add_all_attributes_if_dne(attributes_str) {
	var dataset_table = document.getElementById('dataset_table');
	dataset_table.style.display = 'none';	// hiding the table while we add elements speeds things up by eliminating redraws for every new row
	dataset_table.offsetHeight;	// forces firefox to actually hide the table before we add new elements
	attributes = attributes_str.split(',');
	for( var i=0; i<attributes.length; ++i ) {
		add_row_if_dne(trim(attributes[i]),null);
	}
	dataset_table.style.display = '';
	check_for_needed_empty_row();
}

function clean_unused_attributes() {
	var dataset_input_array = document.post.dataset_inputs.value.split(' ');
	for( var i=0; i<dataset_input_array.length; ++i ) {
		var f = parseInt(dataset_input_array[i]);
		if( document.getElementById('dataset_tr_'+f)!=null ) {
			if( document.post['dataset_input_attribute_'+f].value=='(data type)' || document.post['dataset_input_value_'+f].value=='(value)' ) {
				del_row(f,false);
			}
		}
	}
	check_for_needed_empty_row();
}

function add_row_if_dne(attribute,value) {
	if( attribute==null || attribute.length==0 ) return;
	var dataset_input_array = document.post.dataset_inputs.value.split(' ');
	var dne = true;
	for( var i=0; i<dataset_input_array.length; ++i ) {
		var f = parseInt(dataset_input_array[i]);
		if( document.getElementById('dataset_tr_'+f)!=null ) {
			if( document.post['dataset_input_attribute_'+f].value.toLowerCase()==attribute.toLowerCase() ) dne = false;
		}
	}
	if( dne ) {
		del_last_row_if_empty();
		add_row(get_max_row_id()+1,attribute,value);
	}
}

function add_row(id,attribute,value) {
	attribute_color = attribute==null ? 'silver' : 'black';
	value_color = value==null ? 'silver' : 'black';
	if( attribute==null ) attribute = '';
	if( value==null ) value = '';
	var tbody = document.getElementById('dataset_tbody');
	var tr = document.createElement("TR");
	tr.id = 'dataset_tr_'+id;
	var tda = document.createElement("TD");
	tda.style.width = "15em";
	tda.innerHTML = '<input name="dataset_input_attribute_'+id+'" value="'+attribute+'" default="(data type)" onfocus="dataset_input_attribute_onfocus(this);" onblur="dataset_input_attribute_onblur(this);" style="color:'+attribute_color+';">';
	tr.appendChild(tda);
	var tdv = document.createElement("TD");
	tdv.innerHTML = '<input name="dataset_input_value_'+id+'" value="'+value+'" default="(value)" onfocus="dataset_input_value_onfocus(this);" onblur="dataset_input_value_onblur(this);" style="color:'+value_color+';">';
	tr.appendChild(tdv);
	var tdd = document.createElement("TD");
	tdd.innerHTML = '<a href="javascript:del_row('+id+',true)"><img src="/static/del.gif" border="0" alt="delete row" title="delete row" style="padding-top:2px;"></a>';
	tr.appendChild(tdd);
	tbody.appendChild(tr);
	var dataset_inputs = document.post.dataset_inputs;
	dataset_inputs.value += " "+ id;
	input_default_handler_init();
}

function del_row(id, cfner) {
	var tbody = document.getElementById('dataset_tbody');
	tbody.removeChild( document.getElementById('dataset_tr_'+id) );
	var dataset_input_array = document.post.dataset_inputs.value.split(' ');
	var new_dataset_input = '';
	for( var i=0; i<dataset_input_array.length; ++i ) {
		if( dataset_input_array[i]!=id.toString() ) new_dataset_input += ' '+dataset_input_array[i];
	}
	document.post.dataset_inputs.value = trim(new_dataset_input);
	if( cfner ) check_for_needed_empty_row();
}

function dataset_input_attribute_onfocus(o) {
	if( o.value=='(data type)' ) {
		o.value='';
		o.style.color='black';
	}
	check_for_needed_empty_row();
}

function dataset_input_attribute_onblur(o) {
	input_default_handler_onblur(o);
	check_for_needed_empty_row();
}
function dataset_input_value_onfocus(o) {
	input_default_handler_onfocus(o);
	check_for_needed_empty_row();
}

function dataset_input_value_onblur(o) {
	if( o.value=='' ) {
		o.value='(value)';
		o.style.color='gray';
	}
	check_for_needed_empty_row();
}

function select_option(s,o) {
	for( var i=0; i<s.options.length; ++i ) {
		s.options[i].selected = s.options[i].value.toLowerCase()==o.toLowerCase();
	}
}

function input_default_handler_onfocus(o) {
	var dflt = o.getAttribute('default');
	if( o.value == dflt ) {
		o.value = '';
		o.style.color = '';
	}
}

function input_default_handler_onblur(o) {
	var dflt = o.getAttribute('default');
	if( dflt!=null && dflt!='' && (o.value == dflt || o.value == '') ) {
		o.value = dflt;
		o.style.color = 'gray';
	} else {
		o.style.color = '';
	}
}

function input_default_handler_init() {
	var allInputs = document.getElementsByTagName('input');
	for( i=0; i < allInputs.length; ++i ) {
		if( allInputs[i].type=='text' ) {
			input_default_handler_onblur(allInputs[i]);
			if( allInputs[i].onfocus==null ) {
				allInputs[i].onfocus = function() { input_default_handler_onfocus(this); };
			}
			if( allInputs[i].onblur==null ) {
				allInputs[i].onblur = function() { input_default_handler_onblur(this); };
			}
		}
	}
	var allForms = document.getElementsByTagName('form');
	for( i=0; i < allForms.length; ++i ) {
		if( allForms[i].onsubmit==null ) {
			allForms[i].onsubmit = input_default_handler_onsubmit;
		}
	}
}

function input_default_handler_onsubmit() {
	var allInputs = document.getElementsByTagName('input');
	for( i=0; i < allInputs.length; ++i ) {
		if( allInputs[i].type=='text' ) {
			input_default_handler_onfocus(allInputs[i]);
		}
	}
}

function show_balloon(o) {
	var c = o.firstChild;
	var window_width = YAHOO.util.Dom.getViewportWidth();
	var openLeft = false;
	while(c){
		if( c.className=='balloon' ){
			var clientWidth = parseInt(c.style.width.substring(0, c.style.width.length-2));
			if( clientWidth + findPos(o)[0] + 32 > window_width ) {
				openLeft = true;
				c.style.left = ( findPos(o)[0] - clientWidth - 10 ) +'px';
			} else {
				c.style.left = '';
			}
			c.style.display = 'inline';
			
			var d = c.firstChild;
			if( d.className=='balloon' ) {
				if( openLeft ) {
					d.style.left = c.style.width;
					d.src = '/static/bubble_tail_left.gif';
				} else {
					d.style.left = '';
					d.src = '/static/bubble_tail.gif';
				}
			} else {
				
			}
			
		}
		c = c.nextSibling;
	}
}

function hide_balloon(o) {
	var c = o.firstChild;
	while(c){
		if( c.className=='balloon' ) c.style.display = 'none';
		c = c.nextSibling;
	}
}

function check_sub_locations(f, v) {
	for (var i=0; i < f.elements.length; i++) {
		var element = f.elements[i];
		if( element.name && element.name.substr(0,24) == 'craigslist_sub_location_' ) {
			if( element.name == 'craigslist_sub_location_'+ v) {
				element.style.display = '';
				element.disabled = false;
			} else {
				element.style.display = 'none;';
				element.disabled = true;
			}
		}
	}
}

function append_map_state_to_anchor_tag(map, a) {
	if (GBrowserIsCompatible() && map && a.href) {
		var center = map.getCenter()
		var zoom = map.getZoom()
		a.href += '&map_center='+ center.lat() +','+ center.lng() +','+ zoom;
	}
}

function enlarge_all_photos() {
	var anchors = document.getElementsByTagName('a');
	var s = '';
	for (var i=0; i<anchors.length; i++){
		var anchor = anchors[i];
		if (anchor.getAttribute('href') && (anchor.getAttribute('rel') == 'lightbox[group]')) {
			s += "<img src='"+ anchor.getAttribute('href') +"'> ";
		}
	}
	document.getElementById('enlarged_photos').innerHTML = s;
}
function shrink_all_photos() {
	document.getElementById('enlarged_photos').innerHTML = '';
}



site_js_obj = {};
