//// JQuery Script
$(document).ready(function () {
	// I always have these two classes as buttons
	$( ".jq_button" ).button();
	$( ".jq_btn" ).button();
	$( ".jq_readmore_home" ).button({
		icons: {
			primary: "ui-icon-comment"
		},
		text: false
	});
	$( ".post-edit-link" ).button();
	$( ".post-edit-link" ).css('color', 'white');
	$( ".post-edit-link" ).css('text-transform', 'uppercase');
	$( ".post-edit-link" ).css('float', 'right');
	
	//$("#lw_hidden_green_white").hide();
	//$("#lw_show_green_white_btn").click(function(){
			//alert ('lw_show_green_white_btn');
			//("#lw_hidden_green_white").show();
			//return false;
	//});
	
	
	(function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  	})();
	
	$( "#submit" ).button();
	
	// Hide the content as it loads even though it's already hidden with css
	$("#loaded_area").hide();
	//alert ('do not hide');
	//$("#hide_websites").hide();
	$("#see_all_sites").click(function() {  
		//$("#hide_websites").show();
		//return false;
		window.location = 'http://living-websites-2.eu/home/websites/';
  	}); 
	
	// Accordians
	// do the accordians in reverse order 
	// of how they show vertically on screen
	// trust me. it helps
	
	
	
	// websites_jq ////////////////////////////////
	$("#websites_jq").accordion({ 
		autoHeight: false,
		collapsible: true
	 });
	 // leave it open
	 // $("#websites_jq").accordion('activate', 0);
	 
	 // websites_jq ////////////////////////////////
	$("#comment_acc").accordion({ 
		autoHeight: false,
		collapsible: true
	 });
	 // leave it open
	 $("#comment_acc").accordion('activate', 0);
	
	
	// subpages_acc ////////////////////////////////
	$("#subpages_acc").accordion({ 
		autoHeight: false,
		collapsible: true
	 });
	 // leave it open
	 // $("#subpages_acc").accordion('activate', 0);
	 
	 //rightbar accordian /////////////////
	 $("#rightbar_acc").accordion({ 
		autoHeight: false,
		collapsible: true
	 });
	 // close it up
	 $("#rightbar_acc").accordion('activate', 0);
	 
	 //rollover accordian /////////////////
	 $("#rollover_acc").accordion({ 
		autoHeight: false,
		collapsible: true
	 });
	 // close it up
	 $("#rollover_acc").accordion('activate', 0);

	 
	 //Social and account accordian should be acivated last /////////////////
	 $("#socialaccount_acc").accordion({ 
		autoHeight: false,
		collapsible: true
	 });
	 // close it up
	 //$("#socialaccount_acc").accordion('activate', 0);
	 
	 //rollover_sub_nav_acc /////////////////
	 $("#rollover_sub_nav_acc").accordion({ 
		autoHeight: false,
		collapsible: true
	 });
	 // close it up
	 $("#rollover_sub_nav_acc").accordion('activate', 0);
	 
	 // once all is done, we'll swap the visible divs to 
	 // get rid of the loading screen and show the content once it's loaded
	 
	 $("#loaded_area").css("visibility","visible");
	 $("#loaded_area").show();
	 $("#loading_area").css("visibility","hidden");
	 $("#loading_area").hide();
	 
});


