/*
 * Copyright(C) 2009 avanza Co.,Ltd. All rights reserved.
 * http://www.avnz.co.jp/
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
dojo.provide("aipo.intramail.utils");

aipo.intramail.utils.onModalDialogWide = function(bln){
	
	var viewport = dijit.getViewport();
	var marginBox = dojo.marginBox("modalDialog");
	var widthWide = 640;
	if(bln){
	    dojo.style("modalDialog","width",widthWide+"px");
	    dojo.style("modalDialog","position","absolute");
	    dojo.style("modalDialog","left",Math.floor((viewport.l + (viewport.w -  widthWide)/2)) + "px");
	    //dojo.style("modalDialog","top",Math.floor(viewport.t + 10) + "px");
	    dojo.style("modalDialog","top",Math.floor(viewport.t + 50) + "px");
	}else{
	    dojo.style("modalDialog","width","");
	    dojo.style("modalDialog","left","");
	    dojo.style("modalDialog","top","");
	}
}

aipo.intramail.utils.hideDialog = function() {
	aipo.intramail.utils.onModalDialogWide(false);
	aipo.common.hideDialog();
}