
var dartPtileRan = parseInt(Math.random() * 1000000000);

var is_searchType = 'nasdaq';

if(typeof myPage != 'undefined')
{
	document.domain = 'nasdaq.com';
}

function openWin(winName,winURL,winWidth,winHeight)
{
		 newWindow = window.open(winURL,winName,'toolbar=no,menubar=no,width='+winWidth+',height='+winHeight+',scrollbars=no,resizable=no');
}

function is_clearTB() 
{
	 	document.forms['_ipsubmit4'].Text1.value ='';
}

function is_checkSearchType(searchType) 
{

	if (searchType == 1)
	{
		is_searchType = 'web'
	} 
	else 
	{
		is_searchType = 'nasdaq'
	}
	return is_searchType;
}
	
function is_submitSearch() 
{
	if (is_searchType == 'nasdaq')
	{
			top.document.cookie='search=1';
			document._ipsubmit4.method = 'get';
			document._ipsubmit4.action = 'http://Search.nasdaq.com/search';			
			document.forms['_ipsubmit4'].submit();
	} 
	else 
	{
			document._ipsubmit4.action = 'http://nasdaq.infospace.com/nasdaq/ws/redir?qkw=' + document.forms['_ipsubmit4'].Text1.value + '&amp;qcat=web';
			document._ipsubmit4.method = 'post';
			document.forms['_ipsubmit4'].submit();
	}
	
}


function get_querystring_value(parameter)
{
    string = unescape(String(top.location.search));//grab parameter string

	if(string.indexOf("#") != -1)
	{
		string = string.substr(0,string.indexOf("#"));//remove the anchor
	}
    if(string!="")
    {
        parameter = parameter.toLowerCase();
        string=string.substring(1).split("&"); //separate out into a list
        
        for(var i=0; i<string.length; i++)
        {
            params = string[i].split("=");
            
            if(params[0].toLowerCase() == parameter)
            {   
                
                if(params[1] != "")
                    return params[1]; //parameter found -- return value
                else
                    return false;  //parameter found but no value set
            }
        }
        return false; //querystring parameter not found
         
    }
    else
        return false;//no querystring parameters
 }

function get_cookie_value(parameter)
{
	if(navigator.cookieEnabled && parameter!="")
	{
		index = document.cookie.indexOf(parameter+"=");
		if(index!=-1)
		{
			//i = document.cookie.indexOf("flash=")+6;
			index = index + parameter.length + 1;
			last_index = document.cookie.indexOf(";",index);
			if(last_index==-1)  //symbol list string is at the end of the cookie for some reason
				last_index = document.cookie.length;
			var value = unescape(document.cookie.substring(index,last_index));
			return value;

		}
		else
			return false; //cookie value not found or parameter variable is empty

	}
	else
		return false;//cookies not enabled
}


function set_cookie_value(parameter, value, days)
{
	if(navigator.cookieEnabled && parameter!="")
	{
		var exdate=new Date();
		exdate.setDate(exdate.getDate()+days);//expiration duration
		document.cookie=parameter+"="+value+";expires="+exdate;
	}
	else
		return false; //cookies not enabled
}

function delete_cookie(parameter)
{
	 document.cookie = parameter + "=; expires=Thu, 01-Jan-70 00:00:01 GMT;path=/;domain=nasdaq.com";
} 

function loadPage(pageId)
{
		window.location.href = "http://quotes.nasdaq.com/asp/MasterDataEntry.asp?page=" + pageId;
}

function setSectionName(strnavArea) 
{
if(typeof myPage != 'undefined')
{
 s.prop20 = myPage; <!-- added to view pages by mypage variable in Custom Insight -->

	if(myPage == "summaryquote")
		s.pageName = "Summary Quote";
	else if(myPage == "companynewsstory") <!-- these six lines added for Newsroom changes -->
	{
		s.pageName = "Company News Story";
		s.prop19 = window.parent.document.title;
	}
	else if(myPage == "marketnews") 
	{
		s.pageName = "Company News Story";
		s.prop19 = window.parent.document.title;
	}
	else
		s.pageName= window.parent.document.title;
}
else
	s.pageName= window.parent.document.title;

s.prop1 = "";
switch(strnavArea) {
case "home":
s.prop1="NASDAQ.com Home";
break;
case "quotes_flashquotes":
s.prop1="FlashQuotes";
break;
case "quotes_infoquotes":
s.prop1="InfoQuotes";
break;
case "quotes_summaryquotes":
s.prop1="SummaryQuotes";
break;
case "quotes_NLS":
s.prop1="NLS Pages";
break;
case "quotes_nlstrades":
s.prop1="NLS Trade Reporting";
break;
case "quotes_ELS":
s.prop1="ELS Pages";
break;
case "quotes_adl":
s.prop1="ADL Pages";
break;
case "quotes_partner":
s.prop1="Partner Quotes";
break;
case "quotes_afterhours":
s.prop1="After Hours Quotes";
break;
case "quotes_premarket":
s.prop1="Pre-Market Quotes";
break;
case "marketheadlines":
s.prop1="Market Headlines";
break;
case "quotes_news":
s.prop1="Company Headlines and Press Releases";
break;
case "newsstory":
s.prop1="News Stories";
break;
case "brafton":
s.prop1="Brafton News";
break;
case "quotes_options":
s.prop1="Options Quotes";
break;
case "quotes_optionschain":
s.prop1="Options Chain";
break;
case "optionscenter":
s.prop1="Options Center";
break;
case "quotes_mutual":
s.prop1="Mutual Fund Quotes and Profiles";
break;
case "quotes_charts":
s.prop1="Charts";
break;
case "dynamic_charting":
s.prop1="Interactive Charts";
break;
case "quotes_revenue":
s.prop1="Revenue and EPS";
break;
case "quotes_financials":
s.prop1="Company Financials";
break;
case "quotes_competitor":
s.prop1="View Competitors";
break;
case "quotes_short":
s.prop1="Short Interest";
break;
case "quotes_analystinfo":
s.prop1="Analyst Stock Research";
break;
case "quotes_stockcompare":
s.prop1="Stock Comparison";
break;
case "afterhours_mostactive":
s.prop1="After Hours Most Active";
break;
case "premarket_mostactive":
s.prop1="Pre-Market Most Active";
break;
case "mostactive_volume":
s.prop1="Most Active Share Volume";
break;
case "marketactivity":
s.prop1="Market Activity";
break;
case "quoteshub" :
s.prop1="Quotes Hub";
break;
case "extended":
s.prop1="Extended Trading";
break;
case "movingmarket":
s.prop1="Moving the Market";
break;
case "quotes_stockreports":
s.prop1="Company Stock Reports";
break;
case "quotes_filings":
s.prop1="SEC Filings";
break;
case "quotes_holdings":
s.prop1="Holdings and Insider Ownership";
break;
case "quotes_guru":
s.prop1="Guru Analysis";
break;
case "news":
s.prop1="News";
break;
case "etfs":
s.prop1="ETFs";
break;
case "rant" :
s.prop1="Investor Tools";
break;
case "listed" :
s.prop1="Listed Companies";
break;
case "newsroom" :
s.prop1="Newsroom";
break;
case "personalfinance" :
s.prop1="Personal Finance";
break;
case "BusinessVideo" :
s.prop1="Business Video";
break;
case "dividend" :
s.prop1="Dividend.com News";
break;
case "learningmarkets" :
s.prop1="Learning Markets";
break;
case "worldcurrency" :
s.prop1="World Currency Options";
break;
case "globalmarkets" :
s.prop1="Global Markets";
break;
case "answers" :
s.prop1="NASDAQ Answers";
break;
case "equitiesmag" :
s.prop1="Equities Magazine";
break;
case "pf_CreditDotCom" :
s.prop1="CreditDotCom";
break;
case "pf_Navellier" :
s.prop1="Navellier";
break;
case "pf_samcollins" :
s.prop1="SamCollins";
break;
case "Rukeyser" :
s.prop1="Rukeyser";
break;
case "newshub" :
s.prop1="News Hub";
break;
case "historicalquotes" :
s.prop1="Historical Quotes";
break;
case "personalfinance_careers" :
s.prop1="Careers Channel";
break;
case "guru" :
s.prop1="Guru Articles";
break;
}

if(typeof omniture_symbol != "undefined")
{	s.prop10 = omniture_symbol;}

s.server="";
s.channel="com";
s.pageType="";
s.prop2="";
s.prop3="";
s.prop4="";
s.prop5="";
/* E-commerce Variables */
s.campaign="";
s.state="";
s.zip="";
s.events="";
s.products="";
s.purchaseID="";
s.eVar1="";
s.eVar2="";
s.eVar3="";
s.eVar4="";
s.eVar5="";
/************* DO NOT ALTER ANYTHING BELOW THIS LINE ! **************/
var s_code=s.t();if(s_code)document.write(s_code);
}
