/* ************************************************************************ */
/* 																	[TAB:4]	*/
/* 	Dot-Entry JavaScript													*/
/* 																			*/
/* ************************************************************************ */

/* ************************************************************************ */
/*	半角カナ文字不可	半角カナ→全角カナ　全角英数→半角ASCII				*/
/* ************************************************************************ */
function convHan( obj )
{
	var str;
	
	with ( obj )
	{
		str = value;
		str = str.toNormal();
		value = str;
	}
}

/* ************************************************************************ */
/*	機種依存文字不可														*/
/* ************************************************************************ */
function convNotDepend( obj )
{
	var str;
	
	with ( obj )
	{
		str = value;
		str = str.toNotDepend();
		value = str;
	}
}

/* ************************************************************************ */
function convMailName( obj )
{
	var str;
	
	with ( obj )
	{
		str = value;
		str = str.toNotDepend();
		str = str.toZenkakuKana();
		value = str;
	}
}
/* ************************************************************************ */
/*	貼り付け禁止															*/
/* ************************************************************************ */
function notPast( obj )
{
	alert('貼り付けはできません。入力してください。'); 
	return false;
}

/* ************************************************************************ */
/*	スタイルシートオブジェクトの取得 (selectorText指定)						*/
/* ************************************************************************ */
function getStyleSheets( val_selectorText )
{
	var objStyleSheets = document.styleSheets;
	
	for (var i = 0; i < objStyleSheets.length; i++) 
	{
		var objCssRules = objStyleSheets[i].cssRules  || objStyleSheets[i].rules;
		
		for (var j = 0; j < objCssRules.length; j++) 
		{
			var cssObj = objCssRules[j];
			if ( cssObj.selectorText.toLowerCase() == val_selectorText.toLowerCase() )
			{
				break;
			}
		}
	}
	
	return cssObj.style;
}

/* ************************************************************************ */
/* 入力ガイド																*/
/* ************************************************************************ */
/* 例
<input type="reset" value="消去" onClick="textfocus[n] = undefined" onkeypress="textfocus[n] = undefined">
<input type="text" name="input" value="入力" onfocus="clearText(this, n)">
nは0以上の整数
*/
var text_focus = new Array();

function clearText(formElem, n)
{
	if(!text_focus[n])
	{
		formElem.value = "";
		text_focus[n] = true;
	}
}

/* ************************************************************************ */
/*	時計表示																*/
/* ************************************************************************ */
function displayDateTime( id )
{
	
	var d = new Date();
	var ja = d.toString('Y年n月j日（e）G時p分');
	
	document.getElementById( id ).innerHTML = ja;
	
	setTimeout("displayDateTime('" + id + "')",  60000);
}

/* ************************************************************************ */
/*	INPUTタグのtype="file"の画像バージョンのときの処理（無理やりだけど）	*/
/*																			*/
/*	※ 参考： 	js		http://www.quirksmode.org/dom/inputfile.html 		*/
/*				css		http://nais.to/~yto/clog/2005-03-27-3.html			*/
/* ************************************************************************ */
function fileinputs( id,  dummy_id )
{
	if (! document.getElementById( id ) ) return;
	if (! document.getElementById( dummy_id ) ) return;
	var val = document.getElementById( id ).value;
	document.getElementById( dummy_id ).value = val;
}


/* ************************************************************************ */
/*
function changeColor( id, fg, bg )
{
	if (! document.getElementById( id ) ) return;
	
	document.getElementById( id ).style.color = fg;
	document.getElementById( id ).style.backgroundColor = bg;
}


function showColorPickerOn( obj, id )
{
	if (! document.getElementById( id ) ) return;
	var el = document.getElementById( id )
	showColorPicker( obj, el );
}
*/

/************************************************************************************************************
(C) www.dhtmlgoodies.com, September 2005

This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.	

Terms of use:
You are free to use this script as long as the copyright message is kept intact. However, you may not
redistribute, sell or repost it without our permission.

Thank you!

www.dhtmlgoodies.com
Alf Magne Kalleland

************************************************************************************************************/
/*
function showToolTip(e,text)
{
	if(document.all)e = event;
	
	var obj = document.getElementById('bubble_tooltip');
	var obj2 = document.getElementById('bubble_tooltip_content');
	obj2.innerHTML = text;
	obj.style.display = 'block';
	var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
	var leftPos = e.clientX - 100;
	if(leftPos<0)leftPos = 0;
	obj.style.left = leftPos + 'px';
	obj.style.top = e.clientY - obj.offsetHeight -1 + st + 'px';
}	
function hideToolTip()
{
	document.getElementById('bubble_tooltip').style.display = 'none';
}
*/

function showToolTip(e,text)
{
	if(document.all)e = event;
	
	var obj = document.getElementById('bubble_tooltip');
	var obj2 = document.getElementById('bubble_tooltip_content');
	obj2.innerHTML = text;
	obj.style.display = 'block';
	var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
	var leftPos = e.clientX + 10;
	if(leftPos<0)leftPos = 0;
	obj.style.left = leftPos + 'px';
	obj.style.top = e.clientY + st + 'px';
	
/*
	var leftPos = e.clientX - 100;
	if(leftPos<0)leftPos = 0;
	obj.style.left = leftPos + 'px';
	obj.style.top = e.clientY - obj.offsetHeight -1 + st + 'px';
*/
}	

function hideToolTip()
{
	document.getElementById('bubble_tooltip').style.display = 'none';
}
/* ************************************************************************ */
function showToolTipLarge(e,text)
{
	if(document.all)e = event;
	
	var obj = document.getElementById('bubble_tooltip_large');
	var obj2 = document.getElementById('bubble_tooltip_large_content');
	obj2.innerHTML = text;
	obj.style.display = 'block';
	
	var screenCenter = Math.max(document.body.scrollWidth,document.documentElement.scrollWidth) - obj.offsetWidth ;
	if ( screenCenter < e.clientX )
	{
		var leftPos = e.clientX - 10;
		if(leftPos<0)leftPos = 0;
		obj.style.left = leftPos - ( obj.offsetWidth ) -1 + 'px';
	} 
	else
	{
		var leftPos = e.clientX + 10;
		if(leftPos<0)leftPos = 0;
		obj.style.left = leftPos + 'px';
	}
	
	var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
	obj.style.top = e.clientY + st + 'px';
}	
function hideToolTipLarge()
{
	document.getElementById('bubble_tooltip_large').style.display = 'none';
}
/* ************************************************************************ */
//
// addLoadEvent()
// Adds event to window.onload without overwriting currently assigned onload functions.
// Function found at Simon Willison's weblog - http://simon.incutio.com/
//
//
// http://simon.incutio.com/archive/2004/05/26/addLoadEvent
/* ************************************************************************ */
function addLoadEvent(func)
{	
	var oldonload = window.onload;
	if (typeof window.onload != 'function'){
    	window.onload = func;
	} else {
		window.onload = function(){
		oldonload();
		func();
		}
	}

}

/* ************************************************************************ */
/* [EOF]																	*/
/* ************************************************************************ */
