/****************************************************************************************/
//페이지 이동
/****************************************************************************************/
function tM_goURL(theURL, theTarget) {
	if(theTarget == 'blank'){
		window.open(theURL,'','');
	} else {
		theTarget = (theTarget)?theTarget+'.':'';
		eval(theTarget + "location.href = theURL;");
	}
}

/****************************************************************************************/
//Show Hide ID 1 : Roll Over시 그 메뉴의 Object를 보이게 하고 Roll Out시 사라지게 한다.
/****************************************************************************************/
/* Arguments
String theObj:객체ID값
Int theLeft:고정된 객체의 Left값(px단위)/값이 없을 경우 이벤트가 일어난 곳의 Left값 할당
Int theTop:고정된 객체의 Top값(px단위)/값이 없을 경우 이벤트가 일어난 곳의 Top값 할당
String theFlag:value1>'show' : 무조건 객체를 보이게 한다.
*/
function tT_showHideID(theObj,theLeft,theTop,theFlag) {
	if(document.all){
		theObj = document.all.item(theObj);
		if(theObj){
			if(theObj.style){
				if(theFlag == 'show') {
					theObj.style.display = '';
				} else if(theObj.style.display == 'none'){
					theLeft = (theLeft)?theLeft:event.x + document.body.scrollLeft;
					theTop = (theTop)?theTop:event.y + document.body.scrollTop;
					theObj.style.display = '';
					theObj.style.left = theLeft;
					theObj.style.top = theTop;
				} else {
					theObj.style.display = 'none';
				}
			}
		}
	}
}
/***********************************************************************************************************/
//Show Hide ID 2 : Roll Over시 보이고 있는 Object는 보이지 않게 하고 Over된 메뉴의 Object를 보이게 하는 함수
/***********************************************************************************************************/
/****************/
//변수 정의 함수
/****************/
/* Arguments
Type : String, Int
tT_showHideID2() 가 하나의 영역에서만 쓰일 때 : tT_showHideID2Def();
tT_showHideID2() 가 여러 영역에서만 쓰일 때 : tT_showHideID2Def(value1, value2, ....);
*/
function tT_showHideID2Def() {
	var arg, i;
	arg = tT_showHideID2Def.arguments;
	if(arg.length != 0){
		for(i = 0 ; i < arg.length; i++){
			eval('tm_varSelObjID' + arg[i] + ' = "";');
		}
	} else {
		tm_varSelObjID = "";
	}
}
/****************/
//실행 함수
/****************/
/* Arguments
String theObj:객체ID값
Int theLeft:고정된 객체의 Left값(px단위)/값이 없을 경우 이벤트가 일어난 곳의 Left값 할당
Int theTop:고정된 객체의 Top값(px단위)/값이 없을 경우 이벤트가 일어난 곳의 Top값 할당
String, Int theIndex:변수 정의 함수에서 인자로 쓰인 값 중 하나여야 한다.(하나의 영역에서 쓰일 경우 값이 필요없음)
*/
function tT_showHideID2(theObjID,theLeft,theTop,theIndex) {
	if(document.all){
		theIndex = (theIndex)?theIndex:'';
		theObj = document.all.item(theObjID);
		theSelObj = document.all.item(eval('tm_varSelObjID' + theIndex));
		if(theObj){
			if(theObj.style){
				if(theSelObj) theSelObj.style.display = 'none';
				theLeft = (theLeft)?theLeft:event.x + document.body.scrollLeft;
				theTop = (theTop)?theTop:event.y + document.body.scrollTop;
				theObj.style.display = '';
				theObj.style.left = theLeft;
				theObj.style.top = theTop;
				eval('tm_varSelObjID' + theIndex + '="' + theObjID + '"');
			}
		} else {
			if(theSelObj) theSelObj.style.display = 'none';
		}
	}
}

/****************************************************************************************/
//그림 테두리 만들기
/****************************************************************************************/
/* Arguments
picSrc : 이미지 경로
picAttr : 이미지 속성
iTAttr : 그림이 들어있는 테이블 속성
tTAttr : 그림틀 전체 데이블 속성
pSize : Padding Size
*/
function tM_createPicture(sNum, picSrc, picAttr, iTAttr, tTAttr, pSize){
	var mAPictureType;
	if(sNum == 1) {
		mAPictureType = '' +
'						<table border="0" cellpadding="0" cellspacing="0" style="border:solid 1px #CCCCCC;" ' + tTAttr + '>\n' +
'							<tr>\n' +
'								<td align="center">\n' +
'								<!--image//-->\n' +
'								<div><img src="' + picSrc + '" border="0" ' + picAttr + '></div>\n' +
'								</td>\n' +
'							</tr>\n' +
'						</table>\n';
	} else if(sNum == 2) {
		pSize = (pSize)?pSize:3;
		mAPictureType = '' +
'					<table border="0" cellpadding="' + pSize + '" cellspacing="0" style="border:solid 1px #CCCCCC; background-color:#FFFFFF;" ' + tTAttr + '>\n' +
'						<tr>\n' +
'							<td align="center">\n' +
'							<div><img src="' + picSrc + '" border="0" ' + picAttr + '></div>\n' +
'							</td>\n' +
'						</tr>\n' +
'					</table>\n';
	} else if(sNum == 3) {
		pSize = (pSize)?pSize:3;
		mAPictureType = '' +
'				<table border="0" cellpadding="0" cellspacing="0" ' + tTAttr + '>\n' +
'					<tr height="100%">\n' +
'						<td>\n' +
'						<table border="0" cellpadding="' + pSize + '" cellspacing="0" bgcolor="#FFFFFF" style="border:solid 1px #CCCCCC;" ' + iTAttr + '>\n' +
'							<tr>\n' +
'								<td align="center">\n' +
'								<!--image//-->\n' +
'								<div><img src="' + picSrc + '" border="0" ' + picAttr + '></div>\n' +
'								</td>\n' +
'							</tr>\n' +
'						</table>\n' +
'						</td>\n' +
'						<td width="2" valign="bottom">\n' +
'						<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">\n' +
'							<tr><td height="2%"></td></tr>\n' +
'							<tr><td height="98%" bgcolor="#000000" style="filter:alpha(opacity=10);"></td></tr>\n' +
'						</table>\n' +
'						</td>\n' +
'					</tr>\n' +
'					<tr>\n' +
'						<td colspan="2" height="2">\n' +
'						<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">\n' +
'							<tr><td width="2%"></td>\n' +
'							<td bgcolor="#000000" width="98%" style="filter:alpha(opacity=10);"></td></tr>\n' +
'						</table>\n' +
'						</td>\n' +
'					</tr>\n' +
'				</table>';
	} else if(sNum == 4) {
		pSize = (pSize)?pSize:2;
		mAPictureType = '' +
'				<table border="0" cellpadding="0" cellspacing="0" ' + tTAttr + '>\n' +
'					<tr><td colspan="3" height="2" bgcolor="#000000" style="filter:alpha(opacity=5);"></td></tr>\n' +
'					<tr height="100%">\n' +
'						<td width="2" bgcolor="#000000" style="filter:alpha(opacity=5);"></td>\n' +
'						<td>\n' +
'						<table border="0" cellpadding="' + pSize + '" cellspacing="0" style="border:solid 1px #CCCCCC; background-color:#FFFFFF;" ' + iTAttr + '>\n' +
'							<tr>\n' +
'								<td align="center" height="100%">\n' +
'								<!--image//-->\n' +
'								<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%" style="border:solid 1px #DDDDDD;"><tr><td align="center"><img src="' + picSrc + '" border="0" ' + picAttr + '></td></tr></table>\n' +
'								</td>\n' +
'							</tr>\n' +
'						</table>\n' +
'						</td>\n' +
'						<td width="2" bgcolor="#000000" style="filter:alpha(opacity=5);"></td>\n' +
'					</tr>\n' +
'					<tr><td colspan="3" height="2" bgcolor="#000000" style="filter:alpha(opacity=5);"></td></tr>\n' +
'				</table>\n';
	} else {
		mAPictureType = '' +
'						<table border="0" cellpadding="0" cellspacing="0" ' + tTAttr + '>\n' +
'							<tr>\n' +
'								<td align="center">\n' +
'								<!--image//-->\n' +
'								<div><img src="' + picSrc + '" border="0" ' + picAttr + '></div>\n' +
'								</td>\n' +
'							</tr>\n' +
'						</table>\n';
	}
	document.write(mAPictureType);
}

//설문조사Layer Show Hide
function tM_schedule01Div(theObj, theFlag){
	if(theObj){
		if(theObj.style.display == "none" || theFlag == "show"){
			theObj.style.display = "";
			theObj.style.top = event.y + document.body.scrollTop;
			theObj.style.left = event.x + document.body.scrollLeft;
		} else {
			theObj.style.display = "none";
		}
	}
}
