<!-- Copyright (c) 2005 by Cisco Systems, Inc. -->
// smartports.js - Will create the frontPanel for CIGESM devices.
// <include a list of SKUs here>

function createDevice(deviceType, uiPortDataArr) {
	var device = null;
	if(deviceType.indexOf("OS-CIGESM-18") >= 0) //OS-CIGESM-18SFP-I and OS-CIGESM-18TT-EBU
		device = new OSCIGESM18SFPE(uiPortDataArr, deviceType);
}

/*
 *  This is unit tested.
 */
function OSCIGESM18SFPE(uiPortDataArr, deviceType) {
	portCount = uiPortDataArr.length;
	document.writeln('\
				  <tr><td colspan= "26" height="3" bgcolor="#f4f4f4">')
   	document.writeln('\
				  </td></tr>')
	document.writeln('\
	  						<tr>')
	writeSpaceCell(); 	writeSpaceCell();	writeSpaceCell();
	
	//included to prevent macros configured for internal ports from appearing in the customize table
	var internalPorts = 16;
	if(deviceType.indexOf("-TEL") >= 0)
		internalPorts = 10;
	for (var portId = 0; portId < internalPorts ; portId++)
		uiPortDataArr[portId].macro = MACRO_NULL;
	
	for (var portId = internalPorts; portId < portCount ; portId++) {
  		// This is extra space between port 15 and 17
		
			document.writeln('\
					<td align="center" width="21" bgcolor="#f4f4f4"><font style="font-size:9px"\
					face="Helvetica">', getPortLabel(uiPortDataArr[portId].portName), '<br>\
					</font><a href="javascript:void(0)"\
					onMouseOver="showPortInfo(\'', portId, '\', \'', uiPortDataArr[portId].portName, '\', \'', uiPortDataArr[portId].vlan, '\')"\
					onMouseOut="resetPort(); hideLayerWrapper(2000); raise(\'', portId, '\')"\
					onMouseDown="lower(\'', portId, '\', \'', uiPortDataArr[portId].macro, '\')"\
					onMouseUp="window.status=\'\'; return true"\
					onClick="toggle(\'', portId, '\', \'', uiPortDataArr[portId].macro, '\'); return false"><img\
					src="', cellImages[0][uiPortDataArr[portId].macro].src, '"\
					border="0"\
				    width="21" height="21" name="cell', '_', portId, '"></a></td>');
					
					writeSpaceCell();
					writeSpaceCell();
					writeSpaceCell();
					writeSpaceCell();
		}
		writeSpaceCell();	writeSpaceCell();	writeSpaceCell();
		document.writeln('\
			  </tr>')
		document.writeln('\
				  <tr><td colspan= "26" height="9" bgcolor="#f4f4f4">')
    	document.writeln('\
				  </td></tr>')		
}

function getPortLabel(intName) {
	var intNumber = intName.substring(intName.indexOf('/')+1);
	return parseInt(intNumber)
}


function isExtVlanSupported() {
	return true;
}

function getMaxVlans() {
      return 250;
}
