$(document).ready(
	function()
	{
	
	// ===================================================
				$("#datepicker1").datepicker({
				    dateFormat: 'yy-mm-dd',
				    showWeek: true,
			        firstDay: 1
			        }
				);
				
                $("#datepicker2").datepicker({
				    dateFormat: 'yy-mm-dd',
				    showWeek: true,
			        firstDay: 1
			        }
				);
				
                $("#datepicker1_slash").datepicker({
			         firstDay: 1
			        }
				);

                $("#datepicker2_slash").datepicker({
			         firstDay: 1
			        }
				);

                $("#datepicker3_slash").datepicker({
			         firstDay: 1
			        }
				);

				
                $("#datepicker3").datepicker({
				    dateFormat: 'yy-mm-dd',
				    showWeek: true,
			        firstDay: 1
			        }
				);
	


 
        //  ...... stripping_tables .......
         $("table.stripe_this tr:even td, table.stripe_me tr:even td").addClass("stripe_even" );
        // ----- new procedure code end----- 


	// ===================================================
	
		$("div.accordion-panel-content,div.nav_accordion-panel-content,div.accordion-panel-content_2").hide();


	$(".accordion-panel-content").hide();

	$(".nav_accordion-panel-content").hide();
		
		// Capture H3 clicks
		$(".nav_accordion-panel-button").click(
			function(){
			
			var thePanel = $(this).parent().find(".nav_accordion-panel-content");				
				
				if ($(thePanel).is(":visible"))
				{
				    $(thePanel).hide(250); 
				}
				else
				{
				    $(thePanel).show(250); 
				}
								
				});
		
		// Capture H3 clicks
		$(".accordion-panel-button").click(
			function(){
			
			var thePanel = $(this).parent().find(".accordion-panel-content");
			
				if ($(thePanel).is(":visible"))
				{
				    $(thePanel).hide(250); 
				}
				else
				{
				    $(thePanel).show(250); 
				}
				
				
				
				
				});

	//-------------FORM START
	$("textarea").resizable();

	//-------------PORTAL START
	$(".portal_wrapper").hide();
    $(".portal_wrapper").draggable();
    $(".portal_wrapper").resizable();
	$(".portal_wrapper").dblclick( function ()
	    {
	        $(".portal_wrapper").hide(250);
	    }
	    );

	$("#close_portal").click( function ()
	    {
	        $(".portal_wrapper").hide(250);
	    }
	
	);

	$(".portal").click( function ()
	    {
	        $(".portal_wrapper").show(250);
	    }
	
	);

	$(".toggle_portal").click( function ()
	    {
	        if($(".portal_wrapper").is(":visible"))
	        {
	            $(".portal_wrapper").hide(250);
                $(".toggle_portal").text("PORTAL: SHOW");
            }
	        else
	        {
                $(".portal_wrapper").show(250);
                $(".toggle_portal").text("PORTAL: HIDE");
	        }
	        
	    }
	
	);


         $(".portal_size_expand").hide();

		$(".portal_size_expand").click( function ()
	    {

 	           				$(".portal_wrapper").animate({width:"1000px"},250);
							$(".portal_wrapper").animate({height:"800px"},250);
                            $(".portal_size_shrink").show();
                            $(".portal_size_expand").hide();
	    
        });

 		$(".portal_size_shrink").click( function ()
	    {

 
							$(".portal_wrapper").animate({width:"2px"},250);
							$(".portal_wrapper").animate({height:"2px"},250);
                           $(".portal_size_shrink").hide();
                            $(".portal_size_expand").show();
    });


         $(".pandora").hide();

        $(".pandora_toggle").click( function ()
	    {
	        $(".pandora").toggle();
	    });
	    
		$(".pandora_size_expand").click( function ()
	    {
 	           				$(".pandora").animate({width:"1000px"},250);
							$(".pandora").animate({height:"800px"},250);
        });

 		$(".pandora_size_shrink").click( function ()
	    {
							$(".pandora").animate({width:"2px"},250);
							$(".pandora").animate({height:"2px"},250);
    });

//<span class=pandora_toggle>PANDORAH</span> : <span class=pandora_size_expand>EXPAND</span> : <span class=pandora_size_shrink>SHRINK</span>


	//-------------PORTAL END


	// ================================================================
			// This is the wait function .......... begin
			 $.fn.wait = function(time, type) {
					time = time || 1000;
					type = type || "fx";
					return this.queue(type, function() {
						var self = this;
						setTimeout(function() {
							$(self).dequeue();
						}, time);
					});
				};
			// This is the wait function .......... end
	// ================================================================
	$(".tab_menu").html('<div style="font-size:10px; color:#777; padding:5px;">Click headers to open / close topics | <span class="expand_all">Expand All Headers</span> | <span  class="close_all">Close all Headers</span></div>');


		$(".close_all").click(
			function(){
			$(".accordion-panel-content_2").slideUp(100);
			$(".accordion-panel-content").slideUp(2000);
			}
		);


				
		$(".expand_all").click(
			function(){
			$(".accordion-panel-content").slideDown(2000);
			}
		);

		



		$(".nav_accordion-panel-button").dblclick(
			function(){
			$(".nav_accordion-panel-content").hide(250);
			}
		);

		$(".accordion-panel-button").dblclick(
			function(){
			$(".accordion-panel-content").hide(250);
			}
		);



	//-------------  END



		});


