$(document).ready(function(){
	$("a.search").click(function(){
		$("body").prepend('<div id="overlay" style="filter:alpha(opacity=40); opacity: 0.4"><\/div><div id="searchInputHolderBg"><\/div><div id="searchInputHolder" ><a id="closeButton" href="#close"><\/a>' +
			'<form action="?m=publications" method="post" class="search">' +
			 '<fieldset>' +
			 '<label for="searchinput"><!–– ძებნა: ––><\/label>' +
			 '<input type="text" id="searchinput" name="q" class="searchinput" maxlength="60" \/>' +
			 '<input type="submit" value="მოძებნე" id="searchSubmit" class="searchSubmit" />' +
			 '<\/fieldset>' +
		   '<\/form>' +
		'<\/div>');
		$("#overlay, #searchInputHolder").animate({opacity: 'show'}, "slow", "easein");
		$("#overlay").height((document.body.scrollHeight > document.body.offsetHeight)?document.body.scrollHeight:document.body.offsetHeight);
		$('#closeButton').click(function(){
			$('#overlay, #searchInputHolder').fadeOut("slow",function(){
				$("#searchInputHolderBg").remove();
				$(this).remove();
		 	});
	 		});		
	});	
	$("a.mail").click(function(){
		$("body").prepend('<div id="overlay" style="filter:alpha(opacity=40); opacity: 0.4"><\/div><div id="siteFeedBackBg"><\/div><div id="siteFeedBack"><a id="closeButton" href="#close"><\/a>' +
			'<form method="post" action="?m=feedback" id="postform">' +
			 '<fieldset>' +
			 '<legend><!-- --><\/legend>' +
			 '<label for="name"><!--  --><\/label>' +
			  '<input id="name" name="name" value="სახელი:" onfocus="if(this.value ==\'სახელი:\')this.value=\'\';" onblur="if(this.value ==\'\')this.value=\'სახელი:\';"/><br \/>' +
			 '<label for="dep"><!-- E-mail:: --><\/label>' +
			  '<select id="dep" name="dep">' +
				  '<option value ="ivanet">მომსახურების დეპარტამენტი<\/option>' +
				  '<option value ="finance">ფინანსური დეპარტამენტი<\/option>' +
				  '<option value ="gogar">საზოგადოებასთან ურთიერთობის დეპარტამენტი<\/option>' +
			  '<\/select>' +
			 '<label for="message"><!--  --><\/label>' +
			  '<textarea id="message" name="msg" rows="1" cols="1" style="scrollbar-arrow-color: #420909; scrollbar-track-color: #bfc9e1; scrollbar-face-color: #7d9ad4; scrollbar-highlight-color: #b6cbfa; scrollbar-3dlight-color: #414141; scrollbar-darkshadow-color: #4c67a3; scrollbar-shadow-color: #43506c;"><\/textarea><br \/>' +
			  '<input type="submit" value="გაგზავნა;" class="submit" \/>' +
			 '<\/fieldset>' +
		   '<\/form>' +
		'<\/div>');
		$("#overlay, #siteFeedBack").animate({opacity: 'show'}, "slow", "easein");
		$("#overlay").height((document.body.scrollHeight > document.body.offsetHeight)?document.body.scrollHeight:document.body.offsetHeight);
		$('#closeButton').click(function(){
			$('#overlay, #siteFeedBack').fadeOut("slow",function(){
				$("#siteFeedBackBg").remove();
				$(this).remove();
			});
		});
	})
	
	$('#infoDiv').pager('div.page', { navId: 'nav' });
	$('#infoDiv2').pager('div.momsPage', { navId: 'nav2', navAttach: 'prepend', linkText: ['ფიზიკური დაცვითი მომსახურება', 'ელექტრონული დაცვითი მომსახურება', 'ოჯახის მცველი', 'ჯავშანდაცვა', 'ტურისტური ტურებისა და <br \/>ჯგუფური გადაადგილების დაცვა', 'VIP მომსახურება'], linkWrap: '<div><\/div>' });
	
});
