/*	
	Main javascript functions - http://gminadrawsko.pl
	Author: Tomasz Rybak - tomasz.m.rybak@gmail.com
	Name: main.js
*/

jQuery().ready(function(){

	$("#menu .white > a").addClass('sub');
	
	$('#menu').accordion({
		active: false,
		autoHeight: false,
		navigation: true,
		collapsible: true,
		header: '.menuItem'
	});
	
	 $("#word").focus(function(){
		 if($(this).val()=='wpisz fraze...') {
			 $(this).attr('value','');
			 $(this).css('color','#000');
			 $(this).parent().css('color','#000'); 
		 }
	 });
	 
	 $("#word").blur(function(){
		 if($(this).val()=='') {
			 $(this).attr('value','wpisz fraze...');
			 $(this).css('color','#D5D8DF');
			 $(this).parent().css('color','#D5D8DF');
		 }
	 });
	 
	 $(".print").click(function(e) {
		 e.preventDefault();
		 var href=$(e.target).attr('href');
		 window.open(href,'','location=0,height=670,width=600,scrollbars=yes');
		 return false;
	 });
	 
	 $("a").click(function(){
		 if($(this).attr('rel')=='external') {
			 $(this).attr('target','_blank');
		 }
	 });
	 
});
