$('.Logo').corner("bottom");
$('.Ad1').corner("bottom");
$('.Ad2').corner();
$('.Prog').corner();
    /*
$(function() {
    $(".tt").tooltip({ 
        track: true, 
        delay: 0, 
        showURL: false, 
        opacity: 1, 
        fixPNG: true, 
        showBody: " - ", 
        extraClass: "pretty fancy", 
        top: -15, 
        left: 5 
    });  
});
*/
////Nachliel script - Scroll the add site forum.!
////This is responisble for the add site for clients to submit more sites. don't worry in due time we will have 98,560 sites.
$(document).ready(function(){

	//Show the index of the categories
	$("#showIndex").click(function()
	{
	
		$(".topindex").slideToggle("slow");
		$(this).attr('src','/images/web2.png');
		$('#showIndex').attr('src','images/web2.png');
		//$("#showIndex").css("background","url('/images/web2.png'");
	});
	
	
	
		//Show the News of the categories
	$("#shownews").click(function()
	{
	
		$(".topnews").slideToggle("slow");
		$(this).attr('src','/images/r5.png');
		$('#shownews').attr('src','images/r5.png');
		//$("#shownews").css("background","url('/images/web2.png'");
	});
	
	
	
	
	
   $("#addbutton").click(function(){
		getcat = $("#i_cat").val();
		$.post("http://www.hotpage.co.il/getInfo.php",{Cat:getcat},function(result)
		{
			$("#cat_Desk").html(result);
		});
		$("#AddNewSite").css("display","inline");
		$("#AddNewSite").animate({left:"300px"},"slow");
	});
	
   $("#close_add").click(function(){
	$("#AddNewSite").animate({left:"-500px"},"slow");

	});
	
	/*
	//This is responisble fot the add site bar.
   $("#inputbutton").click(function(){
    getname=$(".thename").val();
	getlink=$(".thelink").val();
	getdesc=$(".thedesc").val();
	getcat=$("#add_cat").val();
	$("#answer").html("האתר בבדיקה אנא המתן..");
		$.post("http://www.hotpage.co.il/fastadd.php",{Name:getname,Link:getlink,Desc:getdesc,Cat:getcat,send:""},function(result){
		  $("#answer").html(result);
		  setTimeout(function(){
			$(".thename").val("");
			$(".thelink").val("");
			$(".thedesc").val("");
			$("#specialadd").animate({left:"-500px"},"slow");
		  },2000);
		  setTimeout(function(){
			$("#answer").html("");
		  },4000);
		});
	});
	*/
	//Add site bar system
	$("#add_site").mousedown(function(){
		$("#add_site").css("background","url('images/AddSiteButton.png') 0px 25px");
	});
	$("#add_site").mouseup(function(){
		$("#add_site").css("background","url('images/AddSiteButton.png') 0px 0px");
	});
	$("#close_add").mousedown(function(){
		$("#close_add").css("background","url('images/AddSiteButton.png') 100px 25px");
	});
	$("#close_add").mouseup(function(){
		$("#close_add").css("background","url('images/AddSiteButton.png') 100px 0px");
	});
	$("#close_add").mouseleave(function(){
		$("#close_add").css("background","url('images/AddSiteButton.png') 100px 0px");
	});
	$("#add_site").mouseleave(function(){
		$("#add_site").css("background","url('images/AddSiteButton.png') 0px 0px");
	});
	
	$("#i_cat").change(function(){
	
		getcat = $("#i_cat").val();
		$.post("http://www.hotpage.co.il/getInfo.php",{Cat:getcat},function(result)
		{
			$("#cat_Desk").html(result);
		});
	});
	
	$("#add_site").click(function(){
		$("#FeedBack").html("האתר בבדיקה אנא המתן..");
			
		getname=$("#i_name").val();
		getlink=$("#i_link").val();
		getdesc=$("#i_desc").val();
		getcat=$("#i_cat").val();
		var SendMe = true;
			//Check the size of the texts a.com
		if ((getname.length<2) || (getlink.length<4) || (getdesc.length<5))
		{
			$("#FeedBack").html("אנא הכנס אתר באופן תקין");
			SendMe=false;
		}
			
		if (SendMe)
		{
			$.post("http://www.hotpage.co.il/fastadd.php",{Name:getname,Link:getlink,Desc:getdesc,Cat:getcat,send:""},function(result)
			{
				var approved = result.substr(0,1);
				result = result.substr(1);
				$("#FeedBack").html(result);
				if (approved=="1")
				{
					setTimeout(function()
					{
						$("#i_name").val("");
						$("#i_link").val("");
						$("#i_desc").val("");
						$("#AddNewSite").animate({left:"-500px"},"slow");
					},2000);
				}
			});
		}
	});
	
	// Tool-Tip! Use alt to describe the link, use title to describe the title.
   // By Nachliel Shilo, 
   $(".tooltip").hover(function(){
		$("#tooltip").css("display","block");
		var mycontext = $(('#txt_' + $(this).attr("id").substring(4))).html();
		var mytitle = $(this).attr("alt");

		$("#tt_title").html(mytitle);
		$("#tt_text").html(mycontext);
		
	},function(){
		$("#tooltip").css("display","none");
	});
	
	$(".tooltip").mousemove(function(e){
		$("#tooltip").css("left",e.pageX+2);
		$("#tooltip").css("top",e.pageY+2);
	});
});

// Bookmark with chrome By Idan Nadir
function addBookmark(title,url){
if(window.sidebar){
window.sidebar.addPanel(title, url, "");
} else if(document.all){
window.external.AddFavorite(url, title);
} else if(window.opera && window.print){
alert('לחצו על  ctrl+D כדי להוסיף אותנו למועדפים שלכם');
} else if(window.chrome){
alert('לחצו על  ctrl+D כדי להוסיף אותנו למועדפים שלכם');
}
}

