/*
		JQuery  dim
		search tab  
		2010-11-1 
	    ASTO  jiaohaota
*/
	jQuery(function($) {
		//$('.tab_fst h2').addClass('selected').after($('.tab_sec h2'), $('.tab_trd h2'));
		//$('.tab_content:gt(0)').insertAfter('.tab_content:eq(0)').hide();
		//$('.tab_sec, .tab_trd').remove();
		$('.tab_fst h2').wrapAll('').click(function() {
			$(this).addClass('selected').siblings().removeClass('selected');
			var i = $('.tab_fst h2').index(this);
			//modified by Ryan on 2010.11.04
			if(i==0){
				if($('#keywords').attr("value")=="Please input keywords to search selling leads:"||
				   $('#keywords').attr("value")=="Please input keywords to search news and price:"){
					$('#keywords').attr("value","Please input keywords to search buying leads:");
				}
				$('#buyOrSell').attr("value","0");
			}
			else if(i==1){
				if($('#keywords').attr("value")=="Please input keywords to search buying leads:"||
					$('#keywords').attr("value")=="Please input keywords to search news and price:"){
					$('#keywords').attr("value","Please input keywords to search selling leads:");
				}
				$('#buyOrSell').attr("value","1");
			}
			else if(i==2){
				if($('#keywords').attr("value")=="Please input keywords to search buying leads:"||
					$('#keywords').attr("value")=="Please input keywords to search selling leads:"){
					$('#keywords').attr("value","Please input keywords to search news and price:");
				}
				$('#buyOrSell').attr("value","-1");
			}
			//$('.tab_content').eq(i).fadeIn(100).siblings(".tab_content").hide();
		});
	});
	
/*
		JQuery  dim
		mainRight tab  
		2010-11-2 
	    ASTO  jiaohaota
*/	
	jQuery(function($) {
		//$('.tab_fst h2').addClass('selected').after($('.tab_sec h2'), $('.tab_trd h2'));
		$('.rightFstTab_content:gt(0)').insertAfter('.rightFstTab_content:eq(0)').hide();
		$('.rightFstTab_sec, .rightFstTab_trd').remove();
		$('.rightFstTab_fst h3').click(function() {
			$(this).addClass('rightFstTabSelected').siblings().removeClass('rightFstTabSelected');
			var i = $('.rightFstTab_fst h3').index(this);
			$('.rightFstTab_content').eq(i).fadeIn(800).siblings(".rightFstTab_content").hide();
		});
	});
	
	jQuery(function($) {
		//$('.tab_fst h2').addClass('selected').after($('.tab_sec h2'), $('.tab_trd h2'));
		$('.rightSecTab_content:gt(0)').insertAfter('.rightSecTab_content:eq(0)').hide();
		$('.rightSecTab_sec, .rightSecTab_trd').remove();
		$('.rightSecTab_fst h3').click(function() {
			$(this).addClass('rightSecTabSelected').siblings().removeClass('rightSecTabSelected');
			var i = $('.rightSecTab_fst h3').index(this);
			$('.rightSecTab_content').eq(i).fadeIn(800).siblings(".rightSecTab_content").hide();
		});
	});
