$(document).ready(function()
{
 // code
 $(".email").each(function()
 {
  var e = $(this).attr("href") + "@" + $(this).text();
  $(this).text(e);
  $(this).attr("href", "mailto:" + e);
 }
 );
 // end code
 drop_bottom();
}
);

function drop_bottom()
{  
 var screen_height = document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
 var box = $("#box").height();
 height = Math.max(screen_height,box);
 if (screen_height>box) height = height-100; 
 //alert(height);
 $("#box").css	
 (
  {
   height: height + "px"
  }
 );
}

function sendcomment(type)
{
 article = '';
 www = '';
 if (type=='comment')
 {
  www = $("#www").get(0).value;
  article = $("#article").get(0).value;
  $("#www").get(0).value='';
 }
 name = $("#name").get(0).value;
 email = $("#email").get(0).value;
 text = $("#text").get(0).value;
 $("#name").get(0).value='';
 $("#email").get(0).value='';
 $("#text").get(0).value='';
 $("#search_result").empty();
 $("#search_result").append("<img src=\"/i/ajaxarrows.gif\" alt=\"\" width=\"16\" height=\"16\" />");
 $("#search_result").load("/comments/",
 {
  name:name,
  email:email,
  text:text,
  article: article,
  www: www,
  type: type,
  submit_comment:true
 }
 );
}


/* тестим прокрутку */

function moveanons()
{
 $("#loader").html("<div style=\"position: absolute;left:50%;top:60px;\"><img src=\"/i/ajax/loader.gif\" alt=\"\" width=\"32\" height=\"32\" /></div>");	
 setTimeout(function(){$("#loader").empty(); $("#box").html("<img src=\"/photos/img1190032537_0.jpg\" alt=\"\" class=\"imgleft imgtop\" height=\"90\" width=\"60\"><h3 class=\"taglist\"><a href=\"/articles/id/710\">Сколько можно любить ближнего своего</a></h3>Любимому человеку плохо, а ты не знаешь, как ему помочь. Сердце, кажется, разрывается от желания взять на себя его боль – чтобы любимому стало хоть чуточку легче. Ты делаешь все, что можешь, и даже намного больше. Вряд ли в эту секунду ты способна подумать о том, что будет дальше.<a href=\"/articles/id/710\" class=\"arrow\">...<img src=\"/i/green_arrow.gif\" class=\"arrowlink\" alt=\"\" height=\"15\" width=\"15\">");}, 2000);
}

/* */

function CountClick(id,link)
{
 $.getJSON(
 '/clicks',
 {
  banner: id,
  link: link,
  count_clicks: true
 },
 function(obj)
 {
  //window.location = obj.result;
  window.open(obj.result);
 }
 );	
}