$(function() {
$('.window').click(function() { $.fancybox({ 'speedIn': 0, 'speedOut' : 0, 'hideOnContentClick' : true, 'centerOnScroll' : true, 'type' : 'image', 'href' : '/image/'+this.title }); return false; });

$('.comment:even').css('background','#eee');
/*
$('.fileInput').change(function() {
var ID = $(this).attr('id');
var VAL = $(this).val();
$(this).parent('p').hide();

$('.removeImage').unbind('click');

$('#uploadQueue').append('<div id="queue'+ID+'"><b>'+VAL+'</b> <a class="removeImage" rel="'+ID+'">remove</a></div>');

$('.removeImage').bind('click',function() {
var REL = $(this).attr('rel');
$('#'+REL).remove();
$('#queue'+REL).remove();
});
*/

$('.copyTag').click(function() { var rel = $(this).attr('rel'); var tagValue = $('#'+rel).val(); $('.tagInput').val(tagValue); });
$('#clearTags').click(function() { $('.tagInput').val(''); });

$('.highlight').focus(function() {
var ID = $(this).attr('id');
$('.clearHighlight').css('background','transparent');
$('#highlight'+ID).css('background','#eee');
});


var filterCollapse = false;

$('#toggle').click(function() { 
var templateURL = $(this).attr('rel');
$('#expandList').slideToggle(); 
if(!filterCollapse) {
$(this).find('img').attr('src',templateURL+"/images/icons/collapse.png"); 
filterCollapse = true;
} else {
$(this).find('img').attr('src',templateURL+"/images/icons/expand.png"); 
filterCollapse = false;
}
return false;
});

$('input').val($('input').attr('rel'));


       		$('.prefill').focus(function() { 
    		    if (this.value == this.defaultValue){ 
    		    	this.value = '';
				}
				if(this.value != this.defaultValue){
	    			this.select();
	    		}
    		});
    		$('.prefill').blur(function() {
    			
    		    if ($.trim(this.value) == this.attr('rel')){
			    	this.value = (this.attr('rel') ? this.attr('rel') : '');
				}
    		});


});
