/* /library/javascript/brand1/global.js -	Brand1-specific Javascript
  
   DATE     AUTHOR  CHANGE
   03/10/03 DC      Created. Moved ftnGetMsgBoxHTML here from global.js
   08/01/04 DC      Changed subPlaceCombo so it dosn't try to throw combos "up" if they're near the bottom of the page.   
   31/03/04 DC      Added intChromeTop/Left, etc, so other JS knows how much space to play with in each brand
*/

//var intChromeTop = 130;
//var intChromeLeft = 167;
//var intChromeRight = 15;
//var intChromeBottom = -33;
//var intContentWidth  = -1;
var intChromeTop = 0;
var intChromeLeft = 0;
var intChromeRight = 0;
var intChromeBottom = 0;
var intContentWidth  = -1;

function ftnGetMsgBoxHTML(blnHideClose, intWidth, strTitle, strBody)
{
	var sHTML = '';
	sHTML += '<table width=' + intWidth + ' cellspacing="0" cellpadding="0" border="0">';
	sHTML += '  <tr class="darkergrey">';
	sHTML += '    <td rowspan="11"><img src="/images/clear.gif" height="1" width="1"></td>';
	sHTML += '    <td><img src="/images/clear.gif" height="1" width="18"></td>';
	sHTML += '    <td><img src="/images/clear.gif" height="1" width="3"></td>';
	sHTML += '    <td><img src="/images/clear.gif" height="1" width="'+(intWidth-39)+'"></td>';
	sHTML += '    <td><img src="/images/clear.gif" height="1" width="18"></td>';
	sHTML += '    <td rowspan="8"><img src="/images/clear.gif" height="1" width="1"></td>';
	sHTML += '  </tr>';
	sHTML += '  <tr class="midgrey">';
	sHTML += '    <td colspan="4"><img src="/images/clear.gif" height="4" width="'+intWidth+'"></td>';
	sHTML += '  </tr>';
	sHTML += '  <tr class="midgrey" height="1">';
	sHTML += '    <td valign="middle"><img src="/images/clear.gif" height="1" width="18"></td>';
	sHTML += '    <td valign="middle"><img src="'+gImgPath+'msgbox/msg_titlearrow.gif"></td>';
	sHTML += '    <td valign="middle" style="font-size:11px; font-weight: bold" id="dialogTitle">&nbsp;' + strTitle + '</td>';
	sHTML += '    <td valign="middle"><img src="'+gImgPath+'msgbox/msg_closebox_idle.gif" style="cursor: hand;" oversrc="'+gImgPath+'msgbox/msg_closebox_active.gif" onclick="subMsgBoxClose();"></td>';
	sHTML += '  </tr>';
	sHTML += '  <tr class="midgrey">';
	sHTML += '    <td colspan="4"><img src="/images/clear.gif" height="4" width="'+intWidth+'"></td>';
	sHTML += '  </tr>';
	sHTML += '  <tr height="1" class="midgrey">';
	sHTML += '    <td height="1" colspan="4" class="dottedRow"><img src="/images/clear.gif" height="1" width="1"></td>';
	sHTML += '  </tr>';
	sHTML += '  <tr>';
	sHTML += '    <td colspan="4" bgcolor="#ffffff"><img src="/images/clear.gif" height="12" width="'+intWidth+'"></td>';
	sHTML += '  </tr>';
	sHTML += '  <tr><td bgcolor="#ffffff"></td>';
	sHTML += '    <td bgcolor="#ffffff" id="dialogBody" colspan="2">' + strBody + '</td><td bgcolor="#ffffff"></td>';
	sHTML += '  </tr>';
	sHTML += '  <tr>';
	sHTML += '    <td bgcolor="#ffffff" colspan="4" align="right" id="dialogCloseButton">';
	  
	if (!blnHideClose)	
		sHTML += '<img src="/images/clear.gif" height="15" width="1"><br><img src="'+gImgPath+'msgbox/msg_close_button.gif" style="cursor: hand" onclick="subMsgBoxClose();"><img src="/images/clear.gif" width="11" height="1">';
	else
		sHTML += '<img src="/images/clear.gif" width="1" height="1">';
	  
	sHTML += '  </td></tr>';
	sHTML += '  <tr>';
	sHTML += '    <td bgcolor="#ffffff" colspan="3"><img src="/images/clear.gif" height="7" width="1"></td>';
	sHTML += '    <td align="right" colspan="2" rowspan="2"><img src="'+gImgPath+'msgbox/msg_right_bottom.gif"></td>';
	sHTML += '  </tr>';
	sHTML += '  <tr>';
	sHTML += '    <td bgcolor="#ffffff" class="darkergrey" colspan="3"><img src="/images/clear.gif" height="1" width="1"></td>';
	sHTML += '  </tr>';
	sHTML += '</table>';
	return sHTML;
}

function subPlaceCombo(strBaseName)
{
/*
	Purpose	:	Places a combo to its correct position on screen.
	Effects	:	None.
	Inputs	:	strBaseName - String - the base name of the combo.
	Returns	:	None.
*/	
	var objDIV = ftnGetObject("combo" + strBaseName);
	var objTop = ftnGetObject("combohead" + strBaseName);
	var objPH = ftnGetObject("comboplaceholder" + strBaseName);
	var intLeft = ftnGetObjLoc(objPH).left;
	var intTop = ftnGetObjLoc(objPH).top;
	var intComboHeight = objDIV.comboheight;
	objTop.style.left = intLeft;
	objTop.style.top = intTop;
	objDIV.style.left = intLeft;
	//if(parseInt(intComboHeight,10) + (parseInt(intTop,10) + parseInt(objPH.height - 1,10)) > document.body.scrollHeight) {
	//	objDIV.style.top = (intTop - intComboHeight) - 1;
	//} else {
		objDIV.style.top = (intTop + objPH.height) - 1;
	//}
	objTop.style.display = "inline";
	objDIV.blnFireJS = false;
}