$(document).ready(function() {

	$('.core_jshide').hide();
	$('.core_jsshow').show();

	$('.confirm').click(function(){

		var question = $(this).attr('rel');
		
		if ("" != question)
			return confirm(question);
		
		return true;
	});

	var anchor = window.location.hash;

	if (anchor != '' && anchor != '#') {

//		$('body').scrollTop($(anchor).position().top - 100);
		
		return;
	}

	if (!document.forms.length)
		return;

	var form = 0;
	for (var i = 0; i < document.forms.length; i++) {

		var tmp = document.forms[i];
		if (tmp.className == 'core_focus') form = tmp;
	}
	if (!form) form = document.forms[0];

	var field1 = 0;
	for (var i = 0; i < form.elements.length; i++) {

		var tmp = form.elements[i];

		if (!$(tmp).hasClass('no_focus') && (tmp.type == 'text' || tmp.type == 'textarea')) {

			if (!field1) field1 = tmp;

			if (tmp.className == 'core_focus') {

				tmp.focus();
				return;
			}
		}
	}
	if (field1) field1.focus();
});