/**
 * @name jquery.dwcore.js
 * @author Dominik Wlazlowski
 * @description Standard operations to running jQuery (and UI based on jQuery)
 */

jQuery.fn.clearMe = function() {
	return this.each(function() {
		var value = jQuery(this).attr('value');
		
		jQuery(this).focus(function() {
		 	if (jQuery(this).attr('value') == value)
				jQuery(this).attr('value', '');
		});
		
		jQuery(this).blur(function() {			
		 	if (jQuery(this).attr('value') == '')
				jQuery(this).attr('value', value);
		});
	});
};

var jq = jQuery.noConflict();

jq(function($) {
	var URL = new String(window.location);
	
	//alert(URL);

	// Forms
	$('.error_list').each(function() {
		$(this).parent().addClass('error');
	});
	
	// Clearing inputs
	$('#header input').clearMe();

	// Markitup
	if(URL.indexOf('/forum') != -1) {
		$('#BBCode, #forum_post_body').markItUp(mySettings);
	}
})
