
var txtSize;
var currentTg = 0;

//---------------------------------------------------- IE

hideOutline = function(){
	$('a').focus(function(){$(this).blur();});
};

if(jQuery.browser.msie){
	$(document).ready(function(){
			hideOutline();
			$('.area').focus(function(){
				$(this).addClass('focus');
			}).blur(function(){
				$(this).removeClass('focus');
			});
	});
};


//---------------------------------------------------- tab

function tabset(){
	$('.ac').accordion();
	$('.toggle:first').click();
};

//---------------------------------------------------- 

function checkHeight(){
    var h = $('.inner-middle').height();
    var h2 = $('.inner-bottom').height();
				$('.inner-bottom').css('background-position','bottom left')
};

//--------------------------------------------------------- blank link

function blankLink(){
 $("h4 a[target='_blank'], .spbox .title a[target='_blank']").after(' <span><img src="/img/share/ico_link.gif" alt="icon" align="absmiddle" /></span>');
};


//-------------------------------------------------------- domready

$(document).ready(function() {

//-------------------------------------------------------- system list

  $('.arr_ist li:nth-child(3n+1)').css('clear', 'left');

//-------------------------------------------------------- text size

	if($.cookie('txtSize2')){
		txtSize2 = $.cookie('txtSize2');
	}else{
		txtSize2 = 'txt-middle';
		$.cookie('txtSize2', txtSize2, {expires: 7,path:'/'})
	}
	$('body').addClass(txtSize2);
	
	$('#txtsize a').click(function(){
		var tgSize = $(this).attr('id');
		$('body').removeClass(txtSize2).addClass(tgSize);
		txtSize2 = tgSize;
		$.cookie('txtSize2', txtSize2, {expires: 7,path:'/'});
	});

//-------------------------------------------------------- scroll to

	$('a[href*=#container]').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
			var target = $(this.hash);
			target = target.length && target;
			if (target.length) {
				var sclpos = 30;
				var scldurat = 1200;
				var targetOffset = target.offset().top - sclpos;
				$('html,body').animate({scrollTop: targetOffset}, {duration: scldurat, easing: "easeOutExpo"});
				return false;
			}
		}
	});

//--------------------------------------------------------- IE 6 hover	
	
	$('.btn_search').hover(
		function(){
			$(this).css('background-position','-70px -244px')
		},
		function(){
			$(this).css('background-position','0px -244px')												
		}
	);
	

});


//--------------------------------------------------------- accordion	

(function($){ 
	$.fn.extend({  
		accordion: function() {       
			return this.each(function() {				
				if($(this).data('accordiated'))
				return false;
				
				$.each($(this).find('ul, li>div'), function(){
					$(this).data('accordiated', true);
					$(this).hide();
				});
				$.each($(this).find('a'), function(){
					$(this).click(function(e){
					$(e.target).parent('li').toggleClass('active').siblings().removeClass('active').children('ul, div').slideUp('slow');
					$(e.target).siblings('ul, div').slideToggle('slow');
					return void(0);
					});
				});
			});
		} 
	}); 
})(jQuery);



setin = window.onload;
window.onload = ocm;

function ocm() {
 if(document.getElementById && !window.opera){
  t=document.getElementsByTagName('body');
  (!document.all)?t[0].setAttribute('oncontextmenu','return(ocmReturn()); ') : t[0].oncontextmenu=ocmReturn;
 }
 if(setin)setin();
}

function ocmReturn(){return false;}
