$(document).ready(function(){
	// hide on load
	$("div.hideshow03").hide();

	// hide/show on click
	$("a.hideshow03").click(function(){
		$("div.hideshow03").slideToggle("slow");
	});
	
	
	

	// success demo, just for show...
	// remove these lines
	$(".success").hide();
	$(".success").fadeIn("slow");
	$(".error").hide();
	$(".error").fadeIn("slow");
	
	
	
	$(".hideSuccess").click(function(){
		$(".success").fadeOut("slow");
	});
	$(".hideError").click(function(){
		$(".error").fadeOut("slow");
	});
	
	
	/* Added by mathka */
	$('a[rel="external"]').click( function() {
		/*var w2 = window.open(this.href,'','page, height=450, width=850');
		w2.focus();
		w2.print();
		return false;*/
		var printContent = $('#content_main_box').html();
		 var windowUrl = 'about:blank';
		 var uniqueName = new Date();
		 var windowName = 'Print' + uniqueName.getTime();
		
		 var printWindow = window.open(windowUrl, windowName, 'left=50000,top=50000,width=0,height=0');
		 
		 printWindow.document.write(printContent);
		 printWindow.document.close();
		 printWindow.focus();
		 printWindow.print();
		 printWindow.close();
		
		 return false;
    });
    
   	jQuery.fn.fadeToggle = function(speed, easing, callback) {
    	return this.animate({opacity: 'toggle'}, 1000, easing, callback);
    };
    
    /*$('#user_panel').click( function(  ){
    	$('#panel').toggle("slow");
    	$('#possible').hide();
    });*/
    
   
    $('#availability').click( function(  ){
    	var is_ie6 = document.all && (navigator.userAgent.toLowerCase().indexOf("msie 6.") != -1);
    	if (is_ie6)
  	   		{
         			var html =  "<iframe style=\"position: absolute; display: block; " +
         						"z-index: -1; width: 100%; height: 100%; top: 0; left: 0;" +
         						"filter: mask(); background-color: #ffffff; \"></iframe>";           				
         			if ( $('#possible') ) possible.innerHTML += html;
    	 }
    	 $('#possible').toggle("slow");
    	 $('#panel').hide();
    });
});
