var targetfield = "";
var formTarget = "";
var textAreaFormat = "";

function getInfoVentureBaseURL() {
	return '/TSXVenture/TSXVentureHttpController?';
}

function openWindow(url,x,y) {
mywin = window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,left=30,top=30,width=' + x + ',height=' + y + '');
mywin.focus();
}

function openNewWindow(url,x,y, winName) {
mywin = window.open(url,winName,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,left=30,top=30,width=' + x + ',height=' + y + '');
mywin.focus();
}

function transferSymbol (symbol) {
if (window.opener.formTarget=="InnerForm"){
        if (window.opener.fieldType=="textArea"){
                window.opener.textAreaFormat += symbol + ",";   
                eval("window.opener.document.quotelookupQ." + window.opener.targetfield + ".value  ='" + window.opener.textAreaFormat +"'");
        }else{
                eval("window.opener.document.quotelookupQ." + window.opener.targetfield + ".value  ='" + symbol +"'");
        }
}else{
  window.opener.location = "/HttpController?GetPage=NEXQuotesViewPage&DetailedView=DetailedPrices&IsJ2Market=Yes&Market=NEX&Language=en&QuoteSymbol_1=" + symbol;
}
window.opener.targetfield = "";
}


function quoteLookUpTicker(url, fieldName) {
eval("window.document.forms[2]." + fieldName + ".focus()")
formTarget="InnerForm";
fieldType="textArea";
openWindow(url,330,400);
}

function quoteLookUp(url, fieldName) {
eval("window.document.quoteLookUp." + fieldName + ".focus()")
formTarget="InnerForm";
openWindow(url,330,400);
}

function quickQuoteLookUp(url, fieldName) {
eval("window.document.quickQuote." + fieldName + ".focus()")
formTarget="OuterForm";
openWindow(url,330,400);
}

function quickQuoteLookUpQ(url, fieldName) {
        
if (window.document.quotelookupQ != null)       
        eval("window.document.quotelookupQ." + fieldName + ".focus()");
        
formTarget="OuterForm";
openWindow(url,330,400);
}

function quoteLookUpQ(url) {
if (targetfield =="") {
alert("Please place your mouse cursor in a quote lookup field and try again.")
} else {
formTarget="InnerForm";
openWindow(url,330,400);
}
}

function startTicker(url) {
if (url){
tickerString="/HttpController?GetPage=CustomizedTicker&symbols=" + escape(url)
newWin = window.open(tickerString,"tickerWin","toolbar=0,location=0,width=680,height=125,left=30,top=30,resizable=0");
}else{
newWin = window.open('',"tickerWin","toolbar=0,location=0,width=680,height=125,left=30,top=30,resizable=0");
document.ticker.submit();
                }
}

function confirmSubmit(msg)
{
var agree=confirm(msg);
if (agree)
return true ;
else
return false ;
}

function confirmSubmitEdit(msg1, fieldName, msg2)
{
var newMsg = msg1 + eval(fieldName + ".value") + " ."  + msg2;
var agree = confirm(newMsg);
if (agree) 
	return true;
else
	return false;
}


function confirmSubmitListView(msg1, listName, msg2)
{
var sStockList;
var iList;

iList = eval(listName + ".selectedIndex");
sStockList = eval(listName + ".options[" + iList + "].text");   

var newMsg = msg1 + sStockList + " ."  + msg2;
var agree=confirm(newMsg);      
if (agree)
return true ;
else
return false ;
}

function locationChange(url)
{
window.opener.location = url;
}


