jQuery(document).ready(function ($) {
	$(".link_enter, .add-article a").colorbox({
		inline: true,
		returnFocus: false,
		trapFocus: false,
		scrolling: false,
		opacity: 0.55
	});
	$(".add-article a").colorbox({ onComplete:function(){
		tinymce.init({
		    selector: "textarea#etextarea",
			plugins: "link code",
			toolbar: "code bold italic removeformat bullist link unlink undo redo",
			valid_elements : "a[name|href|target|title|onclick|rel],img[src|alt|title|width|height|usemap|border],map[name],area[alt|shape|coords|href],ul,li,strong/b,em/i,br,p,hr",
			width: 890,
			height: 150,
			menubar: false, statusbar: false
	});}});

	var originalClose = $.colorbox.close;
	$.colorbox.close = function(){
		if (typeof tinymce !== "undefined")
			tinymce.remove('textarea#etextarea');
		originalClose();
	};

	$('.tabs-content').easytabs();
    $('#tabs-content1').bind('easytabs:after', function() {
        location.href='#photos-tabs1';
    });

});

function createCookie(name, value, days) {
var expires;
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
expires = "; expires=" + date.toGMTString();
} else {
expires = ""; }
document.cookie = escape(name) + "=" + escape(value) + expires + "; path=/"; }

function readCookie(name) {
var nameEQ = escape(name) + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) === ' ') c = c.substring(1, c.length);
if (c.indexOf(nameEQ) === 0) return unescape(c.substring(nameEQ.length, c.length)); }
return null;}
