		$(function(){
             $('.slide-out-div').tabSlideOut({
                 tabHandle: '.handle',                              //класс элемента
                 pathToTabImage: '/img/tpl/contact_tab.png',          //путь к изображению *required*
                 imageHeight: '122px',                               //высота  *required*
                 imageWidth: '40px',                               //width of tab image *required*    
                 tabLocation: 'right',                               //side of screen where tab lives, top, right, bottom, or left
                 speed: '300',                                        //speed of animation
                 action: 'click',                                   //options: 'click' or 'hover', action to trigger animation
                 topPos: '10px',                                   //position from the top
                 fixedPosition: false                               //options: true makes it stick(fixed position) on scroll
             });
         });

		$(document).ready(function() {
			$("a.gallery").fancybox();
		});

function showHide(id)
{
	id = document.getElementById(id);
	if(id.style.display == 'block')
		id.style.display = 'none';
	else
		id.style.display = 'block';
}



function fcheck(form)
{
	for(i=1;i<arguments.length;i++)
	{
		with(form)
		{
			if(!arguments[i].value)
			{
				alert('Поля отмеченные * - обязательны для заполнения!');
				arguments[i].focus();
				return false
			}
		}
	}
	return true
}



function emailcheck(string)
{
	if(string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)!=-1 || string=='')
		return true;
	else
	{
		alert('Введите корректный адрес e-mail!');
		return false;
	}
}



function hideTimer()
{
	setTimeout("showHide('order');",5000);
}



function showHideMenu(id)
{
	idL = document.getElementById('iServL'+id);
	idD = document.getElementById('iServ'+id);
	if(idD.style.display == 'block')
	{
		idD.style.display = 'none';
		idL.className = 'item';
	}
	else
	{
		idD.style.display = 'block';
		idL.className = 'itemAct';
	}
}

function insertFlash(bnFlash,bnW,bnH,flashV,params,nocashe,transp){
        var rnd = Math.round(Math.random()*1048576);
        var flashID=bnFlash;
        if (bnFlash.indexOf('/')!=-1){
                flashID=bnFlash.split('/');
                flashID=flashID[flashID.length-1];
        }
        flashID=flashID.split('.');
        flashID=flashID[0];

        var flashHtm='';
        flashHtm+='<object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+bnW+'" height="'+bnH+'" id="'+flashID+'" align="middle">';
        flashHtm+='<param name="allowScriptAccess" value="sameDomain" />';
        flashHtm+=(nocashe)?'<param name="movie" value="'+bnFlash+'?rnd='+rnd+'" />':'<param name="movie" value="'+bnFlash+'" />';
        flashHtm+='<param name="quality" value="high" />';
        flashHtm+='<param name="flashVars" value="'+params+'" />';
        flashHtm+='<param name="bgcolor" value="#ffffff" />';
        if (!transp) flashHtm+='<param name="wmode" value="transparent" />';
        if (!transp)
        flashHtm+='<embed src="'+bnFlash+'" wmode="transparent" flashVars="'+params+'" quality="high" width="'+bnW+'" height="'+bnH+'" name="'+flashID+'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
        else
        flashHtm+='<embed src="'+bnFlash+'" flashVars="'+params+'" quality="high" width="'+bnW+'" height="'+bnH+'" name="'+flashID+'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
        flashHtm+='</object>';
        document.write(flashHtm);
}


$('#example20').bt({
  showTip: function(box){
    var $content = $('.bt-content', box).hide(); /* hide the content until after the animation */
    var $canvas = $('canvas', box).hide(); /* hide the canvas for a moment */
    var origWidth = $canvas[0].width; /* jQuery's .width() doesn't work on canvas element */
    var origHeight = $canvas[0].height;
    $(box).show(); /* show the wrapper, however elements inside (canvas, content) are now hidden */
    $canvas
      .css({width: origWidth * .5, height: origHeight * .5, left: origWidth * .25, top: origHeight * .25, opacity: .1})
      .show()
      .animate({width: origWidth, height: origHeight, left: 0, top: 0, opacity: 1}, 400, 'easeOutBounce',
        function(){$content.show()} /* show the content when animation is done */
        );
  },
  /* when using hideTip, do NOT forget 'callback' at end of animation */
  hideTip: function(box, callback){
    var $content = $('.bt-content', box).hide();
    var $canvas = $('canvas', box);
    var origWidth = $canvas[0].width;
    var origHeight = $canvas[0].height;
    $canvas
      .animate({width: origWidth * .5, height: origHeight * .5, left: origWidth * .25, top: origHeight * .25, opacity: 0}, 400, 'swing', callback); /* callback */
  },
  
  /* other options */
  shrinkToFit: true,
  hoverIntentOpts: {
    interval: 0,
    timeout: 0
  }
});

