
$(document).ready(function () {

	//Show hide login bar
	$('#test-bar').hide();
	$('#torqe-test-bar').click(function(){
		if ($('#test-bar:visible').length==0){
			$('#test-bar').slideDown(300);
			$(this).addClass("selected");
		}
		else {
			$('#test-bar').slideUp(300);
			$(this).removeClass("selected");
		}
	});

	
	//highlight image
	//$('.mask').hide();
	$('.img-wrapper a img').mouseover(function(){
		$(this)
			.parents('#col-2')
				//.find('.mask')
				//	.not($(this).parent('a').siblings('.mask')).stop()
				//		.show().stop().fadeTo(500,0.7);
		
		
			//.parents('#col-2')
				.find('.img-wrapper a img')
					.not(this)						
						.stop().fadeTo(300, 0.30);
						//.animate({opacity:0.7},200);		
	}).mouseout(function(){
		$(this)
			.parents('#col-2')
				//.find('.mask')
				//	.not($(this).parent('a').siblings('.mask'))
				//	.stop().fadeTo(500,0).hide();
				.find('.img-wrapper a img')				
					.not(this)
						.stop().fadeTo(250, 1);
					//	.animate({opacity:1},10);
		
		});

	//Scroll to Top
	$('.BTT').click(function(){
		$.scrollTo($('#wrapper'),400,{easing:'swing'});
	});
	
	//Clear textbox default value when focus	
	$("#search-box input[type=text], .two-column input[type=text], .two-column textarea")
		.css('color','#939393')
		.focus(function() {
			if( this.value == this.defaultValue ) {
				this.value = "";
				$(this).css('color','#383838');
			}
		})
		.blur(function() {
			if( !this.value.length ) {
				this.value = this.defaultValue;
				$(this).css('color','#939393');
			}
		});
$('.scontent').hide();
$('.scontent:first').show(); 
		

     $('.accordion-normal').click(function(){
		if ($(this).next('.accor').find('.scontent:visible').length!=0)  {
			var link=$(this).attr('link');
			window.location=link;
		}
		else {
		$(this)
			.next('.accor')
				.find('.scontent')
					.slideDown(350)
				.end()
			.end()
		.parents('.accordion').find('.accordion-normal').not(this).next('.accor').find('.scontent').slideUp(350);
		}
	 });



	
});