function WindowClose(){
	window.close();
}

var TimeID=null;

function setFocus(){
clearTimeout(TimeID);
//alert("come")
window.opener.focus();
}



function WindowOpen(str){
		var uai = new UAIdentifier();
		if (uai.firefox){
		//window.opener.close();
		if (!window.opener){
		  	open2(str);
		  	}
		 }
		 if (uai.ie >= 5.0){
			 open2(str);		 
		 }
   	if ((navigator.userAgent.indexOf("Mac") > -1)){
		
		if (window.opener){
			//alert("focus");
			//window.opener.focus();
			window.opener.location.href = str;
			TimeID=setTimeout("setFocus()",500);
			
		} else {
			 open2(str);
		}
	}else{
		if (!window.opener.closed){
		//alert("opened");
			window.opener.location.href = str;
			window.opener.focus();
			
		} else {
		//alert("closed");
			window.opener.focus();	 
			window.open(str,"link01");
		}
	}
		return false;

}

function open2(str){
//alert("open2");
		var newWin = window.open( str,"link01" )
		  if( !newWin )
			{
			newWin = window.open('',"link01");
			newWin.location.href = str;
			}
			return false; 
}



function checkText(aText){
if (aText.value.length > 1) {
alert('サイズオーバーです');
//aText.focus();
// TimeID=setTimeout("setFocus('fmTitle')",300);//時間を置いて実行する
TimeID=setTimeout("setFocus('"+ aText.name + "')",300);

}
}
