function addcomment() {
	$('#addcomment').animate( {
		height : 'toggle'
	}, "slow", function() {
		// Animation complete.
		});
}

function redirect(url) {
	window.location = url;
}

function viewCatArt(cat_id) {
	$('#cat_'+cat_id).animate( {
		height : 'toggle'
	}, "slow", function() {
		// Animation complete.
		});
}

function viewArtCom(art_id) {
	$('#art_'+art_id).animate( {
		height : 'toggle'
	}, "slow", function() {
		// Animation complete.
		});
}

function dothis(id) {
	var div = document.getElementById('short_div' + id);
	if (div.style.display == "none") {
		$('#details_div' + id).animate( {
			opacity : 0.40,
			height : 'toggle',
			width : 'toggle'
		}, 1, function() {
			// Animation complete.
				$('#read_more_btn' + id).animate( {
					height : 'toggle',
					width : 'toggle'
				}, 1, function() {
					// Animation complete.
					});
			});
	}
}
function hidethis(id) {
	var div = document.getElementById('short_div' + id);
	if (div.style.display == "none") {
		$('#details_div' + id).animate( {
			opacity : "hide",
			height : 'toggle',
			width : 'toggle'
		}, 1, function() {
			// Animation complete.
				$('#read_more_btn' + id).animate( {
					opacity : "hide",
					height : 'toggle',
					width : 'toggle'
				}, 1, function() {
					// Animation complete.
					});
			});
	}
}
function show_short(id, Aid) {
	if (Aid == undefined || Aid == '' || parseInt(Aid) == 0) {
	} else {
		$('#details_div' + id).animate( {
			opacity : "hide",
			height : 'toggle',
			width : 'toggle'
		}, "fast", function() {
			$('#read_more_btn' + id).animate( {
				opacity : "hide",
				height : 'toggle',
				width : 'toggle'
			}, "fast", function() {
				// Animation complete.
					$('#short_div' + id).animate( {
						opacity : 0.9,
						height : 'toggle',
						width : 'toggle'
					}, "fast");
					$.ajax( {
						url : "componants/cookies.php?id=" + Aid,
						context : document.body,
						success : function(data) {
						}
					});
				});

		});
	}
}
function hide_short(id) {
	$('#short_div' + id).hide("fast", function() {
		$("#sa71_" + id).show("slow");
	});

}

/** **************************************** */
function setCookie(c_name, value, expiredays) {
	var exdate = new Date();
	exdate.setDate(exdate.getDate() + 1);
	document.cookie = c_name + "=" + escape(value)
			+ ((expiredays == null) ? "" : "; expires=" + exdate.toUTCString());
}
/** **************************************** */
function getCookie(c_name) {
	if (document.cookie.length > 0) {
		c_start = document.cookie.indexOf(c_name + "=");
		if (c_start != -1) {
			c_start = c_start + c_name.length + 1;
			c_end = document.cookie.indexOf(";", c_start);
			if (c_end == -1)
				c_end = document.cookie.length
			return unescape(document.cookie.substring(c_start, c_end));
		}
	}
	return "";
}
/** **************************************** */
function checkCookie() {
	username = getCookie('username');
	if (username != null && username != "") {
		alert('Welcome again ' + username + '!');
	} else {
		username = prompt('Please enter your name:', "");
		if (username != null && username != "") {
			setCookie('username', username, 365);
		}
	}
}
/** **************************************** */

