/**
@ program			: javascript ui framework;
@ auth				: thhh2™ 
@ desc				: 공통자바스크립트
**/

var th = { 

	actionfrm : "actionfrm",
	popupfrm : "popupfrm",
	checkfrm : 1, 

	// return object 
	$:function(id) { 
		if (typeof(id) !="object") return document.getElementById(id); 
		else return (id); 
	},
	$$:function(id) {
		if (typeof(id) !="object") return document.getElementsByName(id); 
		else return (id); 
	}, 
	Msg:function(types){
		switch(types){
			case "delete" : 
				return "삭제하시면 복구할 수 없습니다.\n삭제하시겠습니까?";
				break; 
			case "leave" :
				return "탈퇴하시면 "; 
				break;
			case "error " :
				return "오류가 발생하였습니다."; 
				break; 
			case "form" :
				return "이미전송중입니다. 잠시만 기다려주세요.";
				break; 
		}
	}, 


	//************************************************************************
	// Function : Onlynum
	// Description : 경고메시지 없이 무조건 숫자만
	// Argument : el - TextBox
	// Event : onKeyUp
	//************************************************************************
	Onlynum:function(){
		alert(event.keyCode);
		if((event.keyCode<48)||(event.keyCode>57))
		event.returnValue=false;
	},

	//************************************************************************
	// Function : onlyNumber
	// Description : 경고메시지 없이 무조건 숫자만
	// Argument : el - TextBox
	// Event : onKeyUp
	//************************************************************************
	onlyNumber:function ( el ) {
		if(event.keyCode != '37' && event.keyCode != '39') {
			el.value = el.value.replace( /\D/g, '' );
		}
	},

	//************************************************************************
	// Function : moveFocus
	// Description : 자동 자리 이동 함수
	// Argument : num - Max Length(int), fromform - TextBox, toform - Next TextBox
	// Event : OnKeyUp
	//************************************************************************
	moveFocus:function (num,fromform,toform){
		var str = fromform.value.length;
		if(str == num)
			toform.focus();
	},





	
	English:function(){
	}, 

	Go : function(code, subp) {
		if (code!=null) {
			var url = "";
			if (arguments[2]) { url = arguments[2]; } 
			this.Url("/menucode.asp?code="+ code + "&subp="+subp + url, ""); 
//			window.location.href = "/menucode.asp?code="+ code + "&subp="+subp + url; 
		}
	},
	Back:function(){ window.history.go(-1);},
	Url : function(url, t){ 
		if (t=="blank") {
			window.open(url); 
		} else {
			window.location.href=url; 
		}
	},
	Reload : function() {
		window.location.reload();
	},
	Home : function() {
		this.Url("/menucode.asp?code=main&subp=00", ""); 
//		window.location.href="/menucode.asp?code=main&subp=00"; 
	},
	Open : function(url, name, features) {
		if (url) {
//			var contwin ="";
//			var contwin = name; 
//			if (contwin!=null && contwin.closed==false) { contwin.close(); }
			var contwin = window.open(url,name,features);
			if (contwin==null) {
				alert("차단된 팝업창을 허용해주세요.");
			} else {
				contwin.focus(); 
			}
			
		}
	},
	Close : function() { opener = self;  self.close(); },
	CloseToday : function(popid) { 
		var nowdate = new Date();
		// 오늘자정까지만 띄움
		var time = 1440 - (nowdate.getHours()*60+nowdate.getMinutes());
		this.setCookie(popid, "none", time);
		this.Close();
	}, 
	Modal : function (url, name, features) { window.showModalDialog(url, window, features); },
	ModalResize : function() {
		var dw = window.dialogWidth;
		while (isNaN(dw))  {
		  dw = dw.substr(0,dw.length-1);
		}

		difw = dw - document.body.clientWidth;
		window.dialogWidth = document.body.scrollWidth+difw+'px';

		var dh = window.dialogHeight;
		while (isNaN(dh)) {
		  dh = dh.substr(0,dh.length-1);
		}
		difh = dh - document.body.clientHeight;
		window.dialogHeight = document.body.scrollHeight+difh+'px';
	},
	Error : function (e) {alert(e+"\n"+e.description); }, 
	Regular : function(chk, frm, msg) {
		var strValue = frm.value;
		var blnExp = false; 
		switch (chk) {
			case "id" : 
				if (frm.value.match(/[A-Za-z0-9]{4,15}\w*/g)!=strValue){break;}
				blnExp = true;
			case "email" :
				if (frm.value.match(/[\w\-]+\@[\w\-]+(\.[\w\-]+)+/g)!=strValue){break;}
				blnExp = true;
			case "number" :
				if (frm.value.match(/\d+/g)!=strValue){ break;}
				blnExp = true;
			case "phone" :
				if (frm.value.match(/[0-9]{2,3}\-[0-9]{3,4}\-[0-9]{4}/g)!=strValue){break;}
				blnExp = true;
			case "mphone" :		
				if (frm.value.match(/01[016789]\-[0-9]{3,4}\-[0-9]{4}/g)!=strValue){ break;}
				blnExp = true;
			case "date" :
				if (frm.value.match(/[0-9]{4}\-[0-9]{2}\-[0-9]{2}/g)!=strValue){break;}
				blnExp = true;
			case "homepage" :
				if (frm.value.match(/\w+:\/\/[^#]*/g)!=strValue){		break;}
				blnExp = true;
			case "checked" : 
				if (typeof(frm)=="object"){
					if (typeof(frm.length)=="undefined"){
						if (frm.checked) { blnExp = true; }
					}
					else{
						for (i = 0 ; i < frm.length; i++){
							if (frm[i].checked){	blnExp = true;		}
						}
					}
				}
				
				break;
			case "selected" :
				if (frm.value==""){ break ;}
				blnExp = true;
				
			case "idn1" :
				if (frm.value.match(/[0-9]{6}/g)!=strValue){ break; }
				blnExp = true;
			case "idn2" :
				if (frm.value.match(/[0-9]{7}/g)!=strValue){break; }
				blnExp = true;
			case "company" :
				if (frm.value.match(/[0-9]{3}\-[0-9]{2}\-[0-9]{5}/g)!=strValue){break;}
				blnExp = true;	
			
			default : //공백체크;
				if (frm.value.match(/\S/)==null){break;}
				blnExp = true;
		}
		
		if (!blnExp){ if (msg) alert(msg);if ((chk!="checked")&&(chk!="selected")){frm.focus();};	return false;	}
		else{return true;}
	},

	// get operating system;
	getOs : function() { return window.navigator.appVersion.split(";")[2]; 	}, 
	// get brower version; 
	getBrower : function(){ return navigator.userAgent.toUpperCase();}, 
	ShowHide : function(o, action) { o.style.display=action; }, 
	ShowHideyn : function(o) { return (o.style.display=="none") ? false : true; }, 
	ShowHideArray : function(o, num) {
		var obj = th.$$(o); 
//		var obj = document.all[o]; 

		if (obj.length==null) {
			(this.ShowHideyn(obj)) ? this.ShowHide(obj, "none") : this.ShowHide(obj,"block"); 
		} else {
			for (i=0; i<obj.length; i++) {
				if (i==num) {
					(this.ShowHideyn(obj[num])) ? this.ShowHide(obj[num], "none") : this.ShowHide(obj[num],"block"); 
				} else {
					this.ShowHide(obj[i], "none"); 
				}
			}
		}
	},

	Toggle : function(id) { 
		this.$(id).style.display=(this.getStyle(this.$(id), "display")=="none") ? "block":"none"; 
	},
	
	getStyle : function(obj, att) {
		return obj.style[att]; 
	},

	Trim : function(str){
		return str.replace(/S/g, ""); 
	}, 


	Flash : function(url, width, height, strparam) {
		var wmode = "transparent";
		var id = "";
		var quality = "high";
		var menu = "false";
		var allowScriptAccess = "sameDomain";

		var flash='';
		flash += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+ width +'" height="'+ height +'"> ';
		flash += '<param name="movie" value="'+ url +'">';
		flash += '<param name="quality" value="'+ quality +'">';
		flash += '<param name="menu" value="'+ menu +'">';
		flash += '<param name="wmode" value="'+ wmode +'">';
		flash += '<param name="FlashVars" value="'+ strparam +'">';
		flash += '<embed src="'+ url +'" quality="'+ quality +'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ width +'" height="'+ height +'" wmode="transparent"></embed> ';
		flash += '</object>';

		document.write(flash);
	}, 
	
	Embed : function(url, width, height) {
		var object='';
		object='<embed src="'+url+'" width="'+width+'" height="'+height+'" align="baseline" border="0" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=media&sba=plugin&" name="MediaPlayer" showcontrols="1" showpositioncontrols="0" showaudiocontrols="1" showtracker="1" showdisplay="0" showstatusbar="1" autosize="0" showgotobar="0" showcaptioning="0" autostart="1" autorewind="0" animationatstart="0" transparentatstart="0" allowscan="1" enablecontextmenu="1" clicktoplay="0" invokeurls="1" defaultframe="datawindow"></embed>';
		document.write(object); 
	}, 


	ImageResize:function(imgid, sizew) {
		var img = document.images(imgid); 
		if (img) {
			if (img.length==null){
				imgwidth = img.width ; imgheight = img.height;
				if (sizew < imgwidth){
					imgW = sizew; 
					imgH = parseInt((sizew/imgwidth) * imgheight);
				}
				else{
					imgW = imgwidth ;
					imgH = imgheight;
				}
				img.width = imgW;
				img.height = imgH;		
			}
			else{
				for (i = 0 ; i < img.length; i++) {
					imgwidth = img[i].width ; imgheight = img[i].height;
					if (sizew < imgwidth){
						imgW = sizew; 
						imgH = parseInt((sizew/imgwidth) * imgheight);
					}
					else{
						imgW = imgwidth ;
						imgH = imgheight;
					}
					img[i].width = imgW;
					img[i].height = imgH;
				}
			}
		}
	},

	
	setCookie : function(name, value, expiredays) {
		var todayDate = new Date();
		todayDate.setTime(todayDate.getTime() + (1000*60*parseInt(expiredays)) );
		document.cookie = name +"="+escape(value)+";path=/; expires=" + todayDate.toGMTString() + ";" ;			
	},

	getCookie : function(name) {
		var nameOfCookie = name + "="; 
		var x = 0; 
		while ( x <= document.cookie.length ) { 
				 var y = (x+nameOfCookie.length); 
				 if ( document.cookie.substring( x, y ) == nameOfCookie ) { 
					   if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 ) 
								endOfCookie = document.cookie.length; 
					   return unescape( document.cookie.substring( y, endOfCookie ) ); 
				 } 
				 x = document.cookie.indexOf( " ", x ) + 1; 
				 if ( x == 0 ) 
					   break; 
		} 
		return ""; 
	},
	

	// check
	CheckAll : function(f) {

		var chkvalue = document.all.item(f);

		if (chkvalue) {
			var chklen = chkvalue.length;
		
			if (chklen==null || chklen==""){
				if(chkvalue.checked) { chkvalue.checked=false; }
				else { 
					if (chkvalue.disabled==false) { chkvalue.checked=true; } 
				}
			}
			else{
				for(i=0;i<chklen;i++){
					if(chkvalue[i].type=='checkbox'){
						if(chkvalue[i].checked) { chkvalue[i].checked=false; }
						else {
							if (chkvalue[i].disabled==false) { chkvalue[i].checked=true; } 
							// chkvalue[i].checked=true; 
						}
					}
				}
			}
		}
	},

	// checkbox value; 
	CheckValue : function(f, msg) {
		var v="" , msg ;
		var chkvalue = document.all.item(f);
		var chklen = chkvalue.length;
		
		if (chklen==null || chklen==""){
			if (chkvalue.checked){
				v=chkvalue.value+",";
			}
		}
		else{
			for(i=0;i<chklen;i++){
				if(chkvalue[i].type=='checkbox'){
					if(chkvalue[i].checked) { 
						v=chkvalue[i].value+","+v
					}
				} else {
					v = chkvalue[i].value +  "," + v
				}
			}
		}
		
		if (v==""){	alert(msg); return false;}
		else{return v;}
	}, 

	// checked value; 
	CheckedValue:function(frm) {
		try { 
			var returnvalue;

			if (typeof(frm)=="object"){
				if (typeof(frm.length)=="undefined"){
					if (frm.checked) { returnvalue = frm.value; }

				}
				else{
					for (i = 0 ; i < frm.length; i++){
						if (frm[i].checked){ returnvalue = frm[i].value; }
					}
				}
			}

			return returnvalue;

		}
		catch (e) {
			this.Error(e);
		}
	}, 

	Lower:function(s) { return s.toLowerCase(); }, 
	Upper:function(s) { return s.toUpperCase(); },

	ResizeFrame:function(name){
		var frame = parent.th.$(name); 
		if (frame) {
			frame.style.height=document.body.scrollHeight;
		}
	},
	ByteCheck:function(input,id,length){
		var obj = this.$(id); 
		var j=0;
		for(var i=0;i<input.value.length;i++) {
			val=escape(input.value.charAt(i)).length;
			if(val== 6) { j++; }
			else{ j++; }
		}
		
		obj.innerHTML = j;
		if(j > length) {
			alert(length+'자 이하로 해주세요!   '); return false;
		} 
		else {  return true;  }
	}, 
	
	Zoom:function(url) {
		this.Open('/common/zoom.asp?name='+url,'','directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=no,toolbar=no,width=400,height=400');
	}, 
	ContentsDivide:function(f, strValue) {
		var limit = 102399; 
		var temp = ""; 
		while (strValue.length > 0 ) {
			temp = document.createElement("TEXTAREA"); 
			temp.name = "contents1";
			temp.value = strValue.substr(0, limit); 
			f.appendChild(temp); 
			strValue = strValue.substr(limit); 
		}

		temp = document.createElement("TEXTAREA");
		temp.name = "contents1"; 
		temp.value = strValue; 
		f.appendChild(temp); 
	},
	
	Leftmenu:function(code){
		if (code > 0){
			var obj_img = document.all["leftnavi"+code] ;
			var img_name = obj_img.name;
			obj_img.src = "/images/"+imgfolder+"/"+img_name+"_over_"+ code +".gif";
			this.LeftmenuTr(code);
		}
	},
	
	LeftmenuTr:function(code){
		if (code > 0){
			var obj_tr = document.all["leftnavi"+ code +"_tr"]; 
			if (typeof(obj_tr)=="object") {
				if (obj_tr.style.display=="none") {
					obj_tr.style.display = "block";
				}
			}
		}
	},
	
	LeftmenuSub:function(code,subp){
		try {
			if (code > 0){
				var obj_img = document.all["leftnavi"+code+subp] ;
				var img_name = obj_img.name;
				obj_img.src = "/images/"+imgfolder+"/"+img_name+"_over_"+ subp +".gif";
			}			
		}
		catch (e) {
		}
	},




	ChangeFocus:function(val,len,nextfrm){
		if( val.length == len) nextfrm.focus();
	},


	

	Nokey:function(){
		event.returnValue=false;
	},
	

	GoLogin:function(){
		var strparameter = window.location.search; 
		if (strparameter.length>0) {
			if (strparameter.indexOf("returl" , 0) > 0){
				window.location.reload();
			}
			else {
				window.location.href="/?code=login&subp=0101&returl="+escape(window.location.pathname+window.location.search);
			}
		}
		else {
			window.location.href="/?code=login&subp=0101&returl="+escape(window.location.pathname+window.location.search);
		}

		return;
	},
	GoLogout:function(){
		var strparameter = window.location.search; 
		var tmp = ""; 
		if (strparameter.length>0) {
			tmp = escape(window.location.pathname+window.location.search);
		} 
		window.location.href="/common/logout.asp?returl="+tmp;
	},
	NeedLogin:function(){
		alert("로그인이 필요한 서비스 입니다.\n로그인 후 이용하시기 바랍니다.");
		window.location.href="/?code=login&subp=0101&returl="+escape(window.location.pathname+window.location.search);
		return;
	}, 
	
	// 날짜비교, 앞뒤
	IsDate:function(sdate,edate){
		if (sdate.indexOf("-")>0) {
			split_sdate = sdate.split("-"); 
			syear = split_sdate[0]; 
			smonth = Number(split_sdate[1]); 
			sday = Number(split_sdate[2]); 
		} 
		if (edate.indexOf("-")>0) {
			split_edate = edate.split("-"); 
			eyear = split_edate[0]; 
			emonth = Number(split_edate[1]); 
			eday = Number(split_edate[2]); 
		} 

		var start_date = new Date(syear,smonth-1,sday);
		var end_date = new Date(eyear,emonth-1,eday);

		var start_date = new Date(Date.parse(start_date));
		var end_date = new Date(Date.parse(end_date));
		
		if (start_date > end_date){
			return false;
		}
		else {
			return true;
		}
	},

	
	GoPrint:function(){
		var obj = th.$("printHTML");
		if (obj!=null){
			this.Open('/popup/popup_print.asp','printpopup','width=743, height=550,scrollbars=yes');
		}
		else{ alert("인쇄할 내용이 없습니다."); }
	},
	StatusBar:function(){
		window.status = "완료";
		return true;
	},
	Price:function(v){
		this.Open('/facil/popup/price.html', 'price', 'width=693, height=550, scrollbars=yes'); 
	}
};




//if (document.layers)
//document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT | Event.MOUSEDOWN); 
//document.onmouseover = th.StatusBar;
//document.onmouseout = th.StatusBar;
//document.onclick = th.StatusBar;

//DESIGN에 필요한 스크립트
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


//************************************************************************
// Function : id2Test
// Description : ID 및 닉네임 중복체크
// Argument : mode - string
//************************************************************************

//function id2Test(mode)
//{
//
//	if(mode == 'ID') {
//		if(!frm.ID.value){
//			alert("희망 ID를 입력하세요");
//			frm.ID.focus();
//			return;
//		}
//
//
//
//		if (!checkID(frm.ID)) return false;	
//
//		/*
//		var url = "id_check.html", arg = "" , ID = "";
//		if ( document.frm.id.value != "" )
//			arg = "?str=" + document.frm.id.value + "&mode=" + mode;
//			
//		*/
//		var url = JS_HOME_URL + "member/member_check.asp";
//		//var arg = "?MEM_ID=" + escape(document.frm.ID.value);
//		//var arg = "MEM_ID=" + document.frm.ID.value;
//		var responseText = "";
//		
//		if(window.XMLHttpRequest) {
//			xmlhttp = new XMLHttpRequest();
//		} else if(window.ActiveXObject) {
//			try {
//				xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
//			} catch(e1) {
//				try {
//					xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
//				} catch(e2) {
//				}
//			}
//		}
//
//
//
//		xmlhttp.open("POST", url, true);
//		//xmlhttp.open("POST", url + arg, true);
//		//xmlhttp.open("GET", url + arg, true);
//		//alert(url + arg);
//		xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
//		//xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded;charset=UTF-8');
//
//	
//	  	xmlhttp.onreadystatechange = function() {
//			if(xmlhttp.readyState == 4)
//			{
//				switch (xmlhttp.status) 
//				{
//					case 404:
//				   		alert("오류404");
//						break;
//				   case 500:
//				   		alert("오류500");
//					   break;
//				}            
//			}
//				   		//alert(xmlhttp.readyState);
//				   		//alert(xmlhttp.status);
//				   		//alert(xmlhttp.statusText);
//
//		   	if(xmlhttp.readyState==4 && xmlhttp.status == 200 && xmlhttp.statusText=='OK') {
//			    responseText = xmlhttp.responseText;
//		   	}
//		}
//		
//		var pramMEM_ID = document.frm.ID.value;
//
//		xmlhttp.send("MEM_ID=" + pramMEM_ID);
//		//xmlhttp.send();
//
//		if (responseText=="YES") {
//	   		alert("이미 등록된 ID입니다.\n\n다시 입력하시기 바랍니다.");
//	   		return;
//	   	} else {
//	   		//url = "http://210.204.162.1/check_web/member_check.asp";
//			//arg = "?str=" + document.frm.id.value + "&mode=" + mode;
//	   		alert("등록되지 않은 ID입니다.\n\n이용가능합니다.");
//	   		frm.iddup.value = "true";
//	   		return;
//	   	}
//	} else if(mode == 'nick') {
//		if(!frm.nickname.value){
//			alert("닉네임을 입력하세요");
//			frm.nickname.focus();
//			return;
//		}
//		var url = "id_check.html", arg = "" , ID = "";
//		if ( document.frm.nickname.value != "" )
//			arg = "?str=" + document.frm.nickname.value + "&mode=" + mode;
//	}
//	
//	var win = window.open( url + arg, "check", "width=250,height=170,resizable= no" );
//	if ( win.focus )
//		win.focus();
//}



//************************************************************************
// Function : checkSpace
// Description : 문자열 중간에 공백이 있는지 여부 확인
// Argument : str - string
// Return : true/false(1/0)
//************************************************************************
function checkSpace( str )
{
     if(str.search(/\s/) != -1){
     	return 1;
     }
     else {
        return 0;
     }
}


//************************************************************************
// Function : checkID
// Description : 아이디 체크 ( 첫자 영문자, 4~12자 )
// Argument : IDS - TextBox
// Return : true/false(1/0)
//************************************************************************
function checkID( IDS )
{
 	 str = IDS.value;
	 /* check whether input value is included space or not  */
     if( checkSpace(str) ) {
        alert("아이디는 빈 공간 없이 입력하시기 바랍니다.");
		IDS.focus(); 
		return 0; 
     } 

	 var ch = str.charAt(0);
	 var isCH = /^[a-z]$/;
	 if ( !isCH.test(ch) ) {
		alert("아이디 첫 문자는 반드시 영문 소문자를 사용해 주세요.");
		IDS.focus(); 
		return 0;
     }

     /* checkFormat  */
     var isID = /^[a-z0-9]{4,12}$/;
     if( !isID.test(str) ) {
        alert("아이디는 4~12자의 영문 소문자와 숫자만 사용할 수 있습니다."); 
		IDS.focus(); 
		return 0; 
     }

     return 1;
}

		function toggle_Check(nType) {
			if (nType == 0) //전체해제
				var vcheck = false;
			else if (nType == 1) //전체선택
				var vcheck = true;
			var from = document.getElementsByName("select_id[]");

			if(typeof(from.length) == "number"){
				for (var i=0;i < from.length;i++){
					if (from[i].type == "checkbox") {
						from[i].checked = vcheck;
					}
				}
			}else{
				if (from.type == "checkbox") {
					from.checked = vcheck;
				}
			}
		}

		function resizeFrame(iframeObj)
		{
			var innerBody = iframeObj.contentWindow.document.body;
			var innerWidth = innerBody.scrollWidth + (innerBody.offsetWidth - innerBody.clientWidth);
			var innerHeight = innerBody.scrollHeight + (innerBody.offsetHeight - innerBody.clientHeight);

			iframeObj.style.width = innerWidth;
			iframeObj.style.height = innerHeight;
			this.scrollTo(1,1);
		}
