commentsettings = {
	onShiftEnter:{keepDefault:false,replaceWith:'<br />\n'},
	onCtrlEnter:{keepDefault:false,openWith:'\n<p>',closeWith:'</p>\n'},
	markupSet: [
		{name:'Paragraph',openWith:'<p(!( class="[![Class]!]")!)>',closeWith:'</p>' },
		{separator:'---------------' },
		{name:'Bold',key:'B',openWith:'(!(<strong>|!|<b>)!)',closeWith:'(!(</strong>|!|</b>)!)' },
		{name:'Italic',key:'I',openWith:'(!(<em>|!|<i>)!)',closeWith:'(!(</em>|!|</i>)!)' },
		{name:'Stroke through',key:'S',openWith:'<del>',closeWith:'</del>'},
		{separator:'---------------' },
		{name:'Ul',openWith:'<ul>\n',closeWith:'</ul>\n'},
		{name:'Ol',openWith:'<ol>\n',closeWith:'</ol>\n'},
		{name:'Li',openWith:'<li>',closeWith:'</li>'},
		{separator:'---------------'},
		{name:'Picture',key:'P',replaceWith:'<img src="[![Source:!:http://]!]" alt="[![Alternative text]!]" />'},
		{name:'Link',key:'L',openWith:'<a href="[![Link:!:http://]!]"(!( title="[![Title]!]")!)>',closeWith:'</a>',placeHolder:'Your text to link...'},
		{separator:'---------------'},
		{name:'Clean',className:'clean',replaceWith:function(markitup) { return markitup.selection.replace(/<(.*?)>/g,"")}},
	]
}
$(document).ready(function(){
	$('.toTop').click(function(){$('#container').ScrollTo(1000);return false});
	$('.toComments').click(function(){$('#comments').ScrollTo(800);return false});
	$('.toSearch').click(function(){$('#search-form').ScrollTo(300);$('#search-form #search-criteria').focus();return false});
	
	$('input').focus(function(){$(this).stop().css({opacity:'0.7'}).fadeTo('fast',1);});
	$('input').blur(function(){$(this).stop().fadeTo('fast',0.7);});
	$('textarea').focus(function(){$(this).stop().css({opacity:'0.7'}).fadeTo('fast',1);});
	$('textarea').blur(function(){$(this).stop().fadeTo('fast',0.7);});

	$('a[@rel*=lightbox]').lightBox({imageLoading:'/user/themes/oregon/images/lightbox/ico-loading.gif',imageBtnPrev:'/user/themes/oregon/images/lightbox/btn-prev.gif',imageBtnNext:'/user/themes/oregon/images/lightbox/btn-next.gif',imageBtnClose:'/user/themes/oregon/images/lightbox/btn-close.gif',imageBlank:'/user/themes/oregon/images/lightbox/blank.gif'});
	
	$('#commentform #content').markItUp(commentsettings);
	
	$("#guidelines").hide();
	$("#comment-guidelines").click(function(){
		$("#guidelines").slideToggle(800);
	});
	
	if ( $.fn.pngfix != null ) {
		$("img[@src$=png],#header,#search-submit,#footer").pngfix();
		$("#page-wrap").pngfix({sizingMethod:"scale"});
	}
});
