var url = location.href.toLowerCase();
var AV  = navigator.appVersion.toLowerCase();
var UA  = navigator.userAgent.toLowerCase();
var winBrowser = ( AV.indexOf("windows") != -1) ? true : false;
var wieBrowser = ( AV.indexOf("windows") != -1 && UA.indexOf("msie") != -1) ? true : false;
var wsfBrowser = ( AV.indexOf("windows") != -1 && UA.indexOf("safari") != -1) ? true : false;
var macBrowser = ( AV.indexOf("macintosh") != -1) ? true : false;
var mieBrowser = ( AV.indexOf("macintosh") != -1 && UA.indexOf("msie") != -1) ? true : false;
var msfBrowser = ( AV.indexOf("macintosh") != -1 && UA.indexOf("safari") != -1) ? true : false;

var cookieval = "";
var FontSizeNo = "";
if (document.cookie) {
	cookieval = document.cookie;
	FontSizeNo = cookieval.match(/size(\d)/);
	FontSizeNo = RegExp.$1;
}

var path = "";
if(url.indexOf("http") != -1){
	var urlpc = url.split('//');
}
else{
	var urlpc = url.split('stbri');
}
var urlpath = urlpc[1].split('/');
var urldir = urlpath.length-2;
if(urldir>0){
	for(var k=0; k<urldir; k++){ path = path + "../";}
}

if(wieBrowser){
	var ieversion = AV.match(/msie (\d)/);
	ieversion = RegExp.$1;
	if(ieversion == 6){
		document.execCommand("BackgroundImageCache",false,true);
	}
}







function chgCV(v){
	var deltime = new Date();
	deltime.setTime(deltime.getTime() + 1000*50);
	document.cookie = "fontsize=size" + v + "; path=/; expires=" + deltime.toGMTString();
	chgFS(v);
}

function chgFS(s){
	if (document.getElementById('body')){
		document.getElementById('body').style.fontSize = MyFontSize[s];
		document.getElementById('body').style.lineHeight = MyLineHeight[s];
		chgFSimg(s);
	}
}



function TbColor(color){
	if(document.getElementById('table')){
	var getTb = document.getElementById('table');
		var trList = getTb.rows;
		if(trList.length>1){
			for( var l=1; l<trList.length; l=l+2){
				trList.item(l).style.backgroundColor = color;
			}
		}
	}
}

function TbColor2(color){
	if(document.getElementById('table')){
	var getTb = document.getElementById('table');
		var trList = getTb.rows;
		if(trList.length>2){
			for( var l=2; l<trList.length; l=l+4){
				var n = l+1;
				trList.item(l).style.backgroundColor = color;
				trList.item(n).style.backgroundColor = color;
			}
		}
	}
}


function chg(e, f) { e.src = f;}


var googlURL = "url(" + path + "images/bg_google.gif)";
function searchFocus(obj){ obj.style.backgroundImage = 'none'}
function searchBlur(obj){
	if(obj.value == ''){ obj.style.backgroundImage = googlURL;}
}





