/********************************************************************************************/
$(document).ready(function() {
/********************************************************************************************/	
	$("div#description").show();
	$("a#descriptiona").addClass("selected"); 
	$("div#pictures").hide();
	$("div#comments").hide();
	$("div#related").hide();
	
	$('a#descriptiona').click(function(){	
			$("div#pictures").hide();
			$("div#comments").hide();
			$("div#related").hide();
			$("div#description").fadeIn("fast"); 
			$("a#descriptiona").addClass("selected"); 
			$("a#relateda").removeClass("selected"); 
			$("a#commentsa").removeClass("selected"); 
			$("a#picturesa").removeClass("selected"); 
	});
	$('a#relateda').click(function(){	
			$("div#pictures").hide();
			$("div#comments").hide();
			$("div#description").hide();
			$("div#related").fadeIn("fast"); 
			$("a#descriptiona").removeClass("selected"); 
			$("a#relateda").addClass("selected"); 
			$("a#commentsa").removeClass("selected"); 
			$("a#picturesa").removeClass("selected"); 
	});
	$('a#commentsa').click(function(){	
			$("div#pictures").hide();
			$("div#related").hide();
			$("div#description").hide();
			$("div#comments").fadeIn("fast"); 
			$("a#descriptiona").removeClass("selected"); 
			$("a#relateda").removeClass("selected"); 
			$("a#commentsa").addClass("selected"); 
			$("a#picturesa").removeClass("selected"); 
	});
	$('a#picturesa').click(function(){	
			$("div#comments").hide();
			$("div#related").hide();
			$("div#description").hide();
			$("div#pictures").fadeIn("fast"); 
			$("a#descriptiona").removeClass("selected"); 
			$("a#relateda").removeClass("selected"); 
			$("a#commentsa").removeClass("selected"); 
			$("a#picturesa").addClass("selected"); 
	});	
/********************************************************************************************/
	$("#modules").change(function(){
			if(document.getElementById("modules").value == "")
			{
				$("#dept").html("<option value=''>------</option>");
				document.getElementById("dept").disabled = 'none';
			}else{
				var key = document.getElementById("modules").value;
				$.get(urlchats + "/search.php?action=getmodulesdebt&key="+key, function(data){
					$("#dept").html(data);
					document.getElementById("dept").disabled = '';
				});
			}
		});
/********************************************************************************************/
	$("#country").change(function(){
			if(document.getElementById("country").value == "")
			{
				$("#city").html("<option value=''>------</option>");
				document.getElementById("city").disabled = 'none';
			}else{
				var key = document.getElementById("country").value;
				$.get(urlchats + "/weather.php?lang={$lang}&action=weather&code="+ key, function(data){
					$("#city").html(data);
					document.getElementById("city").disabled = '';
				});
			}
		});
	$("#weatheredit").click(function(){
			$("#weather").toggle();				  
		});
/********************************************************************************************/
	$('div.resort').click(function() {
			var options = { path: '/', expires: -10 };
			
			for (var i=0; i<10; i++) {
				$.cookie("menu-left_" + i, null, options);
				$.cookie("menu-right_" + i, null, options);
				$.cookie("center-content_" + i, null, options);
			}
			$('div.resort').fadeOut(2000,function() {
				location.reload(true);
			});
		});
/********************************************************************************************/
 	$("#citylink").click(function(){ $("#cityform").toggle("slow"); });
/********************************************************************************************
	$('.date-pick').datePicker(
		{
			startDate: '01/01/1970',
			endDate: (new Date()).asString()
		}
	);
/********************************************************************************************/
	$("#showfile").click(function(){
		$("#filelink").hide("slow");
		$("#file").show("slow");
	});
	$("#showfilelink").click(function(){
		$("#file").hide("slow");
		$("#filelink").show("slow");
	});
/********************************************************************************************/
/********************************************************************************************/
});
/********************************************************************************************/





/********************************************************************************************/
//								Functions
/********************************************************************************************/
function hello(string){
	var name=string
	document.getElementById('content').value=name;
}
/********************************************************************************************/
function hello(string){
	var name=string
	document.getElementById('content').value=name;
}
/********************************************************************************************/

/********************************************************************************************/
/*function move() {
	window.location = '{/literal}{$sitelink}/{$link}{literal}'
}*/
/********************************************************************************************/


/********************************************************************************************/
//								Code
/********************************************************************************************

/********************************************************************************************/
