/*__________________________________________________

  l2_basic_css.js
  Last updated on 2006.5.15

  by Toshiyuki Hayashi
  __________________________________________________*/

/******** BrowserCheck **********/

browserEnv = new Object();
browserEnv.ua = navigator.userAgent;
browserEnv.na = navigator.appName;
browserEnv.nv = navigator.appVersion;
browserEnv.osSmp = 'unknown';
browserEnv.brsSmp = 'unknown';
browserEnv.verSmp = 0;
browserEnv.osDtl = 'unknown';
browserEnv.brsDtl = 'unknown';
browserEnv.verDtl = 0;
browserEnv.setEnv = function() {
	var tempindex;
	if(this.ua.indexOf('Netscape6') >= 0) {
		this.ua = this.ua.replace('Netscape6','Netscape');
	}
	if (this.na.indexOf('Netscape') >= 0) {
		this.brsSmp = 'ns';
		this.verSmp = this.nv;
	} else if (this.na.indexOf('Microsoft') >= 0) {
		this.brsSmp = 'ie';
		tempindex = this.nv;
		this.verSmp = tempindex.substring(tempindex.indexOf('MSIE') + 5,tempindex.length);
	} else if (this.na.indexOf('Opera') >= 0){
		this.brsSmp = 'op';
		this.verSmp = this.nv;
	} else {
		this.brsSmp = 'other';
		this.verSmp = this.nv;
	}
	this.verSmp = parseFloat(this.verSmp);
	if(this.ua.indexOf('Safari') >= 0) {
		this.brsDtl = 'safari';
		tempindex = this.ua.indexOf('Safari');
		this.verDtl = this.ua.substring(tempindex + 7,this.ua.length);
	} else if (this.ua.indexOf('Opera') >= 0) {
		this.brsDtl = 'opera';
		tempindex = this.ua.indexOf('Opera');
		this.verDtl = this.ua.substring(tempindex + 6,this.ua.length);
	} else if (this.ua.indexOf('Netscape') >= 0) {
		this.brsDtl = 'netscape';
		tempindex = this.ua.indexOf('Netscape');
		this.verDtl = this.ua.substring(tempindex + 9,this.ua.length);
	} else if (this.ua.indexOf('Firefox') >= 0) {
		this.brsDtl = 'firefox';
		tempindex = this.ua.indexOf('Firefox/');
		this.verDtl = this.ua.substring(tempindex + 8,this.ua.length);
	} else if (this.ua.indexOf('Gecko') >= 0) {
		this.brsDtl = 'mozilla';
		tempindex = this.ua.indexOf('rv:');
		this.verDtl = this.ua.substring(tempindex + 3,this.ua.length);
	} else if (this.ua.indexOf('MSIE') >= 0) {
		this.brsDtl = 'ie';
		tempindex = this.ua.indexOf('MSIE');
		this.verDtl = this.ua.substring(tempindex + 5,this.ua.length);
	} else if (this.na.indexOf('Netscape') >= 0){
		this.brsDtl = 'netscape';
		this.verDtl = this.nv;
	} else {
		this.brsDtl = 'other';
		this.verDtl = this.nv;
	}
	this.verDtl = parseFloat(this.verDtl);
	if (this.ua.indexOf('Win') >= 0) {
		this.osSmp = 'win';
		tempindex = this.ua.indexOf('Windows ');
		this.osDtl = this.ua.substring(tempindex,this.ua.length);
		this.osDtl = this.osDtl.replace(')',';');
		this.osDtl = this.osDtl.substring(0,this.osDtl.indexOf(';'));
		this.osDtl = this.osDtl.replace('NT 5.1','XP');
		this.osDtl = this.osDtl.replace('NT 5.0','2000');
		if(this.ua.indexOf('SV1') >= 0) {
			this.osDtl = this.osDtl.replace('XP','XP_SP2');
		}
	} else if (this.ua.indexOf('Mac') >= 0) {
		this.osSmp = 'mac';
		if((this.ua.indexOf('Mac OS X') >= 0) || ((this.brsDtl == 'ie') && (this.verDtl >= 5.2))) {
			this.osDtl = 'Mac OS X';
		} else {
			this.osDtl= 'Mac OS';
		}
	} else {
		this.osSmp = 'other';
		this.osDtl = 'other';
	}
}
browserEnv.setEnv();

/******** weekly column control **********/

function writeColumnIcon() {
	if(!(browserEnv.osSmp == 'mac' && browserEnv.brsDtl == 'ie' && browserEnv.verDtl == 5)) {
	 document.write('<a href="/index.html#dailycolumn" onmouseover="showColumn()" onmouseout="hideColumn()"><img src="/share/img/column/l2_' + 'tanosimi' + '.gif" border="0" alt="" /></a>');
	}
}
function writeColumnText() {
 document.write('<img src="/share/img/column/l2_' + 'tanosimi' + '_over.gif" alt="" />');
}
function showColumn() {
 document.getElementById('column-txt').style.display = 'block';
}

function hideColumn() {
  document.getElementById('column-txt').style.display = 'none';
}

function minmaxInit() {

}

/*-------------L2 header info-----------------*/


l2txt = '&gt;&gt; 「ガラガラ福引」賞品がその場で当たる！';
l2link = 'http://www.so-net.ne.jp/';

function prWrite2() {
  document.write('<a href="' + l2link + '">' + l2txt + '</a>');
 }


function prWrite() {
ord=Math.random()*10000000000000000;
document.write('<iframe src="http://ad.jp.doubleclick.net/adi/top.scn.headertext/;sz=330x16;ord=' + ord + '?" width="330" height="16" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no">');
document.write('</iframe>');
 }
 
 function prWriteS() {
ord=Math.random()*10000000000000000;
document.write('<iframe src="https://ad.jp.doubleclick.net/adi/top.scn.headertext/;sz=330x16;ord=' + ord + '?" width="330" height="16" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no">');
document.write('</iframe>');
 }


 function gooSearch(a) {
	document.forms['form-search'].type.value = a;
	document.forms['form-search'].submit();
}

function searchInit() {
	document.forms['form-search'].type.value = '';
}
