$(document).ready(function() {
	$('a.popup').click(function(){
		var Location = $(this).attr('href');
		window.close(Window);
		var Window = window.open(Location, "Window", "location = 0, status = 0, scrollbars = 0, width=400, height=340");
		return false;
	});
	if($('a.xray').length) {
		$('a.xray').lightBox({fixedNavigation:true});
	}
	
	
	$('#templates').change(function() {
		var selectedTemplate = $('#templates option:selected').attr('value');
		$('a#previewtemplate').attr('href', '../images/previewtemplates/' + selectedTemplate + '.jpg');
		$('a#previewtemplate').attr('title', selectedTemplate);
	});
	
	if($('a#previewtemplaye').length) {
		$('a#previewtemplate').lightBox();
	}
	
	if($('.tinymce').length) {
		$('.tinymce').tinymce({
			script_url : '/styles/js/tiny_mce/tiny_mce.js',
			theme: "advanced"
		});
	}
});
