/**
 *@class Div
 *DIVクラス
 */


var Div = Class.create();
Div.prototype = {


	/**
	 *@constructor initialize
	 */
	initialize: function (id,parentObj) {
		this.id=id;
		this.parentObj=parentObj;


		if(id!=null && parentObj!=null){
			this.createDiv();
		}
	},



	/**
	 *createDiv
	 */
	createDiv : function () {
		var div=document.createElement("div");
		div.id=this.id;
		$(this.parentObj.id).appendChild(div);
	},



	/**
	 *setLeft
	 *@param left
	 */
	setLeft : function (left) {
		$(this.id).style.left=left+"px";
	},



	/**
	 *setTop
	 *@param top
	 */
	setTop : function (top) {
		$(this.id).style.top=top+"px";
	},



	/**
	 *setWidth
	 *@param width
	 */
	setWidth : function (width) {
		$(this.id).style.width=width+"px";
	},



	/**
	 *setHeight
	 *@param height
	 */
	setHeight : function (height) {
		$(this.id).style.height=height+"px";
	},



	/**
	 *setVisible
	 *@param flg
	 */
	setVisible : function (flg) {
		if(flg){
			$(this.id).style.visibility='visible';
		}else{
			$(this.id).style.visibility='hidden';
		}
	},



	/**
	 *getLeft
	 *@return val
	 */
	getLeft : function () {
		return $(this.id).offsetLeft;
	},



	/**
	 *getTop
	 *@return val
	 */
	getTop : function () {
		return $(this.id).offsetTop;
	},



	/**
	 *getWidth
	 *@param val
	 */
	getWidth : function () {
		return $(this.id).offsetWidth;
	},



	/**
	 *getHeight
	 *@param val
	 */
	getHeight : function () {
		return $(this.id).offsetHeight;
	},



	/**
	 *getVisible
	 *@param flg
	 */
	getVisible : function () {
		var flg;
		var visibility=$(this.id).style.visibility;
		if(visibility=='visible'){
			flg=true;
		}else{
			flg=false;
		}


		return flg;


	},


	/**
	 *getBorderLeftWidth
	 *@param val
	 */
	getBorderLeftWidth : function () {
		return $(this.id).style.borderLeftWidth.replace('px','');
	},


	/**
	 *getBorderRightWidth
	 *@param val
	 */
	getBorderRightWidth : function () {
		return $(this.id).style.borderRightWidth.replace('px','');
	},


	/**
	 *getBorderTopWidth
	 *@param val
	 */
	getBorderTopWidth : function () {
		return $(this.id).style.borderTopWidth.replace('px','');
	},


	/**
	 *getBorderBottomWidth
	 *@param val
	 */
	getBorderBottomWidth : function () {
		return $(this.id).style.borderBottomWidth.replace('px','');
	},


	/**
	 *getMarginLeft
	 *@param val
	 */
	getMarginLeft : function () {
		return $(this.id).style.marginLeft.replace('px','');
	},


	/**
	 *getMarginRight
	 *@param val
	 */
	getMarginRight : function () {
		return $(this.id).style.marginRight.replace('px','');
	},


	/**
	 *getMarginTop
	 *@param val
	 */
	getMarginTop : function () {
		return $(this.id).style.marginTop.replace('px','');
	},


	/**
	 *getMarginBottom
	 *@param val
	 */
	getMarginBottom : function () {
		return $(this.id).style.marginBottom.replace('px','');
	},



	/**
	 *getChildNode
	 *@param childs
	 */
	getChildNode : function () {
		var childs = $(this.id).childNodes;
		return childs;
	},



	/**
	 *removeChildNode
	 *@param childs
	 */
	removeChildNode : function () {
		while($(this.id).firstChild){
			$(this.id).removeChild($(this.id).firstChild);
		}
	}


}
