var mySound = {};
    var play = '0';

    soundManager.url = './soundmanager2.swf'; // url swf файла
    // инициализируем soundManager
function load_sound(sound_file)
{
        if  (play == 1)
		{
			mySound.stop();
			soundManager.destroySound('aSound');
			play = 0;
		}
        mySound = soundManager.createSound({
            id: 'aSound',
            url: './sound/' + sound_file, // url mp3 файла
            volume: 50, // громкость воспроихводимого файла
            autoLoad: true,
            autoPlay: true,
            onplay: function(){play = 1;}
        });
}

function set_tips()
{

	$$('.tip-wrap').setStyle('display', 'none');

	$$('.tips').each(function(element,index) {
		var content = element.get('title').split('::');
		element.store('tip:title', content[0]);
		element.store('tip:text', content[1]);
	});

	var Tips2 = new Tips($$('.tips'),{className: 'tip-wrap'});

	Tips2.addEvents({
		'show': function(tip) {
			tip.fade('in');
		},
		'hide': function(tip) {
			tip.fade('out');
		}
	});

}


function get_portfolio_content(albom_ident,sort)
{
	var get_portfolio = new Request.HTML(
		{
			url:'./view_portfolio.php',
			method: 'post',
			async: 'false',
			evalResponse: true,
			evalScripts: true,
			onSuccess: function(html) {
			    $('content_portfolio').set('text', '');
			    //$('content_portfolio').setStyle('color', '#ffffff');
				$('content_portfolio').adopt(html);
				set_tips();
			},
			onFailure: function() {
				$('content').set('text', 'The request failed.');
			}
		}).send('albom=' + albom_ident + '&sort=' + sort);
}
