/* #################################################
# Projekt	: Omniscope - Main Javascripts
# Stand		: 10.04.07
# Autor		: Daniel Zander, Source-Media.com
#################################################### */



$(function(){

// ---------- input filter ----------

$('input[@type=checkbox]').addClass('ckbx');


var charset = function() {
	var exp = new RegExp('([^'+ $(this).attr('charset') +']*)','g');
	$(this).attr('value', $(this).attr('value').replace(exp,''));
};
$('input[@charset]').keyup(charset).blur(charset);


// ---------- set value ----------

// set default value
$('input').each(function(){
	if (!$(this).attr('value'))
		$(this).attr('value', $(this).attr('title'));
});

// onfocus clear default
$('input').focus(function(){
	if ($(this).attr('value') == $(this).attr('title'))
		$(this).attr('value','');
});

// onsubmit clear default
$('input#submit').click(function(){

	$('input').each(function(){
		if ($(this).attr('value') == $(this).attr('title'))
			$(this).attr('value','');
	});
	
	document.form.submit();
	return false;	
});


// ---------- diverse ----------

$('a.thickbox img').after('<p />'); // zoom icon

});//function()

