$(document).ready(function()
{
 $(".email").each(function()
 {
  var e = $(this).attr("href") + "@" + $(this).text();
  $(this).text(e);
  $(this).attr("href", "mailto:" + e);
 }
 );
}
);


function loadform(alias)
{
 $('#'+alias).ajaxForm(
 { 
  dataType:  'json', 
  success:   processJsonForm
 }
 );	
}

function closeinf() {
 	$("#bigimgfon").hide();
 	$("#bigimg").hide();	
 	$("#bigimgbox").html();
}

function processJsonForm(data)
{
 if ($("#bigimgfon").length) {
 	 var top =$(window).scrollTop();
	 var windowheight = $(window).height();	
 	 var indicatortop = top + windowheight/2;
     var height = $("#container-page").height();	
     var width = $("#container-page").width();	
     $("#bigimgfon").css( {
 		width: width+"px",
    	height:height+"px"
 	 });
 	$("#bigimgfon").show();
 	$("#bigimg").show();
 	$("#bigimg").html(data.text);
 	$("#bigimgbox").css("top",indicatortop);
 } else {
 	$("#inputresult").html(data.text);	
 }
 if(data.done==1) 
 {
  $("#submit_data").attr("disabled","disabled");
  //setTimeout(function(){window.location = data.link;}, 2000);
 }
 else
 {
  $("#submit_data").attr("disabled","");	
 }
 $("#formajaxloader").empty();
}

function loadindicator()
{
 $("#formajaxloader").html("<div style=\"position:absolute;top:5px;left:50%;width:16px;height:16px\"><img src=\"/i/ajax/blue.gif\" width=\"16\" height=\"16\" alt=\"\" /></div>");
}

function show_submenu(id)
{
 $("#submenu"+id).animate({height: $("#submenu"+id).get(0)&&$("#submenu"+id).get(0).style.display=='none' ? "show" : "hide"}, 400);
}