
function WindowSystems(){	
	this.tabWindow=new Array();
	this.openedWindow=null;
	this.isOpened=_isOpened;
	this.addWindow=_addWindow;
	this.removeWindow=_removeWindow;
	this.getWindow=_getWindow;
	this.createWindow=_createWindow;
	this.getCurrentWindow=_getCurrentWindow;
	this.getWindowByModuleName=_getWindowByModuleName;
	this.openWindow=_openWindow;			

	this.divHeaderBorderTopColor="#7C91AC";
		
}

function _addWindow(windowId_,window_){
	this.tabWindow[windowId_]=window_;
}

function _removeWindow(windowId_){
	this.tabWindow[windowId_]=null;
}

function _getWindow(windowId_){
	return this.tabWindow[windowId_];
}


function _getWindowByModuleName(moduleName){
	return this.tabWindow["cw_"+moduleName];
}

function _getCurrentWindow(){
return this.openedWindow;
}

function _openWindow(modName_, url_, obj_){
	var cwindow_=this.getWindowByModuleName(modName_);
	cwindow_.showExplode(obj_);
	cwindow_.loadGeneralLink(url_);
}

function _createWindow(id_, el_event_, title_){
	if(!this.tabWindow[id_])
		this.tabWindow[id_] = new CWindow(id_, el_event_,title_);

	return this.getWindow(id_);
}

function _isOpened(cWin){

	for(var cw in this.tabWindow){
		//alert(cw);
		try{
		if(this.tabWindow[cw].id != cWin.id && this.tabWindow[cw].hide) this.tabWindow[cw].hide();//alert(this.tabWindow[cw].id);//
		}catch(e){}
	}
	this.openedWindow=cWin;
}
