$(document).ready(function(){
						   //start tabs function
						   $("#tabsbtns li").click(function(){
															tabindex=$("#tabsbtns li").index(this);
															$("#tabsviews li").hide().eq(tabindex/2).show();
																					  });
						   $("#tabsbtns li").eq(1).click();
						   //end tabs function
							//$("#newsboxfixed").jScrollPane();
							$("ul.sf-menu").superfish(); 
							$(".flags").hover(function(){$(this).addClass("flagenabled")},function(){$(this).removeClass("flagenabled")})
							
							$("#lbflag").click(function(){
								myVars=getUrlVars();
								var myURL='?';
								for(var i = 0; i < myVars.length; i++){myURL+=(myVars[i]!="lang")?myVars[i]+"="+myVars[myVars[i]]+"&":'';}
								document.location=myURL+"lang=ar";
							})
							$("#usflag").click(function(){
								myVars=getUrlVars();
								var myURL='?';
								for(var i = 0; i < myVars.length; i++){myURL+=(myVars[i]!="lang")?myVars[i]+"="+myVars[myVars[i]]+"&":'';}
								document.location=myURL+"lang=en";
							})
							$(".flagenabled").hover(function(){$(this).addClass("flagenabled")},function(){$(this).addClass("flagenabled")})
						   })
function sendMail(mail){
	if($("#iform").valid()){
	$.get('administrator/sendmail.php?'+mail,function(data){
													  $(".messagestatus").text(data).fadeIn("slow").delay(1000).fadeOut("slow");
													  $("input:text").val('');
													  $("textarea").val('');
													  });
	}}
	
	function getUrlVars()
{
	var vars = [], hash;
	if(window.location.href.indexOf('?')!=-1){
	var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
	for(var i = 0; i < hashes.length; i++)
	{
	hash = hashes[i].split('=');
	vars.push(hash[0]);
	vars[hash[0]] = hash[1];
	}}
	return vars;
	
}// JavaScript Document
