function swip (elementInput, swipFrom, swipTo)
{
if (elementInput.value == swipFrom) elementInput.value = swipTo;
}

$(document).ready(function() {
	$('#tabs li').click(function(){				$('.tab-content').hide();		$('#'+$(this).attr('class')).show();				$('#tabs').attr('class','active-'+$(this).attr('class'));		$('#tabs span').attr('class','');		$(this).find('span').attr('class','active');	})	
	$('input.button').hover(function(){
		$(this).addClass('b_hover');
	},
	function(){
	$(this).removeClass('b_hover');
	});
	
	$('form#newsletter a.delete').click(function(){
		
		$(this).parent().attr('action',$(this).attr('href'));
		$(this).parent().submit();
		return false;
	})
	
	
	$('table:not(".clear")').each(function(i){
		$(this).find('tr:first').attr('class','head');
		$(this).attr('cellspacing','0');
		$(this).attr('cellpadding','0');
	})
	
	$('.zoom').colorbox();
	
	$('#c_form label.infield').each(function()
	{
		var label_value = $(this).text();
		var label_target = $('#'+ $(this).attr('for'));
		
		if('' === label_target.val()){
			label_target.val(label_value);
		}
		label_target.attr('title',label_value);
		$(this).hide();
		
		label_target.focus(function() {
	    	if(label_target.val() === label_target.attr('title')) {
		      label_target.setCursorPosition(0);
			  
			  label_target.css('color','black');
			  //label_target.val('');
		    }
		});
		
		label_target.keypress(function() {
	    	 label_target.css('color','black');
			if(label_target.val() === label_target.attr('title')) {
			  label_target.val('');
		    }
		});
		
		
		label_target.blur(function() {
		    label_target.css('color','#838383');
			if(label_target.val() === '') {
		      
			  label_target.val(label_target.attr('title'));
		    }
		});

	})
	
	$.fn.setCursorPosition = function(pos) {
	  this.each(function(index, elem) {
	    if (elem.setSelectionRange) {
	      elem.setSelectionRange(pos, pos);
	    } else if (elem.createTextRange) {
	      var range = elem.createTextRange();
	      range.collapse(true);
	      range.moveEnd('character', pos);
	      range.moveStart('character', pos);
	      range.select();
	    }
	  });
	  return this;
	};
});

