/* PliggTemplates.eu
** Commercial Templates
** http://www.pliggtemplates.eu
** Author Grusha
*/

jQuery(document).ready(function(){
	jQuery(".delete").click(function() {
		//alert("" + this.id);
		//alert("Get parent == " + $(this).parent().get(0).tagName);
		jQuery(jQuery(this).parent().get(0)).animate({ opacity: 'hide' }, "slow");
		
		//alert("3=====" + this.id);
		jQuery.cookie(this.id, "3",{ expires: 365});
	});
	

	jQuery("#delete1").click(function () {
		jQuery(".delete").each(function(i) {
			jQuery.cookie(this.id, null);
		});	
});
	
	jQuery(".accordion2 h3").addClass("active_s");
	jQuery(".accordion2 div").show();
	

	jQuery(".accordion2 h3").click(function(){
		jQuery(this).next("div").slideToggle("slow");
		jQuery(this).toggleClass("active_s");
		if (jQuery(this).is(".active_s")) {
		//alert("0=====" + this.id);
		jQuery.cookie(this.id, "0",{ expires: 365});
} else {

		jQuery(this).removeClass("active_s");
		//alert("1=====" + this.id);
		jQuery.cookie(this.id, "1",{ expires: 365});
}
	});


	// READ COOKIES 
	jQuery(".accordion2 *").each(function(i) {
		var val = jQuery.cookie(this.id);
		if(val == 1) {
		jQuery(this).next("div").slideDown("slow");
		jQuery(this).toggleClass("active_s");
		} else if (val == 0){
		jQuery(this).next("div").slideUp("slow");
		}  else if (val == 3){
		jQuery(this).parent().css("display","none");
		} else {
		jQuery(this).next("div").slideDown("slow");
		jQuery(this).toggleClass("active_s");
		}
	});
	

	

});