	function get_studies_data(pair_ID, time_frame) {
		$.get('/common/technical_studies/technical_studies_data.php', { action: 'get_studies', pair_ID:pair_ID, time_frame:time_frame }, function(data) {

			var res = data.split(';');
			//$('#box_quote_name').html(res[0].split('=')[1]);
			$('#quote_link').html(res[0].split('=')[1]);
			$('#quote_link').attr('href', res[21].split('=')[1]);
			$('#last_last').html(res[1].split('=')[1]);
			$('#last_last').css('color',res[2].split('=')[1]);
			$('#actual_arrow_image').attr('class','technicalStudies ' + res[3].split('=')[1].toLowerCase());
			$('#currency_time').html(res[4].split('=')[1]);
			$('#ti_buy').html(res[5].split('=')[1]);
			$('#ti_sell').html(res[6].split('=')[1]);
			$('#ma_buy').html(res[7].split('=')[1]);
			$('#ma_sell').html(res[8].split('=')[1]);
			$('#scoreboard_link').attr('href', res[22].split('=')[1]);
			$('#studies_summary_image').attr('src',res[9].split('=')[1]);
			$('#S1').html(res[10].split('=')[1]);
			$('#S2').html(res[11].split('=')[1]);
			$('#S3').html(res[12].split('=')[1]);
			$('#pivot').html(res[13].split('=')[1]);
			$('#R1').html(res[14].split('=')[1]);
			$('#R2').html(res[15].split('=')[1]);
			$('#R3').html(res[16].split('=')[1]);
//			$('#ma_link').unbind('click').click(function() {build_studies_link( res[17].split(',')[1], 'moving_averages_title_block' );});
//			$('#ti_link').unbind('click').click(function() {build_studies_link( res[17].split(',')[1], 'technical_indicators_title_block' );});
			$('#ma_link').attr('href',res[17].split(',')[1] + '#moving_averages_title_block');
			$('#ti_link').attr('href',res[17].split(',')[1] + '#technical_indicators_title_block');
			$('#actual_arrow_image').attr('alt',res[18].split('=')[1]).attr('title',res[18].split('=')[1]);
			var bullish_percent = res[19].split('=')[1];
			var bearish_percent = res[20].split('=')[1];
			if(bullish_percent=='0%' && bearish_percent=='0%') {
				bullish_percent='50%';
				bearish_percent='50%'; 
			}
			$('#sentiment_bullish_percent').html(bullish_percent);
			$('#sentiment_bearish_percent').html(bearish_percent);
			$('#sent_ind_c_green').css('width',bullish_percent);
			$('#studies_summary_image').attr('height',res[23].split('=')[1]);
			$('#studies_summary_image').attr('width',res[24].split('=')[1]);
		});
	}

	// Pairs Top Tabs
	/*function change_tabs(newTab,newTabID,currTabID) {
		var currPairID = document.getElementById("pairID").value;
		currPairID = parseInt( currPairID );
		// remove highlight from current tab
		if ($('#tab_'+currPairID).is('.tabs7_1')) { // first tab
			$('#tab_'+currPairID).removeClass('tabs7_1').addClass('tabs7_1_off');
			//alert('first');
		} else { 
			$('#tab_'+currPairID).removeClass('tabs8_1').addClass('tabs8_1_off');
			//alert('second');
		}
		$('#tabs7_2_'+currPairID).removeClass('tabs7_2').addClass('tabs7_2_off');
		document.getElementById("pairID").value = newTabID;

		if ($(newTab).parent().is('.tabs7_1_off')) { // first tab
			$(newTab).parent().removeClass('tabs7_1_off').addClass('tabs7_1');
		} else {
			$(newTab).parent().removeClass('tabs8_1_off').addClass('tabs8_1');
		}
		$(newTab).parent().parent().siblings().each(function(){ 
				if($(this).is('.tabs7_2_off')) {
					$(this).removeClass('tabs7_2_off').addClass('tabs7_2');
				}
			}
		);
		$('#tabs7_2_'+newTabID).removeClass('tabs7_2_off').addClass('tabs7_2');
	}*/
	
	function OnClickHandler(Element) {  
		var pair_id = $(Element).attr("id"); 
		get_studies_data( pair_id.substr(11), $('#time_frame').attr('value') );
		$(Element).addClass('Selected').unbind("click").siblings().each(function() { $(this).removeClass('Selected').unbind("click").click(function() {OnClickHandler(this)}); });
	}
	// End Pairs Top Tabs

	// TimeFrames Tabs 
	function change_timeframes_tabs(newTab,newTabID,currTabID) {
		var curr_time_frame = document.getElementById("time_frame").value;
		
		curr_time_frame = parseInt( curr_time_frame );
		// remove highlight from current tab
		$('#td_'+curr_time_frame).removeClass('selected').addClass('not_selected');

		document.getElementById("time_frame").value = newTabID;
		$(newTab).parent().removeClass('not_selected').addClass('selected');
	} 
	
	function OnClickTimeFrameHandler(Element) {
		change_timeframes_tabs( $(Element).children(), $(Element).children().attr("id"), $('#time_frame').attr('value') );
		get_studies_data( $('#pairID').attr("value"), $('#time_frame').attr('value') );
		$(Element).unbind('click');
		$('#studies_timeframes #timeframes_table .sibling').each(function(){
			if($(this).attr("id")!=$(Element).attr("id")) { $(this).click(function() {OnClickTimeFrameHandler(this);}); };
		});
	}
	// End TimeFrames Tabs
	
	// Technical Summary - Customize Quotes
	function toggle_div(id, param)
	{ 
		var tr = document.getElementById(id);
		if (tr==null) { return; }
		var bExpand = tr.style.display == '';
		tr.style.display = (bExpand ? 'none' : '');
		if(param) {
			if(param=="remember_pairs_panel") {
				document.pairs_form.pairs_panel.value = (tr.style.display=='none' ? 'hide' : 'show');
			}
		}
	}
	function include_ext_file(url, target, curr, message, session_uniq_id, dir, print_report_an_error) {
		
		url += '?session_uniq_id='+session_uniq_id;
		if(curr) {
			url += '&submit=yes&sent_pairsids='+curr;
		}

		if(print_report_an_error) {
			url += '&print_report_an_error='+print_report_an_error;
		}
		var targetHeight = new Array();
		var targetWidth = new Array();
		obj[target] = document.getElementById(target);
		targetHeight[target] = parseInt(obj[target].offsetHeight)+"px";
	  	obj[target].innerHTML = '<table dir="'+dir+'" width="100%" height="' + targetHeight[target] + '"><tr style="height:50%;"><td align="center" valign="top">'+message+'<br /><img src="/images/fx_loading.gif"></td></tr></table>';
	  	
	  	$.ajax({
			url: url,
			type: "GET",
			dataType: ($.browser.msie) ? "text" : "html",
			success: function(data){
				document.getElementById(target).innerHTML = data;
				$('#pair_updatetime').html( $('#pair_updatetime_hidden').val() );
			}
		});
	}
	function ajax_set_session_and_continue_technical(redirect_to, uri, currencies, submit) {
		
		$.get('/common/ajax_func.php', {action: 'set_sessions_technical', uri: uri, currencies: currencies, submit: submit}, function(data) {
			window.location = redirect_to;
		});
	}
	// End Technical Summary - Customize Quotes
	
	function check_currency(checkbox,curr) {
		//if(checkbox.checked=='true') {
			//curr[checkbox.id]=
		//}
	}