function clearInput (cssClass) {
	// Get the input field and assign it to a variable
	var focusField = $(cssClass);
	
	focusField.focus( function(){
		// Assign $(this) to a variable, allowing DOM to do less lookup
		var el = $(this);
		var val = el.val();
		
		// Using jQuery data object, check to see if value has been 
		// assigned to placeholder data object and if not it should be assigned a value.
		if (!el.data('placeholder')) {
			el.data('placeholder', val);
		}
		
		if(val === el.data('placeholder')) {
			el.val('');
		}
	});
	
	// Execute when user leaves the input field
	focusField.blur( function () {
		// Assign $(this) to a variable, allowing DOM to do less lookup
		var el = $(this);
		if (el.val() === '') {
			el.val(el.data('placeholder') || '');
		}
	});
}

function sendform(){
	formdata = $('.frm-bldr').serialize()+'&blog='+blogid+'&section='+section;
	$('#loader').show();
	$.ajax({
		type:'POST',
		url:homeuri+'modules/ajax/submit.php?id='+formid,
		data:formdata,
		success:function(msg){
			res = eval( "(" + msg + ")" );
			$('#results ul').fadeIn().html(res.MSG);
			if(res.RES=='OK' && section!='sayfalar'){
				appendComment();
				$('#results ul').fadeIn().html('<li>Comment added</li>');
				
			}
			$('#loader').hide();
			setTimeout(function(){
					
					$('#results ul').fadeOut();
			},3000);			
		}
	});
	return false;
}

function appendComment(){
	formdata = 'id='+blogid+'&section='+section;
	$.ajax({
		type:'POST',
		url:homeuri+'modules/ajax/comments.php',
		data:formdata,
		success:function(msg){
			res = eval( "(" + msg + ")" );
			if(res.RES=='OK'){
				$('#commentcontainer').append(res.MSG);
			}
		}
	});
	return false;
}
