$(document).ready(function()
{
	//$("a[@rel*=lightbox]").lightBox({showInfo:false, showNavigation:false});
	//$("a[@rel*=lightboxset]").lightBox({showInfo:true, showNavigation:true, fixedNavigation:true, txtImage: 'Фотография',txtOf: 'из'});
	linkrel();
	//$(document.body).disableTextSelect();
	$("#toblog").bind("click", function(){toblog(); return false;});
	$("#tomainpage").bind("click", function(){tomainpage(); return false;});
});

function openYear(year)
{
	$('.gratitude-box').hide();
	
	if (year!=777) $('.gratitude-year-'+year).show(); else $('.gratitude-box').show();
	
	$('.gratitude-navi>a').removeClass("year_select");
	$('.gratitude-navi-'+year+'>a').addClass("year_select");
}

function linkrel()
{
	$(".r>p>a").attr("rel", "lightbox");
	$(".r>a").attr("rel", "lightbox");
}

function toblog()
{
	document.location='http://www.blog.butik-idei.com';
}

function tomainpage()
{
	document.location=main_url;
}

function ViewMenu(id, count)
{
	var autoclose = true;
	var box = document.getElementById('cat_box_'+id);

	if (box.style.display!='block')
	{	
		if (autoclose)
		for (i=1; i<count+1; i++)
		{
			if (i!=id) $('#cat_box_'+i).hide();
		}
		
		box.style.display = 'block';
	}
	else box.style.display = 'none';
}



function ViewSubMenu(id, own, count)

{

	var autoclose = true;

	var box = document.getElementById('cat_box_'+own+'_'+id);

	

	if (box.style.display!='block')

	{	

		if (autoclose)

		for (i=1; i<count+1; i++)

		{

			if (i!=id) document.getElementById('cat_box_'+own+'_'+i).style.display = 'none';

		}

		

		box.style.display = 'block';

	}

	else box.style.display = 'none';

}

function ShowWork(id)
{
	var box = document.getElementById('me_w'+id);
	
	if (box.style.display!='block')
	{	
		box.style.display = 'block';
	}
	else box.style.display = 'none';	
}

function play_flash(url,flash,img,w,h,bg)
{
	if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
	   && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0)) {
		document.write('<SCRIPT LANGUAGE=VBScript\> \n');
		document.write('on error resume next \n');
		document.write('plugin=( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash")))\n');
		document.write('</SCRIPT\> \n');
	}
//<EMBED wmode="opaque"></EMBED><param value="transparent" name="wmode"><PARAM name="wmode" value="opaque">
	if ( plugin ) 
	{
		document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="'+w+'" HEIGHT="'+h+'" id="'+flash+'" ALIGN=""><PARAM NAME="wmode" VALUE="transparent"><PARAM NAME=movie VALUE="'+flash+'"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE='+bg+'> <EMBED src="'+flash+'" wmode="opaque" quality=high bgcolor='+bg+'  WIDTH="'+w+'" HEIGHT="'+h+'" NAME="'+flash+'" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>');
	} 
	else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0) && img>0)
	{
		document.write('<a href="'+url+'"><img src="'+img+'" width="'+w+'" height="'+h+'" border="0"></a>');
	}
} 
