function winop(){windop=window.open("http://www.masseffect2.in/index/0-9","mywin","height=420,width=310,left=100,top=30,resizable=yes")};
function winopb(){windop=window.open("http://www.masseffect3.in/index/0-5","mywin","height=420,width=310,left=100,top=30,resizable=yes")};
function chatopen(){windop=window.open("http://www.masseffect2.in/adminchat.html","mywin","height=420,width=310,left=100,top=30,resizable=yes")};

$(document).ready(function(){ 

 $('#closechat').click (function() {
  $('#adminchat').fadeOut('slow');
  $('#adminchatlink').fadeIn('slow');
 });

 $('#closechat2').click (function() {
  $('#adminchat').fadeOut('slow');
  $('#adminchatlink').fadeIn('slow');
 });

 $('#showchat').click (function() {
  $('#adminchat').fadeIn('slow');
  $('#adminchatlink').fadeOut('slow');
 });

});


function show(obj){if(document.getElementById(obj).style.display=='none')document.getElementById(obj).style.display='block';else document.getElementById(obj).style.display='none'}function createBookmark(name){we=window.external;if(!we){return true}else{we.addFavorite('http://www.masseffect2.in/',name);return false}}onload=function(){for(var lnk=document.links,j=0;j<lnk.length;j++)if(lnk[j].href==document.URL)lnk[j].style.color='white'}

setTimeout(function() {
jQuery(document).ready(function($){
		$("div.fw_tabs_tabdisplay").each(function(i){
			$(this).attr("id" , $(this).attr("id").replace('_x',''));
			totalWidth = $(this).width();
			control_margin = 20;			
			cumulativeTabWidth = 0;
			previousRoundedUp = 1;
			currentTabLevel = 1;
			$("li.tab", $(this)).each(function(ti){
				$(this).find("h3.fwTabTitle").click( fwst_display_tab )
				cumulativeTabWidth += $(this).width(); 
				widthRatio = ( cumulativeTabWidth + control_margin ) / totalWidth;
				if ( widthRatio > previousRoundedUp ) {
					cumulativeTabWidth = ( totalWidth * previousRoundedUp )  + $(this).width();
				}
				if ( widthRatio > 1 ) { widthRatio = ( cumulativeTabWidth + (control_margin * 2) ) / totalWidth; } 
				$(this).addClass('fwttl'+Math.ceil( widthRatio ));
				if ( widthRatio > 1 ){ 
					$(this).css("display","none"); 
				}
				if ( widthRatio > previousRoundedUp ){ 
					if ( previousRoundedUp > 1 ) {
						$("<li><h3>+</h3></li>").addClass('tab').css("display","none").addClass('fwttl'+previousRoundedUp).click(fwst_display_tab_level).insertBefore($(this));
					} else {
						$("<li><h3>+</h3></li>").addClass('tab').addClass('fwttl'+previousRoundedUp).click(fwst_display_tab_level).insertBefore($(this));
					}
					$("<li><h3>-</h3></li>").addClass('tab').css("display","none").addClass('fwttl'+Math.ceil( widthRatio )).click(fwst_display_tab_level).insertBefore($(this));
				}
				previousRoundedUp = Math.ceil( widthRatio );
			});
			$('li.tab:first h3.fwTabTitle' ,$(this)).click();
		});
		function fwst_display_tab( eventObject ){
			$(this).parents('ul').children('li').find('h3.fwTabTitle').removeClass('selected');
			$(this).addClass('selected');
			$(this).parents('div.fw_tabs_tabdisplay').children('div').fadeOut('fast');
			$(this).parents('div.fw_tabs_tabdisplay').children('div').queue( function(clicked){
				$(this).empty();
				$(this).append($(this).parents('div.fw_tabs_tabdisplay').find('ul li h3.fwTabTitle.selected').siblings('div.tab-content').clone(true));
				$(this).dequeue();
				}
			)
			$(this).parents('div.fw_tabs_tabdisplay').children('div').fadeIn('fast');
		}
		function fwst_display_tab_level ( eventObject ){
			$( 'li.fwttl'+ currentTabLevel , $(this).parents('div.fw_tabs_tabdisplay') ).hide();
			if ( $("h3" , $(this)).text() == '+' ){ 
				$( 'li.fwttl'+ (currentTabLevel+1) , $(this).parents("ul") ).show(); 
				currentTabLevel++;
				}
			if ( $("h3" , $(this)).text() == '-' ){ 
				$( 'li.fwttl'+ (currentTabLevel-1) , $(this).parents("ul") ).show(); 
				currentTabLevel--;
				}
		}
     });
});

$(document).ready(function(){

 $('a.all').click(function () {
 $('div.all-block').show();
 $('div.ug-block').hide();
 $('div.st-block').hide();
 $('div.do-block').hide();
 $('div.nd-block').hide();
 $('div.mini-block').hide();
 $('div.az-block').hide();
 return false;
 });

 $('a.ug').click(function () {
 $('div.ug-block').show();
 $('div.all-block').hide();
 $('div.st-block').hide();
 $('div.do-block').hide();
 $('div.nd-block').hide();
 $('div.mini-block').hide();
 $('div.az-block').hide();
 return false;
 });
 
 $('a.st').click(function () {
 $('div.st-block').show();
 $('div.all-block').hide();
 $('div.ug-block').hide();
 $('div.do-block').hide();
 $('div.nd-block').hide();
 $('div.mini-block').hide();
 $('div.az-block').hide();
 return false;
 });
 
 $('a.do').click(function () {
 $('div.do-block').show();
 $('div.all-block').hide();
 $('div.ug-block').hide();
 $('div.st-block').hide();
 $('div.nd-block').hide();
 $('div.mini-block').hide();
 $('div.az-block').hide();
 return false;
 });

 $('a.nd').click(function () {
 $('div.nd-block').show();
 $('div.all-block').hide();
 $('div.ug-block').hide();
 $('div.st-block').hide();
 $('div.do-block').hide();
 $('div.mini-block').hide();
 $('div.az-block').hide();
 return false;
 });
 
 $('a.mini').click(function () {
 $('div.mini-block').show();
 $('div.all-block').hide();
 $('div.ug-block').hide();
 $('div.st-block').hide();
 $('div.nd-block').hide();
 $('div.do-block').hide();
 $('div.az-block').hide();
 return false;
 });
 
  $('a.az').click(function () {
 $('div.az-block').show();
 $('div.mini-block').hide();
 $('div.all-block').hide();
 $('div.ug-block').hide();
 $('div.st-block').hide();
 $('div.nd-block').hide();
 $('div.do-block').hide();
 return false;
 });

 if (Math.floor(Math.random()*99999999/1)){$('a.all').click();}
 });

function socializ(u,t) {
	var f = 'http://www.masseffect2.in/design/forumicons/';
	document.write('<div id="socializ"></div>');
	var s = $('#socializ');
	s.append(
		'<div id="soc1">' +
		'<a href="http://twitter.com/home?status=' + t + ' - ' + u + '" title="Twitter"><img src="' + f + 'twitter.png" alt="" /></a>' +
		'<a href="http://www.google.com/reader/link?url=' + u + '&title=' + t + '&srcURL=http://dimox.name/" title="Google Buzz"><img src="' + f + 'google-buzz.png" alt="" /></a>' +
		'<a href="http://www.friendfeed.com/share?title=' + t + ' - ' + u + '" title="FriendFeed"><img src="' + f + 'friendfeed.png" alt="" /></a>' +
		'<a href="http://www.facebook.com/sharer.php?u=' + u + '" title="Facebook"><img src="' + f + 'facebook.png" alt="" /></a>' +
		'<a href="http://vkontakte.ru/share.php?url=' + u + '" title="vKontacte"><img src="' + f + 'vkontakte.png" alt="" /></a>' +
		'<a href="http://connect.mail.ru/share?share_url=' + u + '" title="MoyMir"><img src="' + f + 'moy-mir.png" alt="" /></a>' +
		'<a href="http://www.livejournal.com/update.bml?event=' + u + '&subject=' + t + '" title="livejournal"><img src="' + f + 'livejournal.png" alt="" /></a>' +
		'<a href="http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk=' + u + '&title=' + t + '" title="Google"><img src="' + f + 'google.png" alt="" /></a>' +
		'<a href="http://bobrdobr.ru/add.html?url=' + u + '&title=' + t + '" title="Bobr"><img src="' + f + 'bobrdobr.png" alt="" /></a>' +
		'<a href="http://memori.ru/link/?sm=1&u_data[url]=' + u + '&u_data[name]=' + t + '" title="Memori М"><img src="' + f + 'memori.png" alt="" /></a>' +
		'</div>' +
	'');
	s.find('a').attr({target: '_blank'}).css({opacity: 0.5}).hover(
		function() { $(this).css({opacity: 1}); },
		function() { $(this).css({opacity: 0.7}); }
	);
	s.hover(
		function() { $(this).find('a').css({opacity: 0.7}); },
		function() { $(this).find('a').css({opacity: 0.5}); }
	);
}


$(function(){var scroll_timer;var displayed=false;var $message=$('#gotopmess');var $window=$(window);var top=$(document.body).children(0).position().top;$window.scroll(function(){window.clearTimeout(scroll_timer);scroll_timer=window.setTimeout(function(){if($window.scrollTop()<=top) {displayed=false;$message.fadeOut(500);} else if(displayed==false) {displayed=true;$message.stop(true,true).fadeIn(500).click(function(){$message.fadeOut(500);});}},100);});$('#top-link').click(function(e){e.preventDefault();$.scrollTo(0,1000);});});

function show_one(){
	document.getElementById('onea').style.display='inline',
	document.getElementById('onep').style.display='none',
	document.getElementById('twoa').style.display='none',
	document.getElementById('twop').style.display='inline',
	document.getElementById('threa').style.display='none',
	document.getElementById('threp').style.display='inline',

	document.getElementById('rasskaz').style.display='inline'
	document.getElementById('stih').style.display='none';
	document.getElementById('stattya').style.display='none';

	}

function show_two(){
	document.getElementById('onea').style.display='none',
	document.getElementById('onep').style.display='inline',
	document.getElementById('twoa').style.display='inline',
	document.getElementById('twop').style.display='none',
	document.getElementById('threa').style.display='none',
	document.getElementById('threp').style.display='inline',

	document.getElementById('rasskaz').style.display='none'
	document.getElementById('stih').style.display='inline';
	document.getElementById('stattya').style.display='none';
	}


function show_three(){
	document.getElementById('onea').style.display='none',
	document.getElementById('onep').style.display='inline',
	document.getElementById('twoa').style.display='none',
	document.getElementById('twop').style.display='inline',
	document.getElementById('threa').style.display='inline',
	document.getElementById('threp').style.display='none',

	document.getElementById('rasskaz').style.display='none'
	document.getElementById('stih').style.display='none';
	document.getElementById('stattya').style.display='inline';
	}

$(document).ready(function(){ 
$('#page').val(document.URL);
$('#fakeemail').val('boyan@masseffect2.in');
$('#openboyan').click(function() { 
 if ($("#boyan").is(":hidden")) {
  $("#boyan").slideDown("slow");
  $("#embed").slideUp("slow");
  $("#miscat").slideUp("slow");
} else {$("#boyan").slideUp("slow");} } );
});
