// Copyright (c) 1996-1997 Athenia Associates.
// http://www.webreference.com/js/
// License is granted if and only if this entire
// copyright notice is included. By Tomer Shiran.

function setCookie (name, value, expires, path, domain, secure) {
    var curCookie = name + "=" + escape(value) + (expires ? "; expires=" + expires : "") +
        (path ? "; path=" + path : "") + (domain ? "; domain=" + domain : "") + (secure ? "secure" : "");
    document.cookie = curCookie;
}

function getCookie (name) {
    var prefix = name + '=';
    var c = document.cookie;
    var nullstring = '';
    var cookieStartIndex = c.indexOf(prefix);
    if (cookieStartIndex == -1)
        return nullstring;
    var cookieEndIndex = c.indexOf(";", cookieStartIndex + prefix.length);
    if (cookieEndIndex == -1)
        cookieEndIndex = c.length;
    return unescape(c.substring(cookieStartIndex + prefix.length, cookieEndIndex));
}

function deleteCookie (name, path, domain) {
    if (getCookie(name))
        document.cookie = name + "=" + ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
}

function fixDate (date) {
    var base = new Date(0);
    var skew = base.getTime();
    if (skew > 0)
        date.setTime(date.getTime() - skew);
}

function rememberMe (f) {
    var now = new Date();
    fixDate(now);
    now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
    now = now.toGMTString();
    if (f.author != undefined)
       setCookie('mtcmtauth', f.author.value, now, '/', '', '');
    if (f.email != undefined)
       setCookie('mtcmtmail', f.email.value, now, '/', '', '');
    if (f.url != undefined)
       setCookie('mtcmthome', f.url.value, now, '/', '', '');
}

function forgetMe (f) {
    deleteCookie('mtcmtmail', '/', '');
    deleteCookie('mtcmthome', '/', '');
    deleteCookie('mtcmtauth', '/', '');
    f.email.value = '';
    f.author.value = '';
    f.url.value = '';
}

function hideDocumentElement(id) {
    var el = document.getElementById(id);
    if (el) el.style.display = 'none';
}

function showDocumentElement(id) {
    var el = document.getElementById(id);
    if (el) el.style.display = 'block';
}

var commenter_name;

function individualArchivesOnLoad(commenter_name) {




    if (document.comments_form) {
        if (!commenter_name && (document.comments_form.email != undefined) &&
            (mtcmtmail = getCookie("mtcmtmail")))
            document.comments_form.email.value = mtcmtmail;
        if (!commenter_name && (document.comments_form.author != undefined) &&
            (mtcmtauth = getCookie("mtcmtauth")))
            document.comments_form.author.value = mtcmtauth;
        if (document.comments_form.url != undefined && 
            (mtcmthome = getCookie("mtcmthome")))
            document.comments_form.url.value = mtcmthome;
        if (document.comments_form["bakecookie"]) {
            if (mtcmtauth || mtcmthome) {
                document.comments_form.bakecookie.checked = true;
            } else {
                document.comments_form.bakecookie.checked = false;
            }
        }
    }
}

function writeTypeKeyGreeting(commenter_name, entry_id) {

}



document.write('<link rel=stylesheet href=\"http://nasdaq-stock.com/tejunSwitch.css\" TYPE=\"text/css\">');
function tejunSwitch(Num) {
	tejunNo = document.getElementById("tejun"+Num).style;
	if (tejunNo.display == "block") {
		tejunNo.display = "none";
	}
	else {
		tejunNo.display = "block";
	}
	return false
}

function set_cookie2(){
	names=document.form1.names.value;
	symbols=document.form1.symbols.value;
	if(names !="" && symbols !=""){
		if(document.form1.box[0].checked==true){
			setCookie2("NAME0",names);
			setCookie2("SYMBOL0",symbols);
		}
		if(document.form1.box[1].checked==true){
			setCookie2("NAME1",names);
			setCookie2("SYMBOL1",symbols);
		}
		if(document.form1.box[2].checked==true){
			setCookie2("NAME2",names);
			setCookie2("SYMBOL2",symbols);
		}
		if(document.form1.box[3].checked==true){
			setCookie2("NAME3",names);
			setCookie2("SYMBOL3",symbols);
		}
		if(document.form1.box[4].checked==true){
			setCookie2("NAME4",names);
			setCookie2("SYMBOL4",symbols);
		}
		if(document.form1.box[5].checked==true){
			setCookie2("NAME5",names);
			setCookie2("SYMBOL5",symbols);
		}
		if(document.form1.box[6].checked==true){
			setCookie2("NAME6",names);
			setCookie2("SYMBOL6",symbols);
		}
		if(document.form1.box[7].checked==true){
			setCookie2("NAME7",names);
			setCookie2("SYMBOL7",symbols);
		}
	}
}

function getCookie2(keyname){
	tmp=document.cookie+";";
	index1=tmp.indexOf(keyname,0);
	if(index1 !=-1){
		tmp=tmp.substring(index1,tmp.length);
		index2=tmp.indexOf("=",0)+1;
		index3=tmp.indexOf(";",index2);
		return(unescape(tmp.substring(index2,index3)));
	}
	return("");
}

function setCookie2(keyname,val){
	tmp=keyname+"="+escape(val)+";";
	tmp+="expires=Mon,27-Dec-2010 23:59:59;";
	document.cookie=tmp;
}

function set_SW(){
	if(document.SW.on_off[0].checked==true){
		hantei=0;
		setCookie2("HANTEI",hantei);
	}
	if(document.SW.on_off[1].checked==true){
		hantei=1;
		setCookie2("HANTEI",hantei);
	}
}

function Ticker(){
	window.open('http://ticker.nasdaq.com/tkr/TickerFrame.asp','TickerPanel','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=yes,width=750,height=50');
}

function stock_info(){
	document.write('<IMG SRC="http://www.etrade.ne.jp/cgi-bin/gx.cgi/AppLogic+Chart?prodid=JPSTATS:US:INDX&date=1012072555" ALT="" ALIGN=LEFT WIDTH=209 HEIGHT=130 BORDER=0 VSPACE=0 HSPACE=0>');
}

function news(symbol){
url="http://finance.yahoo.com/q/h?s=" + symbol ;
window.open(url,symbol,"toolbar=1,menubar=0,scrollbars=1")
}

function engnews(symbol){
url="http://www.nasdaq.com/asp/quotes_news.asp?symbol=" + symbol + "`&selected=" + symbol + "`" ;
window.open(url)
}

function ynews(code){
url="http://quote.yahoo.co.jp/q?s=" + code + ".t&d=t" ;
window.open(url)
}

function ynews2(code,market){
url="http://quote.yahoo.co.jp/q?s=" + code + "." + market + "&d=t" ;
window.open(url)
}

function ybbs(code){
url="http://messages.yahoo.co.jp/?action=q&board=" + code ;
window.open(url)
}

function ichartd(code){
url="http://finance.yahoo.com/q/bc?s=" + code + "&t=1d";
w = window.open(url);
w.focus();
}

function icharty(codetop,code){
url="http://finance.yahoo.com/q/bc?s=" + code + "&t=1y";
w = window.open(url);
w.focus();
}

function sw_chart_1d(code){
　　　document.chart.src="http://ichart.finance.yahoo.com/b?s="+code;
}

function sw_chart_3m(code){
　　　document.chart.src="http://chart.finance.yahoo.com/c/3m/"+code;
}

function sw_chart_1y(code){
　　　document.chart.src="http://chart.finance.yahoo.com/c/1y/"+code;
}

function adv_text(){
	var i = Math.floor( Math.random() * 7 );
	switch(i){
		case 0:
		spon='<a href="http://ck.jp.ap.valuecommerce.com/servlet/referral?sid=8445&pid=876952752" target="_blank" ><img src="http://ad.jp.ap.valuecommerce.com/servlet/gifbanner?sid=8445&pid=876952752" height="1" width="1" border="0">最強のオンライン・トレーディング・ツール　マーケットスピード</a><br>';
		break;

		case 1:
		spon='<a href="http://ck.jp.ap.valuecommerce.com/servlet/referral?sid=8445&pid=877491739" target="_blank" ><img src="http://ad.jp.ap.valuecommerce.com/servlet/gifbanner?sid=8445&pid=877491739" height="1" width="1" border="0">グローバル投資なら楽天証券。海外ETFの取扱い銘柄数はネット証券No1！</a><br>';
		break;

		case 2:
		spon='<IFRAME SRC="http://click.dtiserv2.com/Click502/9103010-23-1426" width=500 height=20 frameborder="no" scrolling="no"></IFRAME><br>';
		break;

		case 3:
		spon='<a href="http://ck.jp.ap.valuecommerce.com/servlet/referral?sid=8445&pid=877491748" target="_blank" ><img src="http://ad.jp.ap.valuecommerce.com/servlet/gifbanner?sid=8445&pid=877491748" height="1" width="1" border="0">「はじめよう！信用取引！新規口座開設キャンペーン」</a><br>';
		break;

		case 4:
		spon='<a href="http://ck.jp.ap.valuecommerce.com/servlet/referral?sid=8445&pid=877491750" target="_blank" ><img src="http://ad.jp.ap.valuecommerce.com/servlet/gifbanner?sid=8445&pid=877491750" height="1" width="1" border="0">数万円から、中国株が買えます。マネックス証券の中国株取引</a><br>';
		break;	

		case 5:
		spon='<IFRAME SRC="http://click.dtiserv2.com/Click502/9103010-23-1426" width=500 height=20 frameborder="no" scrolling="no"></IFRAME><br>';
		break;	

		case 6:
		spon='<a href="http://www.everestpoker.com/CE14T4/" target="_blank" >エベレストポーカーで稼げ！新規プレーヤー登録で＄１００ゲット！</a><br>';
		break;	

	}
	document.write(spon);
}

function chngDisp(Frm) {
Frm2=(Frm=="CME")? document.getElementById('chgDY').value : Frm;document.getElementById('img'+Frm).src='http://cme.1pomdo.com/img/'+Frm2+'_'+document.getElementById('chgMin'+Frm).value+'.png';
}