function ajax_link(){
	$(".ajax").each(function(i){
		if( $(this).attr("mdajax") !=='ok'){
			$(this).attr("mdajax","ok");
			$(this).click(function (){
				page_load(this.href , $(this).attr("ajaxid"));
				return false;
			})
		}
	});
}	
function page_load(url, ajaxid){
	if ((i = url.indexOf("?")) > 0) {
		ajax_url  = url+"&class=ajax";	
	}else{
		ajax_url  = url+"?class=ajax";
	}
	if ( ajaxid =='' || ajaxid == null){
		ajaxid="md_main";
	}
	do_ajax( "GET" , ajax_url , "" , ajaxid , "body" , "ok" , "normal", "write" )
}
function news_s(){
do_ajax( "POST" , "ajax.php?page=newsletter" , "langshort="+site_lang+"&block_email="+get_value_for_ajax("block_email") , "ajax_error_news" , "body" , "ok" , "normal", "write" )
}
function register_step(){
	$('#register_base').slideUp();
	setTimeout('$("#md_form").slideDown(200)' , 400)
}
function sec_pic(){
	$(".pic_code").each(function(i){
		if( $(this).attr("mdajax") !=='ok'){
			$(this).attr("mdajax","ok");
			$(this).after('<a href="javascript:new_sec_pic()"><img src="js/images/refresh.gif" /></a>');
		}
	});
}
function new_sec_pic(){
	$(".pic_code").html("<img src='imagecreater/security.php?new=md&time="+new Date().getTime()+"' />");
}

$(document).ready(function() {
	ajax_link();
	change_list_class();
	sec_pic()
});