$.DF = {
	version:	'1.0'
};


$.extend($.DF, {
	scripts: [],
	
	require: function(src) {
		if(this.scripts.indexOf(src) == -1) {
			document.write('<script language="JavaScript" type="text/javascript" src="' + src + '"></scr' + 'ipt>');
			//$('head').append($('<script language="JavaScript" type="text/javascript" src="' + src + '"></scr' + 'ipt>'));
			this.scripts.push(src);
		}
	}
});


$(document).ready(function() {
	// Special IE6 hacks
	$('dd p').each(function() {
		$(this).parents('dd').after($(this)); 
	});
	
	// to prevent downloading background images several times (in IE)
	try {
		document.execCommand('BackgroundImageCache', false, true);
	} catch (e) {}
	
	
	// Hide empty errors messages
	$('p.error:empty').each(function(index, node) {
		$(node).hide();
	});
	
	// Special style for blockUI
	$.extend($.blockUI.defaults, {
		overlayCSS:  { 
			backgroundColor:'#FFF', 
			opacity:        '0.8' 
		},
		
		fadeOut:  150
	});
	
	
	var oldsrc;
	$('img.imghover').mouseover(function() {
		oldsrc = $(this).attr('src');
        var pos = $(this).attr('src').lastIndexOf('_grey');
		var src = $(this).attr('src').slice(0, pos) + $(this).attr('src').slice(pos+5, $(this).attr('src').length);
		$(this).attr('src', src);
  }).mouseout(function(){ 
  	$(this).attr('src', oldsrc);
  });
	
	$('.sidemenu li').mouseover(function() {
			if (!$(this).hasClass('current_page_item'))
				$(this).css('background','url(/wp-content/themes/datingfactory/images/side_menu_selection.gif) left 46% no-repeat');
		}).mouseout(function(){ 
			if (!$(this).hasClass('current_page_item'))
  				$(this).css('background','none');
  	});

	$('div.featureButtons .buttonText address span#softomate_highlight_0').css('top','25px');

	$('div.archiveMenu ul li:last').addClass('lastItem');
	$('ul.commentList li:last').addClass('lastItem');
	
});
