var modPath = '/vts/mods/app/v6/';

function modStart() {
	$('.modCiteLink').bind('click', function(e) {
				
		if(e.ctrlKey) {
			window.open('/vts/red/go.cxp?gt=' + $(this).find('cite').attr('class'));
		} else if(e.altKey) {
			window.location = '/vts/red/go.cxp?gt=' + $(this).find('cite').attr('class');
		} else if(e.shiftKey) {
			window.open('/vts/red/go.cxp?gt=' + $(this).find('cite').attr('class'));
		} else {
		  window.location = '/vts/red/go.cxp?gt=' + $(this).find('cite').attr('class');
		}
	});
	$('.modH4Link').bind('click', function(e) {
				
		if(e.ctrlKey) {
			window.open('/vts/red/go.cxp?gt=' + $(this).find('h4').attr('class'));
		} else if(e.altKey) {
			window.location = '/vts/red/go.cxp?gt=' + $(this).find('h4').attr('class');
		} else if(e.shiftKey) {
			window.open('/vts/red/go.cxp?gt=' + $(this).find('h4').attr('class'));
		} else {
		  window.location = '/vts/red/go.cxp?gt=' + $(this).find('h4').attr('class');
		}
	});
	$('.modH2Link').bind('click', function(e) {
				
		if(e.ctrlKey) {
			window.open('/vts/red/go.cxp?gt=' + $(this).find('h2').attr('class'));
		} else if(e.altKey) {
			window.location = '/vts/red/go.cxp?gt=' + $(this).find('h2').attr('class');
		} else if(e.shiftKey) {
			window.open('/vts/red/go.cxp?gt=' + $(this).find('h2').attr('class'));
		} else {
		  window.location = '/vts/red/go.cxp?gt=' + $(this).find('h2').attr('class');
		}
	});

	modBindSM();	
	if ($('#modTopicSuggestions').length != 0) {
		ajaxGetPage(modPath + 'ajax_topic_related.cxp?topictag=' + $('#modTopicSuggestions').html(), 'modTopicSuggestions');
	}
}

function modBindSM() {
	$('.modSM').bind('click', function(e) {
		modSearchThis(this)
	});	
	$('.modSM').removeClass('modSM');
}

function modSearchThis(fx_this) {
	$('#csesearchvalue').focus();
	$('#csesearchvalue').val($(fx_this).html());
	$('#cref_iframe').submit();
}

xpsAddReady('modStart()');
xpsJSPage = 'ran';



