function xoopsGetElementById(id){
	if (document.getElementById) {
		return (document.getElementById(id));
	} else if (document.all) {
		return (document.all[id]);
	} else {
		if ((navigator.appname.indexOf("Netscape") != -1) && parseInt(navigator.appversion == 4)) {
			return (document.layers[id]);
		}
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function randomJump()
{
theURL = new Array();
theURL[0] = "http://senryaku-jouhou.jp/shiotsuu.html";
theURL[1] = "http://www.interq.or.jp/power/masumoto/ms.html";
theURL[2] = "http://nyt.trycomp.com/modules/mylinks/visit.php?lid=463";
theURL[3] = "http://nyt.trycomp.com/modules/mylinks/visit.php?lid=478";
theURL[4] = "http://nyt.trycomp.com/modules/mylinks/visit.php?lid=394";
theURL[5] = "http://www.netlive.ne.jp/";
ImageCount = 6;
num = Math.floor(Math.random() * ImageCount);
document.write("<A HREF='"+theURL[num]+"'>");
document.write("<IMG SRC='http://nyt.trycomp.com/link-image/"+num+".jpg' BORDER='0'></A>");
}

function headjump()
{
theHeadURL = new Array();
theHeadURL[0] = "http://www.chosa-kai.jp22/";
theHeadURL[1] = "http://nyt.trycomp.com/modules/news/article.php?storyid=6862";
theHeadURL[2] = "http://nyt.trycomp.com/modules/news/article.php?storyid=6923";
ImageHeadCount = 3;
Headnum = Math.floor(Math.random() * ImageHeadCount);
document.write("<A HREF='"+theHeadURL[Headnum]+"'>");
document.write("<IMG SRC='http://nyt.trycomp.com/link-image2/"+Headnum+".jpg' BORDER='0'></A>");
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
 if (restore) selObj.selectedIndex=0;
}

function showImgSelected(imgId, selectId, imgDir) {
	imgDom = xoopsGetElementById(imgId);
	selectDom = xoopsGetElementById(selectId);
	imgDom.src = "<?php echo XOOPS_URL;?>/"+ imgDir + "/" + selectDom.options[selectDom.selectedIndex].value;
}

function justReturn() {
	return;
}

function init() {

}

function openWithSelfMain(url,name,width,height){
	var options = "width=" + width + ",height=" + height + "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no";
	new_window = window.open(url, name, options);
	window.self.name = "main";
	new_window.focus();
}

function setElementColor(id, color){
	xoopsGetElementById(id).style.color = "#" + color;
}

function setElementFont(id, font){
	xoopsGetElementById(id).style.fontFamily = font;
}

function setElementSize(id, size){
	xoopsGetElementById(id).style.fontSize = size;
}

function changeDisplay(id){
	var elestyle = xoopsGetElementById(id).style;
	if (elestyle.display == "") {
		elestyle.display = "none";
	} else {
		elestyle.display = "block";
	}
}

function setVisible(id){
	xoopsGetElementById(id).style.visibility = "visible";
}

function setHidden(id){
	xoopsGetElementById(id).style.visibility = "hidden";
}

function makeBold(id){
	var eleStyle = xoopsGetElementById(id).style;
	if (eleStyle.fontWeight != "bold") {
		eleStyle.fontWeight = "bold";
	} else {
		eleStyle.fontWeight = "normal";
	}
}

function makeItalic(id){
	var eleStyle = xoopsGetElementById(id).style;
	if (eleStyle.fontStyle != "italic") {
		eleStyle.fontStyle = "italic";
	} else {
		eleStyle.fontStyle = "normal";
	}
}

function makeUnderline(id){
	var eleStyle = xoopsGetElementById(id).style;
	if (eleStyle.textDecoration != "underline") {
		eleStyle.textDecoration = "underline";
	} else {
		eleStyle.textDecoration = "none";
	}
}

function appendSelectOption(selectMenuId, optionName, optionValue){
	var selectMenu = xoopsGetElementById(selectMenuId);
	var newoption = new Option(optionName, optionValue);
	selectMenu.options[selectMenu.length] = newoption;
	selectMenu.options[selectMenu.length].selected = true;
}

function disableElement(target){
	var targetDom = xoopsGetElementById(target);
	if (targetDom.disabled != true) {
		targetDom.disabled = true;
	} else {
		targetDom.disabled = false;
	}
}
function xoopsCheckAll(formname, switchid) {
	var ele = document.forms[formname].elements;
	var switch_cbox = xoopsGetElementById(switchid);
	for (var i = 0; i < ele.length; i++) {
		var e = ele[i];
		if ( (e.name != switch_cbox.name) && (e.type == 'checkbox') ) {
			e.checked = switch_cbox.checked;
		}
	}
}


window.onload=init;
