function hideLoading() { 
$('#ajax-loader').hide();
if($.browser.msie)$("#pageIsLoading").hide(); 
else $("#pageIsLoading").fadeOut('slow');
};

$(document).ready(function() {
//эффект затемнения при уходе с страницы
/*$("a.trans").click(function(event){
event.preventDefault();
linkLocation = this.href;
$("table.maintable").fadeOut(1000, redirectPage);
});
function redirectPage() { window.location = linkLocation; }*/

// TOPMENU ready function
$('.jimgMenu ul').kwicks({max: 310, duration: 300, easing: 'easeOutQuad'});

/*
звуки html
<audio preload="auto" id="menu"> <source src="http://www.dosmix.com/uploads/menutop.ogg"> </audio>
<audio preload="auto" id="click"> <source src="http://www.dosmix.com/uploads/click.ogg"> </audio>
звуки html

$(".jimgMenu a").mouseenter(function() { $("#menu")[0].play(); });

$("a, input[type=button], input[type=submit], input[type=image], .release, .new_release, .new_release_forum").click(function() { $("#click")[0].play(); });
*/

$(".release, .new_release, .new_release_forum, .mservice_tracklist").hover(function(){
$(this).addClass('hover');},function() { $(this).removeClass('hover');}).click(function(){
window.location = $(this).find("a").attr("href"); return false;});

$('input:not(input[type=button], input[type=submit], input[type=image], input[type=reset], input[type=checkbox], input[type=radio]), select, textarea').focus(function() {$(this).addClass('textfield_a')}).blur(function(){$(this).removeClass('textfield_a')});

$('.download_button').text('PRIMARY');
$('.download_button').hover(function() {
$(this).text('DOWNLOAD');
},function() {
$(this).text('PRIMARY');
});
$('.download_button_secondary').hover(function() {
$(this).text('DOWNLOAD');
},function() {
$(this).text('SECONDARY');
});

$('.download_button_vip').hover(function() {
$(this).text('VIP ONLY');
},function() {
$(this).text('PRIMARY');
});

$('.release_top_cover').hover(function() {
$(this).addClass('release_top_cover_a');
},function() {
$(this).removeClass('release_top_cover_a');
});

$('#btop a').hover(function() {
$(this).animate({'width':'27px'}, 100);
},function() {
$(this).animate({'width':'24px'}, 100);
});

// Click Overlay close all window
$('#overlay').dblclick(function() {
closeForm('vip'); closeForm('unmix'); closeForm('unmixCD2'); closeForm('fanComments'); closeForm('addComments'); closeForm('iFrame');
});

// ESC close all window
$(document).keydown(function(e) {
if (e.which == 27) {hideLoading(); closeForm('vip'); closeForm('unmix'); closeForm('unmixCD2'); closeForm('fanComments'); closeForm('addComments'); closeForm('iFrame');}
});

// tinyTips ready(function)
$('a.tTip').tinyTips('light', 'title');

// iFrame Modal Window
$('.iframe').click(function(event) {
	$('#formFrame').attr('src',$(this).attr('href')).attr('width',$(this).attr('width')+'px').attr('height',$(this).attr('height')+'px');
	$('.iframe-window-title').text($(this).attr('title'));
	var mLeftPlus = parseInt($(this).attr('width')) + 20;
	var mTopPlus = parseInt($(this).attr('height')) + 100;
	var mLeft = '-' + Math.round(mLeftPlus / 2) + 'px';
	var mTop = '-' + Math.round(mTopPlus / 2) + 'px';
	$('.iframe-window').css({'marginLeft':mLeft, 'marginTop':mTop});
	if($.browser.msie)$('#overlay, #loading').show();
	else $('#overlay, #loading').fadeIn('slow');
	$('#formFrame').load(function() {
		$('#iFrame-window').show();
		$(this).show();
		$('#loading').hide();
	});
	event.preventDefault();
});

}); // Конец ready(function)

// Плавный переход к якорю
function goTo(id) {
var op = $.browser.opera ? $("html") : $("html, body");
op.animate({ scrollTop: $("#"+id).offset().top }, 1000);
};

function tracklist(e) {
var idCD =  '#tracklist' + e;
$(idCD).slideToggle("slow");
};

function showCD1() {
$('#CD1').slideDown(700);
$('#CD2, #tracklistCD1, #tracklistCD2, #view_comm').hide();
};
function showCD2() {
$('#CD2').slideDown(700);
$('#CD1, #tracklistCD1, #tracklistCD2, #view_comm').hide();
};

function showForm(e) {
var idForm =  '#' + e + '-window';
var mLeftPlus = parseInt($(idForm).width());
var mLeft = '-' + Math.round(mLeftPlus / 2) + 'px';
$(idForm).css('marginLeft', mLeft).show();
if($.browser.msie)$('#overlay').show();
else $('#overlay').fadeIn('slow');
};

function closeForm(e) {
var idForm =  '#' + e + '-window';
$(idForm).hide(); $('#loading').hide();
if($.browser.msie)$('#overlay').hide();
else $('#overlay').fadeOut('slow');
};

function comToggle(e) {
var idComment =  '#' + e;
$(idComment).slideToggle("slow");
};

// Overlay загрузка трека
function show_down() { $('#overlay, #loading').show(); };

// windowOpen
function windowOpen(theURL) { window.open(theURL,'','toolbar=0,status=0,width=490,height=450,scrollbars=0,') };

// добавить страницу в закладки
function addBookmark(a) {title=document.title;url=document.location;try{window.external.AddFavorite(url,title);}catch(e){try{window.sidebar.addPanel(title,url,"");}catch(e){if (typeof(opera)=="object"){a.rel="sidebar";a.title=title;a.url=url;return true;}else{alert('Нажмите Ctrl-D чтобы добавить страницу в закладки');}}}return false;}

// jquery-kwicks-1-5-1.js TOPMENU
(function($){$.fn.kwicks=function(n){var p={isVertical:false,sticky:false,defaultKwick:0,event:'mouseover',spacing:0,duration:500};var o=$.extend(p,n);var q=(o.isVertical?'height':'width');var r=(o.isVertical?'top':'left');return this.each(function(){container=$(this);var k=container.children('li');var l=k.eq(0).css(q).replace(/px/,'');if(!o.max){o.max=(l*k.size())-(o.min*(k.size()-1))}else{o.min=((l*k.size())-o.max)/(k.size()-1)}if(o.isVertical){container.css({width:k.eq(0).css('width'),height:(l*k.size())+(o.spacing*(k.size()-1))+'px'})}else{container.css({width:(l*k.size())+(o.spacing*(k.size()-1))+'px',height:k.eq(0).css('height')})}var m=[];for(i=0;i<k.size();i++){m[i]=[];for(j=1;j<k.size()-1;j++){if(i==j){m[i][j]=o.isVertical?j*o.min+(j*o.spacing):j*o.min+(j*o.spacing)}else{m[i][j]=(j<=i?(j*o.min):(j-1)*o.min+o.max)+(j*o.spacing)}}}k.each(function(i){var h=$(this);if(i===0){h.css(r,'0px')}else if(i==k.size()-1){h.css(o.isVertical?'bottom':'right','0px')}else{if(o.sticky){h.css(r,m[o.defaultKwick][i])}else{h.css(r,(i*l)+(i*o.spacing))}}if(o.sticky){if(o.defaultKwick==i){h.css(q,o.max+'px');h.addClass('active')}else{h.css(q,o.min+'px')}}h.css({margin:0,position:'absolute'});h.bind(o.event,function(){var c=[];var d=[];k.stop().removeClass('active');for(j=0;j<k.size();j++){c[j]=k.eq(j).css(q).replace(/px/,'');d[j]=k.eq(j).css(r).replace(/px/,'')}var e={};e[q]=o.max;var f=o.max-c[i];var g=c[i]/f;h.addClass('active').animate(e,{step:function(a){var b=f!=0?a/f-g:1;k.each(function(j){if(j!=i){k.eq(j).css(q,c[j]-((c[j]-o.min)*b)+'px')}if(j>0&&j<k.size()-1){k.eq(j).css(r,d[j]-((d[j]-m[i][j])*b)+'px')}})},duration:o.duration,easing:o.easing})})});if(!o.sticky){container.bind("mouseleave",function(){var c=[];var d=[];k.removeClass('active').stop();for(i=0;i<k.size();i++){c[i]=k.eq(i).css(q).replace(/px/,'');d[i]=k.eq(i).css(r).replace(/px/,'')}var e={};e[q]=l;var f=l-c[0];k.eq(0).animate(e,{step:function(a){var b=f!=0?(a-c[0])/f:1;for(i=1;i<k.size();i++){k.eq(i).css(q,c[i]-((c[i]-l)*b)+'px');if(i<k.size()-1){k.eq(i).css(r,d[i]-((d[i]-((i*l)+(i*o.spacing)))*b)+'px')}}},duration:o.duration,easing:o.easing})})}})}})(jQuery);

// jquery-easing-1-3.js TOPMENU
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('h.i[\'1a\']=h.i[\'z\'];h.O(h.i,{y:\'D\',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,c,d){6 c*(t/=d)*t+b},D:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},X:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},U:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},R:9(x,t,b,c,d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w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.j(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},T:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.j(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},F:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},E:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},16:9(x,t,b,c,d,s){e(s==u)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.B))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.B))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.i.v(x,d-t,0,c,d)+b},v:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.14/2.k))*t+.11)+b}m{6 c*(7.q*(t-=(2.18/2.k))*t+.19)+b}},1b:9(x,t,b,c,d){e(t<d/2)6 h.i.A(x,t*2,0,c,d)*.5+b;6 h.i.v(x,t*2-d,0,c,d)*.5+c*.5+b}});',62,74,'||||||return||Math|function|||||if|var|PI|jQuery|easing|pow|75|70158|else|sin|sqrt||5625|asin|||undefined|easeOutBounce|abs||def|swing|easeInBounce|525|cos|easeOutQuad|easeOutBack|easeInBack|easeInSine|easeOutElastic|easeInOutQuint|easeOutQuint|easeInQuint|easeInOutQuart|easeOutQuart|easeInQuart|extend|easeInElastic|easeInOutCirc|easeInOutCubic|easeOutCirc|easeInOutElastic|easeOutCubic|easeInCirc|easeInOutExpo|easeInCubic|easeOutExpo|easeInExpo||9375|easeInOutSine|easeInOutQuad|25|easeOutSine|easeInOutBack|easeInQuad|625|984375|jswing|easeInOutBounce'.split('|'),0,{}))

// ajax_framework SEARCH
function createObject(){var request_type;var browser=navigator.appName;if(browser=="Microsoft Internet Explorer"){request_type=new ActiveXObject("Microsoft.XMLHTTP")}else{request_type=new XMLHttpRequest()}return request_type}var http=createObject();function autosuggest(){q=document.getElementById('search-q').value;nocache=Math.random();http.open('get','/search.php?q='+q+'&nocache = '+nocache);http.onreadystatechange=autosuggestReply;http.send(null)}function autosuggestReply(){if(http.readyState==4){var response=http.responseText;e=document.getElementById('results');if(response!=""){e.innerHTML=response;e.style.display="block"}else{e.style.display="none"}}}function autosuggestClose(){e=document.getElementById('results');e.style.display="none"}

// tinyTips
(function(a){a.fn.tinyTips=function(h,b){if(h==="null"){h="light"}var d=h+"Tip";var c='<div class="'+d+'"><div class="content"></div><div class="bottom">&nbsp;</div></div>';var e=300;var f;var g;a(this).hover(function(){a("body").append(c);var k="div."+d;f=a(k);f.hide();if(b==="title"){var i=a(this).attr("title")}else{if(b!=="title"){var i=b}}a(k+" .content").html(i);g=a(this).attr("title");a(this).attr("title","");var m=f.height()+2;var j=(f.width()/2)-(a(this).width()/2);var n=a(this).offset();var l=n;l.top=n.top-m;l.left=n.left-j;f.css("position","absolute").css("z-index","1000");f.css(l).fadeIn(e)},function(){a(this).attr("title",g);f.fadeOut(e,function(){a(this).remove()})})}})(jQuery);

