/*'################################################################################################################
'
'	È­ÀÏ¸í		: js/obj.js
'	¿ëµµ			: °´Ã¼ ¾ò¾î¿À±â
'	°ü·ÃÈ­ÀÏ		: 
'	ÀÛ¼ºÀÚ		: ¿À¸¶¸£ 
'	¼öÁ¤ÀÏ		: 
'
'                   == ¸Þ¸ð ==
' Cross Browsing À» ¸ñÇ¥
' 
' 
'################################################################################################################*/

/* ºê¶ó¿ìÀú Á¤º¸--------------------------------------------------------------------------------------*/
var lyr = document.layers         ? true:false; // nn4
var all = document.all            ? true:false; // ie4
var dom = document.getElementById ? true:false; // dom
var brwsr_opr = navigator.userAgent.indexOf("Opera")==-1 ? false:true; // opera
var ie_no_opr = (all && !brwsr_opr);
var ie_offst_h_xtr = all ? 4 : 0;


//++ °´Ã¼¾ò±â
function get_Obj(id) {
    var objct;
    if(lyr) eval("objct = document."+id+";");
    if(all) eval("objct = document.all."+id+";");
    if(dom) eval("objct = document.getElementById('"+id+"');");
    return objct;
}

//++ ´Ù¸¥ ¹®¼­¿¡¼­ °´Ã¼¾ò±â
function get_pObj(obj, id) {
    var objct;
    if(lyr) eval("objct = "+obj+".document."+id+";");
    if(all) eval("objct = "+obj+".document.all."+id+";");
    if(dom) eval("objct = "+obj+".document.getElementById('"+id+"');");
    return objct;
}

/* object start --------------------------------------------------------------------------------------*/
/*####################################################
	Å¬·¹½º·Î »ý¼ºÇØ¼­ ÇØ´ç °´Ã¼ Á¢±Ù
	Cross Browsing À» ¸ñÇ¥
	»ç¿ë¿¹)	var obj = new Object(obj); obj.set_left(300);
'####################################################*/ 
function ObjectMake(obj){
	this.obj = obj;		//++ °´Ã¼ ¾ò¾î¿À±â	
	
	//++ get
	this.get_left = get_left;
	this.get_top = get_top;
	this.get_width = get_width;
	this.get_height = get_height;
	this.get_display = get_display;
	this.get_visible = get_visible;
	
	//++ set
	this.set_left = set_left;
	this.set_top = set_top;
	this.set_width = set_width;
	this.set_height = set_height;
	this.set_display = set_display;
	this.set_visible = set_visible;
}

/* get --------------------------------------------------------------------------------------*/
function get_left() {
    if(lyr) return this.obj.left;
    if(dom) return parseInt(this.obj.style.left);
    if(all) return this.obj.style.pixelLeft;
}
function get_top() {
    if(lyr) return this.obj.top;
    if(dom) return parseInt(this.obj.style.top);
    if(all) return this.obj.style.pixelTop;
}
function get_width() {
    if(lyr) return this.obj.width;
    if(dom) return parseInt(this.obj.style.width);
    if(all) return this.obj.style.pixelWidth;
}
function get_height() {
    if(lyr) return this.obj.height;
    if(dom) return parseInt(this.obj.style.height);
    if(all) return this.obj.style.pixelHeight;
}
function get_display() {
    if(lyr) return this.obj.display;
    if(dom) return this.obj.style.display;
    if(all) return this.obj.style.display;
}
function get_visible() {
    if(lyr) return this.obj.visibility;
    if(all) return this.obj.style.visibility;
    if(dom) return this.obj.style.visibility;
}


/* set --------------------------------------------------------------------------------------*/
function set_left(value){
    if(lyr)   this.obj.left = value;
    if(all) { this.obj.style.left = value+"px"; return false; }
    if(dom)   this.obj.style.left = value+"px";
}
function set_top(value) {
    if(lyr)   this.obj.top = value;
    if(all) { this.obj.style.top = value+"px"; return false; }
    if(dom)   this.obj.style.top = value+"px";
}
function set_width(value) {
    if(lyr) this.obj.width = value;
    if(all) this.obj.style.pixelWidth = value;
    if(dom) this.obj.style.width = value+"px";
}
function set_height(value) {
    if(lyr) this.obj.height = value;
    if(all) this.obj.style.pixelHeight = value;
    if(dom) this.obj.style.height = value+"px";
}
//++ none|block
function set_display(value) {	
    if(lyr) this.obj.display = value;
    if(dom) this.obj.style.display = value;
    if(all) this.obj.style.display = value;
}
//++ visible|hidden
function set_visible(value) {
    if(lyr) this.obj.visibility = (value='visible')?'show':'hide';
    if(all) this.obj.style.visibility = value;
    if(dom) this.obj.style.visibility = value;
}

/* object end --------------------------------------------------------------------------------------*/




/*####################################################
	±× ¹ÛÀÇ ÇÔ¼ö
'####################################################*/ 
//++ ¹®¼­
function get_dcmnt() {	
    return (document.compatMode!="BackCompat") ? document.documentElement : document.body;
}
function get_innerWidth() {	
    return (all)?get_dcmnt().clientWidth+ie_offst_h_xtr: window.innerWidth;
}
function get_innerHeight() {	
    return (all)?get_dcmnt().clientHeight: window.innerHeight;
}
//++ ½ºÅ©·Ñ
function get_scrollLeft() {
    return (all)?get_dcmnt().scrollLeft : pageXOffset;
}
function get_scrollTop() {
    return (all)?get_dcmnt().scrollTop : pageYOffset;
}
