function mail(name, domain, style) {
	document.write('<a h'+'ref="'+'mai'+ 'lto:'+name+'@'+domain+'" style="'+style+'">'+name+'@'+domain+'</a>');
}


$(window).load(function() {
    $('ul.faq p.answer').slideUp('fast');
    $('ul.faq span.question').each(function() {
	$(this).click(function() {
	    if ($(this).next().is(':hidden'))
		$(this).next().slideDown('fast');
	    else
		$(this).next().slideUp('fast');
	});
    });

    $('ol.hidden, p.hidden, li div').hide();
    $('li span.paragraph').each(function() {
	$(this).click(function() {
	    if ($(this).next().is(':hidden'))
		$(this).next().slideDown('fast');
	    else
		$(this).next().slideUp('fast');
	});

    });
    
});

function in_array(needle, haystack, strict)
{  
	var found = false, key, strict = !!strict;  
	for (key in haystack)
	{
		if ((strict && haystack[key] === needle) || (!strict && haystack[key] == needle))
		{
			found = true;  
			break;  
		}  
	}  
	return found;  
}  

/* Относится к TB_Window */
function getPageSize(){
	var de = document.documentElement;
	var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
	var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
	arrayPageSize = [w,h];
	return arrayPageSize;
}

function tb_detectMacXFF() {
  var userAgent = navigator.userAgent.toLowerCase();
  if (userAgent.indexOf('mac') != -1 && userAgent.indexOf('firefox')!=-1) {
    return true;
  }
}
function showShadow(block_id,old_block_id)
{
	if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
		$("body","html").css({height: "100%", width: "100%"});
		$("html").css("overflow","hidden");
		if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6
			$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
		}
	}else{//all others
		if(document.getElementById("TB_overlay") === null){
			$("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");
		}
	}
	
	if(tb_detectMacXFF()){
		$("#TB_overlay").addClass("TB_overlayMacFFBGHack");//use png overlay so hide flash
	}else{
		$("#TB_overlay").addClass("TB_overlayBG");//use background and opacity
	}
	
	$("#"+block_id).css("z-index",101);
	var scr_size = getPageSize();
	var wid = $("#"+block_id).width();
	var hei = $("#"+block_id).height();
	var yScroll = $.browser.msie ? document.documentElement.scrollTop : self.pageYOffset;
	$("#"+block_id).css("z-index","500").css({"left":((scr_size[0]-wid)/2),"top":(yScroll+(scr_size[1]-hei)/2)});
	if (old_block_id.length>0)
		$("#"+old_block_id).hide();
	$("#"+block_id).show();

	if (block_id=="jq_message_enter_phone")
		$("#"+block_id).find("input[name=phone_1]").focus();
}

