<!-- Copyright (c) 2005-2006 by Cisco Systems, Inc. -->
// discover.js for Cat3750 devices and mirage devices.
//Bullseye devices
function BULLSEYE24P(int_status, media_type) {
	var dev = new top.device();

	dev.noofports = 26;
	dev.x=0;
	dev.y=0;
	dev.image = "images/c3780_24_4_poe.gif";

	drawLedsForPowerSwitch(dev);
	drawACOK_DCOKLEDs(dev);	
	// Create the ports
	var port;
	var portWidth = 19;
	var portImages = top.rj45portImages();
	var portInvImages = top.rj45portInvImages();
	var xPortGap = 1;
	var xPortGroupGap = 8;
	var xPortStartPos = 320;
	var xPortCoord = xPortStartPos;
	var yPortCoord;

	// Add the 24 FastEthernet ports in 2 groups of 12 each.
	for(i=0; i<24; i++) {       
		if(i%2 == 0) {
			yPortCoord = 17;
			port = new top.rj45portInv(portInvImages);
		} else {
			yPortCoord = 33;
			port = new top.rj45port(portImages);
		}
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 != 0) {
			xPortCoord += (portWidth + xPortGap);
		}
		if(i==11 || i == 23) {
			xPortCoord += (xPortGroupGap - xPortGap);
		}
		dev.addPort(port);
    	}
	var intNames = new Array();
	var portInd = 24;
	for (i=0; i< int_status.length; i++)
	{
		intNames[i] = int_status[i][0];
	}
	var interfaces = "#"+intNames.join('#')+"#";
	if (interfaces.indexOf("0/25") != -1)
	{
		// Add the 2 sfp ports
		xPortCoord = 597;
		xPortGap = 1;
		portWidth = 21;
		for(i=portInd; i<portInd+2; i++) 
		{       
			yPortCoord = 13;		
			port = new top.SFPport(int_status[i][6], portImages); // pass the module type plugged-in the SFP slot
			port.index = i;
			port.x = xPortCoord;
			port.y = yPortCoord;
			port.id = "port_" + i;
			xPortCoord += (portWidth + xPortGap);
			dev.addPort(port);
		}
		portInd+=2;
		addLabel(dev,25,26);
	}

	if (interfaces.indexOf("0/27") != -1)
	{
		// Add the 2 sfp ports
		xPortCoord = 597;
		xPortGap = 1;
		portWidth = 21;
		for(i=portInd; i<portInd+2; i++) 
		{       
			yPortCoord = 37;		
			port = new top.SFPport(int_status[i][6], portImages); // pass the module type plugged-in the SFP slot
			port.index = i;
			port.x = xPortCoord;
			port.y = yPortCoord;
			port.id = "port_" + i;
			xPortCoord += (portWidth + xPortGap);
			dev.addPort(port);
		}
		portInd+=2;
		addLabel(dev,27,28);
	}
	if (interfaces.indexOf("0/25") == -1)
	{
		// Add the 1 10G X2 module
		xPortCoord = 597;
		yPortCoord = 13;		
		port = new top.tenGbSFPport(int_status[portInd][6], portImages); // pass the module type plugged-in the SFP slot
		port.index = portInd;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + portInd;
		dev.addPort(port);
		addLabel(dev,1);
		portInd+=1;
	}
	if (interfaces.indexOf("0/27") == -1)
	{
		// Add the 1 10G X2 module
		xPortCoord = 597;
		yPortCoord = 37;		
		port = new top.tenGbSFPport(int_status[portInd][6], portImages); // pass the module type plugged-in the SFP slot
		port.index = portInd;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + portInd;
		addLabel(dev,2);
		dev.addPort(port);
	}

	dev.modeAliases = new Array ("STATUS", "DUPLEX", "SPEED", "STACK", "PoE");	
	return dev;
}

function BULLSEYE24(int_status, media_type) {
	var dev = new top.device();

	dev.noofports = 26;
	dev.x=0;
	dev.y=0;
	dev.image = "images/c3780_24_4_no_poe.gif";

	drawLeds(dev);
        drawACOK_DCOKLEDs(dev);	
	// Create the ports
	var port;
	var portWidth = 19;
	var portImages = top.rj45portImages();
	var portInvImages = top.rj45portInvImages();
	var xPortGap = 1;
	var xPortGroupGap = 8;
	var xPortStartPos = 320;
	var xPortCoord = xPortStartPos;
	var yPortCoord;

	// Add the 24 FastEthernet ports in 2 groups of 12 each.
	for(i=0; i<24; i++) {       
		if(i%2 == 0) {
			yPortCoord = 17;
			port = new top.rj45portInv(portInvImages);
		} else {
			yPortCoord = 33;
			port = new top.rj45port(portImages);
		}
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 != 0) {
			xPortCoord += (portWidth + xPortGap);
		}
		if(i==11 || i == 23) {
			xPortCoord += (xPortGroupGap - xPortGap);
		}
		dev.addPort(port);
    	}
	var intNames = new Array();
	var portInd = 24;
	for (i=0; i< int_status.length; i++)
	{
		intNames[i] = int_status[i][0];
	}
	var interfaces = "#"+intNames.join('#')+"#";
	if (interfaces.indexOf("0/25") != -1)
	{
		// Add the 2 sfp ports
		xPortCoord = 597;
		xPortGap = 1;
		portWidth = 21;
		for(i=portInd; i<portInd+2; i++) 
		{       
			yPortCoord = 13;		
			port = new top.SFPport(int_status[i][6], portImages); // pass the module type plugged-in the SFP slot
			port.index = i;
			port.x = xPortCoord;
			port.y = yPortCoord;
			port.id = "port_" + i;
			xPortCoord += (portWidth + xPortGap);
			dev.addPort(port);
		}
		portInd+=2;
		addLabel(dev,25,26);
	}

	if (interfaces.indexOf("0/27") != -1)
	{
		// Add the 2 sfp ports
		xPortCoord = 597;
		xPortGap = 1;
		portWidth = 21;
		for(i=portInd; i<portInd+2; i++) 
		{       
			yPortCoord = 37;		
			port = new top.SFPport(int_status[i][6], portImages); // pass the module type plugged-in the SFP slot
			port.index = i;
			port.x = xPortCoord;
			port.y = yPortCoord;
			port.id = "port_" + i;
			xPortCoord += (portWidth + xPortGap);
			dev.addPort(port);
		}
		portInd+=2;
		addLabel(dev,27,28);

	}
	if (interfaces.indexOf("0/25") == -1)
	{
		// Add the 1 10G X2 module
		xPortCoord = 597;
		yPortCoord = 13;		
		port = new top.tenGbSFPport(int_status[portInd][6], portImages); // pass the module type plugged-in the SFP slot
		port.index = portInd;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + portInd;
		dev.addPort(port);
		addLabel(dev,1);
		portInd+=1;
	}
	if (interfaces.indexOf("0/27") == -1)
	{
		// Add the 1 10G X2 module
		xPortCoord = 597;
		yPortCoord = 37;		
		port = new top.tenGbSFPport(int_status[portInd][6], portImages); // pass the module type plugged-in the SFP slot
		port.index = portInd;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + portInd;
		dev.addPort(port);
		addLabel(dev,2);
	}

	dev.modeAliases = new Array ("STATUS", "DUPLEX", "SPEED", "STACK");	
	return dev;
}


function BULLSEYE48P(int_status, media_type) {
	var dev = new top.device();

	dev.noofports = 26;
	dev.x=0;
	dev.y=0;
	dev.image = "images/c3780_48_4_poe.gif";

	drawLedsForPowerSwitch(dev);
        drawACOK_DCOKLEDs(dev);	
	// Create the ports
	var port;
	var portWidth = 19;
	var portImages = top.rj45portImages();
	var portInvImages = top.rj45portInvImages();
	var xPortGap = 1;
	var xPortGroupGap = 8;
	var xPortStartPos = 66;
	var xPortCoord = xPortStartPos;
	var yPortCoord;

	// Add the 24 FastEthernet ports in 4 groups of 12 each.
	for(i=0; i<48; i++) {       
		if(i%2 == 0) {
			yPortCoord = 17;
			port = new top.rj45portInv(portInvImages);
		} else {
			yPortCoord = 33;
			port = new top.rj45port(portImages);
		}
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 != 0) {
			xPortCoord += (portWidth + xPortGap);
		}
		if(i==11 || i == 23 || i == 35 ) {
			xPortCoord += (xPortGroupGap - xPortGap);
		}
		dev.addPort(port);
    	}
	var intNames = new Array();
	var portInd = 48;
	for (i=0; i< int_status.length; i++)
	{
		intNames[i] = int_status[i][0];
	}
	var interfaces = "#"+intNames.join('#')+"#";
	if (interfaces.indexOf("0/49") != -1)
	{
		// Add the 2 sfp ports
		xPortCoord = 597;
		xPortGap = 1;
		portWidth = 21;
		for(i=portInd; i<portInd+2; i++) 
		{       
			yPortCoord = 13;		
			port = new top.SFPport(int_status[i][6], portImages); // pass the module type plugged-in the SFP slot
			port.index = i;
			port.x = xPortCoord;
			port.y = yPortCoord;
			port.id = "port_" + i;
			xPortCoord += (portWidth + xPortGap);
			dev.addPort(port);
		}
		portInd+=2;
		addLabel(dev,49,50);

	}

	if (interfaces.indexOf("0/51") != -1)
	{
		// Add the 2 sfp ports
		xPortCoord = 597;
		xPortGap = 1;
		portWidth = 21;
		for(i=portInd; i<portInd+2; i++) 
		{       
			yPortCoord = 37;		
			port = new top.SFPport(int_status[i][6], portImages); // pass the module type plugged-in the SFP slot
			port.index = i;
			port.x = xPortCoord;
			port.y = yPortCoord;
			port.id = "port_" + i;
			xPortCoord += (portWidth + xPortGap);
			dev.addPort(port);
		}
		portInd+=2;
		addLabel(dev,51,52);
	}
	if (interfaces.indexOf("0/49") == -1)
	{
		// Add the 1 10G X2 module
		xPortCoord = 597;
		yPortCoord = 13;		
		port = new top.tenGbSFPport(int_status[portInd][6], portImages); // pass the module type plugged-in the SFP slot
		port.index = portInd;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + portInd;
		dev.addPort(port);
		addLabel(dev,1);
		portInd+=1;
	}
	if (interfaces.indexOf("0/51") == -1)
	{
		// Add the 1 10G X2 module
		xPortCoord = 597;
		yPortCoord = 37;		
		port = new top.tenGbSFPport(int_status[portInd][6], portImages); // pass the module type plugged-in the SFP slot
		port.index = portInd;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + portInd;
		dev.addPort(port);
		addLabel(dev,2);
	}

	dev.modeAliases = new Array ("STATUS", "DUPLEX", "SPEED", "STACK", "PoE");	
	return dev;
}

function BULLSEYE48(int_status, media_type) {
	var dev = new top.device();

	dev.noofports = 26;
	dev.x=0;
	dev.y=0;
	dev.image = "images/c3780_48_4_no_poe.gif";

	drawLeds(dev);
        drawACOK_DCOKLEDs(dev);	
	// Create the ports
	var port;
	var portWidth = 19;
	var portImages = top.rj45portImages();
	var portInvImages = top.rj45portInvImages();
	var xPortGap = 1;
	var xPortGroupGap = 8;
	var xPortStartPos = 66;
	var xPortCoord = xPortStartPos;
	var yPortCoord;

	// Add the 24 FastEthernet ports in 4 groups of 12 each.
	for(i=0; i<48; i++) {       
		if(i%2 == 0) {
			yPortCoord = 17;
			port = new top.rj45portInv(portInvImages);
		} else {
			yPortCoord = 33;
			port = new top.rj45port(portImages);
		}
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 != 0) {
			xPortCoord += (portWidth + xPortGap);
		}
		if(i==11 || i == 23 || i == 35 ) {
			xPortCoord += (xPortGroupGap - xPortGap);
		}
		dev.addPort(port);
    	}
	var intNames = new Array();
	var portInd = 48;
	for (i=0; i< int_status.length; i++)
	{
		intNames[i] = int_status[i][0];
	}
	var interfaces = "#"+intNames.join('#')+"#";
	if (interfaces.indexOf("0/49") != -1)
	{
		// Add the 2 sfp ports
		xPortCoord = 597;
		xPortGap = 1;
		portWidth = 21;
		for(i=portInd; i<portInd+2; i++) 
		{       
			yPortCoord = 13;		
			port = new top.SFPport(int_status[i][6], portImages); // pass the module type plugged-in the SFP slot
			port.index = i;
			port.x = xPortCoord;
			port.y = yPortCoord;
			port.id = "port_" + i;
			xPortCoord += (portWidth + xPortGap);
			dev.addPort(port);
		}
		portInd+=2;		
		addLabel(dev,49,50);
	}

	if (interfaces.indexOf("0/51") != -1)
	{
		// Add the 2 sfp ports
		xPortCoord = 597;
		xPortGap = 1;
		portWidth = 21;
		for(i=portInd; i<portInd+2; i++) 
		{       
			yPortCoord = 37;		
			port = new top.SFPport(int_status[i][6], portImages); // pass the module type plugged-in the SFP slot
			port.index = i;
			port.x = xPortCoord;
			port.y = yPortCoord;
			port.id = "port_" + i;
			xPortCoord += (portWidth + xPortGap);
			dev.addPort(port);
		}
		portInd+=2;
		addLabel(dev,51,52);
	}
	if (interfaces.indexOf("0/49") == -1)
	{
		// Add the 1 10G X2 module
		xPortCoord = 597;
		yPortCoord = 13;		
		port = new top.tenGbSFPport(int_status[portInd][6], portImages); // pass the module type plugged-in the SFP slot
		port.index = portInd;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + portInd;
		dev.addPort(port);
		addLabel(dev,1);
		portInd+=1;
	}
	if (interfaces.indexOf("0/51") == -1)
	{
		// Add the 1 10G X2 module
		xPortCoord = 597;
		yPortCoord = 37;		
		port = new top.tenGbSFPport(int_status[portInd][6], portImages); // pass the module type plugged-in the SFP slot
		port.index = portInd;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + portInd;
		dev.addPort(port);
		addLabel(dev,2);
	}

	dev.modeAliases = new Array ("STATUS", "DUPLEX", "SPEED", "STACK");	
	return dev;
}

// Mirage models.

// NME-XD-48ES-2S-P, NME-X-23ES-1G-P
// NME-XD-24ES-1S-P, NME-16ES-1G-P
// NME-XD-48ES-2S, NME-X-23ES-1G
// NME-XD-24ES-1S, NME-16ES-1G

function NMEXD24ES2ST(int_status, media_type) {
//24 FastEthernet Ports
//2 Gig Ports (Gi1/0/2 is internal).
	
	var dev = new top.device();

	dev.noofports = 26; // 25 + 1 internal.
	dev.x=0;
	dev.y=0;
	dev.image = "images/nmexd24es2st.gif";

	drawLedsForMirage(dev, 634, 66, 7, 2);
	
	// Create the Mode Btn
	var modeBtn = new top.modebtn("images/nme_mode.gif");
	modeBtn.x = 616;
	modeBtn.y = 54;
	modeBtn.id = "mode_btn";
	modeBtn.device = dev;
	dev.modebtn = modeBtn;		

	// Create System LEDs
	var ledImages = top.ledImages();
	var tempLed = new top.led(ledImages);
	tempLed.x = 605;
	tempLed.y = 66;
	tempLed.id = "system_led";
	tempLed.device = dev;
	dev.sysleds["SYSTEM"] = tempLed;

	tempLed = new top.led(ledImages);
	tempLed.x = 594;
	tempLed.y = 66;
	tempLed.id = "master_led";
	tempLed.device = dev;
	dev.sysleds["MASTER"] = tempLed;
		
	tempLed = new top.led(ledImages);
	tempLed.x = 583;
	tempLed.y = 66;
	tempLed.id = "status_led";
	tempLed.device = dev;
	dev.sysleds["STATUS"] = tempLed;

	tempLed = new top.led(ledImages);
	tempLed.x = 572;
	tempLed.y = 66;
	tempLed.id = "duplex_led";
	tempLed.device = dev;
	dev.sysleds["DUPLEX"] = tempLed;

	tempLed = new top.led(ledImages);
	tempLed.x = 561;
	tempLed.y = 66;
	tempLed.id = "speed_led";
	tempLed.device = dev;
	dev.sysleds["SPEED"] = tempLed;
	
	tempLed = new top.led(ledImages);
	tempLed.x = 550;
	tempLed.y = 66;
	tempLed.id = "stack_led";
	tempLed.device = dev;
	dev.sysleds["STACK"] = tempLed;
	
	tempLed = new top.led(ledImages);
	tempLed.x = 539;
	tempLed.y = 66;
	tempLed.id = "power_led";
	tempLed.device = dev;
	dev.sysleds["POWER"] = tempLed;

	// Create the ports
	var port;
	var portWidth = 19;
	var portImages = top.rj45portImages();
	var portInvImages = top.rj45portInvImages();
	var xPortGap = 3;
	var xPortGroupGap = 17;
	var xPortStartPos = 292;
	var xPortCoord = xPortStartPos;
	var yPortCoord = 22;

	// Add the 24 FastEthernet ports in two groups of 12 each
	// from right to left
	for(var i=0; i<24; i++) {
		if(i%2 == 0) {
			yPortCoord = 22;
			port = new top.rj45portInv(portInvImages);
		} else {
			yPortCoord = 40;
			port = new top.rj45port(portImages);
		}
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 != 0) {
			xPortCoord -= (portWidth + xPortGap);	
		}
		if(i == 11) {
			xPortCoord -= (xPortGroupGap - xPortGap);
		}
		dev.addPort(port);
    }

	// Add the 1st GBIC port - Gi1/0/1, Gi1/0/2 is internal
	xPortCoord = 326;
	yPortCoord = 54;
	var i = 24;
	port = new top.SFPport(int_status[i][6], portImages); // pass the module type plugged-in the SFP slot
	port.index = i;
	port.x = xPortCoord;
	port.y = yPortCoord;
	port.id = "port_" + i;

	dev.addPort(port);
	dev.modeAliases = new Array ("STATUS", "DUPLEX", "SPEED", "STACK", "PoE");	
	return dev;
}


function NMEXD48ES2GE(int_status, media_type) {
//48 FastEthernet Ports.
//4 Gig Ports (Gi1/0/3 and Gi 1/0/4 are internal).
	
	var dev = new top.device();

	dev.noofports = 52; // 50 + 2 internal.
	dev.x=0;
	dev.y=0;
	dev.image = "images/nmexd48es2ge.gif";

	drawLedsForMirage(dev, 634, 71, 7, 2);
	
	// Create the ports
	var port;
	var portWidth = 19;
	var portImages = top.rj45portImages();
	var portInvImages = top.rj45portInvImages();
	var xPortGap = 3;
	var xPortGroupGap = 13;
	var xPortStartPos = 559;
	var xPortCoord = xPortStartPos;
	var yPortCoord = 22;

	// Add the 48 FastEthernet ports in three groups of 16 each from
	// right to left
	for(var i=0; i<48; i++) {       
		if(i%2 == 0) {
			yPortCoord = 22;
			port = new top.rj45portInv(portInvImages);
		} else {
			yPortCoord = 40;
			port = new top.rj45port(portImages);
		}
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 != 0) {
			xPortCoord -= (portWidth + xPortGap);	
		}
		if(i == 15 || i == 31) {
			xPortCoord -= (xPortGroupGap - xPortGap);
		}
		dev.addPort(port);
    }

	// Add the 2 GBIC ports - Gi1/0/1, Gi1/0/2
	// Gi1/0/3 and Gi1/0/4 are internal
	xPortCoord = 617;
	xPortGap = 8;
	yPortCoord = 49;
	portWidth = 21;
	for(i=48; i<50; i++) {
		port = new top.SFPport(int_status[i][6], portImages); // pass the module type plugged-in the SFP slot
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 == 0) {
			xPortCoord -= (portWidth + xPortGap);
		}
		dev.addPort(port);
	}
	
	dev.modeAliases = new Array ("STATUS", "DUPLEX", "SPEED", "STACK", "PoE");	
	return dev;
}

function NMEX24ES1GE(int_status, media_type) {
// 23 FastEthernet Ports (Starts with Fa1/0/2 and ends with Fa1/0/24).
// 2 Gig Ports (Gi1/0/2 is internal).
	var dev = new top.device();

	dev.noofports = 25; // 24 + 1 internal.
	dev.x=137;
	dev.y=0;
	dev.image = "images/nmex24es1ge.gif";

	drawLedsForMirage(dev, 353, 56, 4, 3);
	
	// Create the ports
	var port;
	var portWidth = 19;
	var portImages = top.rj45portImages();
	var portInvImages = top.rj45portInvImages();
	var xPortGap = 3;
	var xPortGroupGap = 17;
	var xPortStartPos = 308;
	var xPortCoord = xPortStartPos;
	var yPortCoord = 22;

	// Add the 23 FastEthernet ports in two groups of 11 and 12
	// from right to left. First port in the first group is Gi1/0/1
	for(var i=0; i<23; i++) {       
		if(i%2 != 0) {
			yPortCoord = 22;
			port = new top.rj45portInv(portInvImages);
		} else {
			yPortCoord = 40;
			port = new top.rj45port(portImages);
		}
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 == 0) {
			xPortCoord -= (portWidth + xPortGap);	
		}
		if(i == 10) {
			xPortCoord -= (xPortGroupGap - xPortGap);
		}
		dev.addPort(port);
    }

	// Add the 1st GBIC port - Gi1/0/1, Gi1/0/2 is internal
	xPortCoord = 308;
	yPortCoord = 22;
	var i = 23;
	port = new top.rj45port(portInvImages);
	port.index = i;
	port.x = xPortCoord;
	port.y = yPortCoord;
	port.id = "port_" + i;

	dev.addPort(port);
	dev.modeAliases = new Array ("STATUS", "DUPLEX", "SPEED", "STACK", "PoE");	
	return dev;
}

function NME16ES1GE(int_status, media_type) {
// 16 Fast Ethernet ports
// 2 Gig Ports (Gi1/0/2 is internal).
	var dev = new top.device();

	dev.noofports = 18;
	dev.x=147;
	dev.y=0;
	dev.image = "images/nme16es1ge.gif";
	
	drawLedsForMirage(dev, 36, 61, 4, 3);

	// Create the ports
	var port;
	var portWidth = 19;
	var portImages = top.rj45portImages();
	var portInvImages = top.rj45portInvImages();
	var xPortGap = 3;
	var xPortGroupGap = 0;
	var xPortStartPos = 246;
	var xPortCoord = xPortStartPos;
	var yPortCoord = 22;

	// Add the 16 FastEthernet ports from right to left
	for(var i=0; i<16; i++) {       
		if(i%2 == 0) {
			yPortCoord = 22;
			port = new top.rj45portInv(portInvImages);
		} else {
			yPortCoord = 40;
			port = new top.rj45port(portImages);
		}
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 != 0) {
			xPortCoord -= (portWidth + xPortGap);	
		}
		dev.addPort(port);
    }

	// Add the 1st GBIC port - Gi1/0/1, Gi1/0/2 is internal
	xPortCoord = 303;
	yPortCoord = 39;
	var i = 16;
	port = new top.rj45port(portInvImages);
	port.index = i;
	port.x = xPortCoord;
	port.y = yPortCoord;
	port.id = "port_" + i;
	dev.addPort(port);

	dev.modeAliases = new Array ("STATUS", "DUPLEX", "SPEED", "STACK", "PoE");	
	return dev;
}

function NMEXD24ES2ST_NO_PWR(int_status, media_type) {
//24 FastEthernet Ports
//2 Gig Ports (Gi1/0/2 is internal).
//No inline power version
	
	var dev = new top.device();

	dev.noofports = 26; // 25 + 1 internal.
	dev.x=0;
	dev.y=0;
	dev.image = "images/nmexd24es2st_no_pwr.gif";

	drawLedsForMirage(dev, 634, 66, 7, 2);
	
	// Create the Mode Btn
	var modeBtn = new top.modebtn("images/nme_mode.gif");
	modeBtn.x = 616;
	modeBtn.y = 54;
	modeBtn.id = "mode_btn";
	modeBtn.device = dev;
	dev.modebtn = modeBtn;		

	// Create System LEDs
	var ledImages = top.ledImages();
	var tempLed = new top.led(ledImages);
	tempLed.x = 605;
	tempLed.y = 66;
	tempLed.id = "system_led";
	tempLed.device = dev;
	dev.sysleds["SYSTEM"] = tempLed;

	tempLed = new top.led(ledImages);
	tempLed.x = 594;
	tempLed.y = 66;
	tempLed.id = "master_led";
	tempLed.device = dev;
	dev.sysleds["MASTER"] = tempLed;
		
	tempLed = new top.led(ledImages);
	tempLed.x = 583;
	tempLed.y = 66;
	tempLed.id = "status_led";
	tempLed.device = dev;
	dev.sysleds["STATUS"] = tempLed;

	tempLed = new top.led(ledImages);
	tempLed.x = 572;
	tempLed.y = 66;
	tempLed.id = "duplex_led";
	tempLed.device = dev;
	dev.sysleds["DUPLEX"] = tempLed;

	tempLed = new top.led(ledImages);
	tempLed.x = 561;
	tempLed.y = 66;
	tempLed.id = "speed_led";
	tempLed.device = dev;
	dev.sysleds["SPEED"] = tempLed;
	
	tempLed = new top.led(ledImages);
	tempLed.x = 550;
	tempLed.y = 66;
	tempLed.id = "stack_led";
	tempLed.device = dev;
	dev.sysleds["STACK"] = tempLed;
	
	// Create the ports
	var port;
	var portWidth = 19;
	var portImages = top.rj45portImages();
	var portInvImages = top.rj45portInvImages();
	var xPortGap = 3;
	var xPortGroupGap = 17;
	var xPortStartPos = 292;
	var xPortCoord = xPortStartPos;
	var yPortCoord = 22;

	// Add the 24 FastEthernet ports in two groups of 12 each
	// from right to left
	for(var i=0; i<24; i++) {
		if(i%2 == 0) {
			yPortCoord = 22;
			port = new top.rj45portInv(portInvImages);
		} else {
			yPortCoord = 40;
			port = new top.rj45port(portImages);
		}
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 != 0) {
			xPortCoord -= (portWidth + xPortGap);	
		}
		if(i == 11) {
			xPortCoord -= (xPortGroupGap - xPortGap);
		}
		dev.addPort(port);
    }

	// Add the 1st GBIC port - Gi1/0/1, Gi1/0/2 is internal
	xPortCoord = 326;
	yPortCoord = 54;
	var i = 24;
	port = new top.SFPport(int_status[i][6], portImages); // pass the module type plugged-in the SFP slot
	port.index = i;
	port.x = xPortCoord;
	port.y = yPortCoord;
	port.id = "port_" + i;

	dev.addPort(port);
	dev.modeAliases = new Array ("STATUS", "DUPLEX", "SPEED", "STACK");	
	return dev;
}


function NMEXD48ES2GE_NO_PWR(int_status, media_type) {
//48 FastEthernet Ports.
//4 Gig Ports (Gi1/0/3 and Gi 1/0/4 are internal).
//No inline power version
	
	var dev = new top.device();

	dev.noofports = 52; // 50 + 2 internal.
	dev.x=0;
	dev.y=0;
	dev.image = "images/nmexd48es2ge_no_pwr.gif";

	drawLedsForMirage(dev, 634, 71, 7, 2);
	
	// Create the ports
	var port;
	var portWidth = 19;
	var portImages = top.rj45portImages();
	var portInvImages = top.rj45portInvImages();
	var xPortGap = 3;
	var xPortGroupGap = 13;
	var xPortStartPos = 559;
	var xPortCoord = xPortStartPos;
	var yPortCoord = 22;

	// Add the 48 FastEthernet ports in three groups of 16 each from
	// right to left
	for(var i=0; i<48; i++) {       
		if(i%2 == 0) {
			yPortCoord = 22;
			port = new top.rj45portInv(portInvImages);
		} else {
			yPortCoord = 40;
			port = new top.rj45port(portImages);
		}
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 != 0) {
			xPortCoord -= (portWidth + xPortGap);	
		}
		if(i == 15 || i == 31) {
			xPortCoord -= (xPortGroupGap - xPortGap);
		}
		dev.addPort(port);
    }

	// Add the 2 GBIC ports - Gi1/0/1, Gi1/0/2
	// Gi1/0/3 and Gi1/0/4 are internal
	xPortCoord = 617;
	xPortGap = 8;
	yPortCoord = 49;
	portWidth = 21;
	for(i=48; i<50; i++) {
		port = new top.SFPport(int_status[i][6], portImages); // pass the module type plugged-in the SFP slot
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 == 0) {
			xPortCoord -= (portWidth + xPortGap);
		}
		dev.addPort(port);
	}
	
	dev.modeAliases = new Array ("STATUS", "DUPLEX", "SPEED", "STACK");	
	return dev;
}

function NMEX24ES1GE_NO_PWR(int_status, media_type) {
// 23 FastEthernet Ports (Starts with Fa1/0/2 and ends with Fa1/0/24).
// 2 Gig Ports (Gi1/0/2 is internal).
// No inline power version
	var dev = new top.device();

	dev.noofports = 25; // 24 + 1 internal.
	dev.x=137;
	dev.y=0;
	dev.image = "images/nmex24es1ge_no_pwr.gif";

	drawLedsForMirage(dev, 353, 56, 4, 3);
	
	// Create the ports
	var port;
	var portWidth = 19;
	var portImages = top.rj45portImages();
	var portInvImages = top.rj45portInvImages();
	var xPortGap = 3;
	var xPortGroupGap = 17;
	var xPortStartPos = 308;
	var xPortCoord = xPortStartPos;
	var yPortCoord = 22;

	// Add the 23 FastEthernet ports in two groups of 11 and 12
	// from right to left. First port in the first group is Gi1/0/1
	for(var i=0; i<23; i++) {       
		if(i%2 != 0) {
			yPortCoord = 22;
			port = new top.rj45portInv(portInvImages);
		} else {
			yPortCoord = 40;
			port = new top.rj45port(portImages);
		}
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 == 0) {
			xPortCoord -= (portWidth + xPortGap);	
		}
		if(i == 10) {
			xPortCoord -= (xPortGroupGap - xPortGap);
		}
		dev.addPort(port);
    }

	// Add the 1st GBIC port - Gi1/0/1, Gi1/0/2 is internal
	xPortCoord = 308;
	yPortCoord = 22;
	var i = 23;
	port = new top.rj45port(portInvImages);
	port.index = i;
	port.x = xPortCoord;
	port.y = yPortCoord;
	port.id = "port_" + i;

	dev.addPort(port);
	dev.modeAliases = new Array ("STATUS", "DUPLEX", "SPEED", "STACK");	
	return dev;
}

function NME16ES1GE_NO_PWR(int_status, media_type) {
// 16 Fast Ethernet ports
// 2 Gig Ports (Gi1/0/2 is internal).
//No inline power version

	var dev = new top.device();

	dev.noofports = 18;
	dev.x=147;
	dev.y=0;
	dev.image = "images/nme16es1ge_no_pwr.gif";
	
	drawLedsForMirage(dev, 36, 61, 4, 3);

	// Create the ports
	var port;
	var portWidth = 19;
	var portImages = top.rj45portImages();
	var portInvImages = top.rj45portInvImages();
	var xPortGap = 3;
	var xPortGroupGap = 0;
	var xPortStartPos = 246;
	var xPortCoord = xPortStartPos;
	var yPortCoord = 22;

	// Add the 16 FastEthernet ports from right to left
	for(var i=0; i<16; i++) {       
		if(i%2 == 0) {
			yPortCoord = 22;
			port = new top.rj45portInv(portInvImages);
		} else {
			yPortCoord = 40;
			port = new top.rj45port(portImages);
		}
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 != 0) {
			xPortCoord -= (portWidth + xPortGap);	
		}
		dev.addPort(port);
    }

	// Add the 1st GBIC port - Gi1/0/1, Gi1/0/2 is internal
	xPortCoord = 303;
	yPortCoord = 39;
	var i = 16;
	port = new top.rj45port(portInvImages);
	port.index = i;
	port.x = xPortCoord;
	port.y = yPortCoord;
	port.id = "port_" + i;
	dev.addPort(port);

	dev.modeAliases = new Array ("STATUS", "DUPLEX", "SPEED", "STACK");	
	return dev;
}

function drawLedsForMirage(dev, x, y, width, height) {
	var ledImages = top.ledImages();
	var tempLed = new top.led(ledImages);
	tempLed.x = x;
	tempLed.y = y;
	tempLed.width = width;
	tempLed.height = height;
	tempLed.id = "en_led";
	tempLed.device = dev;
	dev.sysleds["EN"] = tempLed;
}

//////////////////////// c3750 devices start ////////////////////////////////

// c3750 models.

// WS-C3750-24TS, WS-C3750-48TS, WS-C3750-24P, WS-C3750-48P,
// WS-C3750G-12S, WS-C3750G-24T, WS-C3750G-24TS
// WS-C3750G-16TD, WS-C3750G-48PS, WS-C3750G-48TS, WS-C3750G-24PS,
// WS-C3750G-24TS-1U, WS-C3750-24FS, WS-C3750G-12S-D

function WSC375024FS(int_status, media_type) {
	var dev = new top.device();

	dev.noofports = 26;
	dev.x=0;
	dev.y=0;
	dev.image = "images/c375024FX_2.gif";

	drawLeds(dev);

	// Create the ports
	var port;
	var portWidth = 19;
	var portImages = top.fxportImages();
	var xPortGap = 1;
	var xPortGroupGap = 14;
	var xPortStartPos = 71;
	var xPortCoord = xPortStartPos;
	var yPortCoord = 51;

	// Add the 24 FastEthernet ports in 3 groups of 8 each.
	for(i=0; i<24; i++) {       
		port = new top.fxport(portImages);
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i ==7 || i == 15 ) {
			xPortCoord += ( portWidth + xPortGroupGap);
		}
		else {
			xPortCoord += (portWidth + xPortGap);	
		}
		dev.addPort(port);
    }

	// Add the 2 GBIC ports.
	xPortCoord = 591;
	xPortGap = 11;
	yPortCoord = 50;
	portWidth = 21;
	for(i=24; i<26; i++) {       
		port = new top.SFPport(int_status[i][6], portImages); // pass the module type plugged-in the SFP slot
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		xPortCoord += (portWidth + xPortGap);
		dev.addPort(port);
	}	
	
	return dev;
}


function WSC375024TS(int_status, media_type) {
	var dev = new top.device();

	dev.noofports = 26;
	dev.x=0;
	dev.y=0;
	dev.image = "images/c375024_2.gif";

	drawLeds(dev);

	// Create the ports
	var port;
	var portWidth = 19;
	var portImages = top.rj45portImages();
	var portInvImages = top.rj45portInvImages();
	var xPortGap = 1;
	var xPortGroupGap = 30;
	var xPortStartPos = 110;
	var xPortCoord = xPortStartPos;
	var yPortCoord;

	// Add the 24 FastEthernet ports in 2 groups of 12 each.
	for(i=0; i<24; i++) {       
		if(i%2 == 0) {
			yPortCoord = 25;
			port = new top.rj45portInv(portInvImages);
		} else {
			yPortCoord = 41;
			port = new top.rj45port(portImages);
		}
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 != 0) {
			xPortCoord += (portWidth + xPortGap);
		}
		if(i==11 || i == 23) {
			xPortCoord += (xPortGroupGap - xPortGap);
		}
		dev.addPort(port);
    }

	// Add the 2 GBIC ports.
	xPortCoord = 469;
	xPortGap = 45;
	for(i=24; i<26; i++) {       
		yPortCoord = 39;		
		port = new top.SFPport(int_status[i][6], portImages); // pass the module type plugged-in the SFP slot
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		xPortCoord += (portWidth + xPortGap);
		dev.addPort(port);
	}	
	
	return dev;
}


function WSC375048TS(int_status, media_type) {
	var dev = new top.device();
	dev.noofports = 52;
	dev.x=0;
	dev.y=0;
	dev.image = "images/c375048_4.gif";	

    drawLeds(dev);	

	var port;
	var portWidth = 19;
	var portImages = top.rj45portImages();
	var portInvImages = top.rj45portInvImages();
	var xPortGap = 1;
	var xPortGroupGap = 11;
	var xPortStartPos = 72;
	var xPortCoord = xPortStartPos;
	var yPortCoord;

	// Add the 48 FastEthernet ports in 4 groups of 12 each.
	for(i=0; i<48; i++) {       
		if(i%2 == 0) {
			yPortCoord = 26;
			port = new top.rj45portInv(portInvImages);
		} else {
			yPortCoord = 42;
			port = new top.rj45port(portImages);
		}
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 != 0) {
			xPortCoord += (portWidth + xPortGap);
		}
		if(i==15 || i == 31) {
			xPortCoord += (xPortGroupGap - xPortGap);
		}
		dev.addPort(port);
    }

	// Add the 4 SFP ports.
	xPortCoord = 589;
	xPortGap = 12;
	yPortCoord = 25;
	portWidth = 21;
	for(i=48; i<52; i++) {
		port = new top.SFPport(int_status[i][6], portImages); // pass the module type plugged-in the SFP slot
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 == 0) {
			yPortCoord = 47;			
		} else {
			yPortCoord = 25;
			xPortCoord += (portWidth + xPortGap);
		}

		dev.addPort(port);
	}	

	return dev;
}


function WSC375024P(int_status, media_type) {
	var dev = new top.device();

	dev.noofports = 26;
	dev.x=0;
	dev.y=0;
	dev.image = "images/c375024_2p.gif";

	drawLedsForPowerSwitch(dev);
	
	// Create the ports
	var port;
	var portWidth = 19;
	var portImages = top.rj45portImages();
	var portInvImages = top.rj45portInvImages();
	var xPortGap = 1;
	var xPortGroupGap = 30;
	var xPortStartPos = 110;
	var xPortCoord = xPortStartPos;
	var yPortCoord;

	// Add the 24 FastEthernet ports in 2 groups of 12 each.
	for(i=0; i<24; i++) {       
		if(i%2 == 0) {
			yPortCoord = 25;
			port = new top.rj45portInv(portInvImages);
		} else {
			yPortCoord = 41;
			port = new top.rj45port(portImages);
		}
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 != 0) {
			xPortCoord += (portWidth + xPortGap);
		}
		if(i==11 || i == 23) {
			xPortCoord += (xPortGroupGap - xPortGap);
		}
		dev.addPort(port);
    }

	// Add the 2 GBIC ports.
	xPortCoord = 469;
	xPortGap = 45;
	for(i=24; i<26; i++) {       
		yPortCoord = 39;		
		port = new top.SFPport(int_status[i][6], portImages); // pass the module type plugged-in the SFP slot
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		xPortCoord += (portWidth + xPortGap);
		dev.addPort(port);
	}	

	dev.modeAliases = new Array ("STATUS", "DUPLEX", "SPEED", "STACK", "PoE");	
	return dev;
}


function WSC3750G12S(int_status, media_type) {
	var dev = new top.device();

	dev.noofports = 12;
	dev.x=0;
	dev.y=0;
	dev.image = "images/c3750g_12s.gif";

    drawLeds(dev);
	
	// Create the ports
	var port;
	var portWidth = 21;
	var xPortGap = 1;
	var xPortGroupGap = 14;
	var xPortStartPos = 319;
	var xPortCoord = xPortStartPos;
	var yPortCoord = 40;

	// Add the 12 GBIC ports in 3 groups of 4 each.
	for(i=0; i<12; i++) {    
		port = new top.SFPport(int_status[i][6]); // pass the module type plugged-in the SFP slot
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.index = i;
		port.id = "port_" + i;
		xPortCoord += (portWidth + xPortGap);
		if (i==3 || i==7) {
			xPortCoord += (xPortGroupGap - xPortGap);
		}

		dev.addPort(port);
	}	
	
	return dev;
}

function WSC375048P(int_status, media_type) {
	var dev = new top.device();

	dev.noofports = 52;
	dev.x=0;
	dev.y=0;
	dev.image = "images/c375048_4p.gif";

    drawLedsForPowerSwitch(dev);	
	
	// Create the ports
	var port;
	var portWidth = 19;
	var portImages = top.rj45portImages();
	var portInvImages = top.rj45portInvImages();
	var xPortGap = 1;
	var xPortGroupGap = 11;
	var xPortStartPos = 72;
	var xPortCoord = xPortStartPos;
	var yPortCoord;

	// Add the 48 FastEthernet ports in 4 groups of 12 each.
	for(i=0; i<48; i++) {       
		if(i%2 == 0) {
			yPortCoord = 26;
			port = new top.rj45portInv(portInvImages);
		} else {
			yPortCoord = 42;
			port = new top.rj45port(portImages);
		}
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 != 0) {
			xPortCoord += (portWidth + xPortGap);
		}
		if(i==15 || i == 31) {
			xPortCoord += (xPortGroupGap - xPortGap);
		}
		dev.addPort(port);
    }

	// Add the 4 SFP ports.
	xPortCoord = 587;
	xPortGap = 12;
	yPortCoord = 25;
	portWidth = 21;
	for(i=48; i<52; i++) {
		port = new top.SFPport(int_status[i][6], portImages); // pass the module type plugged-in the SFP slot
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 == 0) {
			yPortCoord = 46;			
		} else {
			yPortCoord = 25;
			xPortCoord += (portWidth + xPortGap);
		}

		dev.addPort(port);
	}	

	dev.modeAliases = new Array ("STATUS", "DUPLEX", "SPEED", "STACK", "PoE");	
	return dev;
}



function WSC3750G24T(int_status, media_type) {
	var dev = new top.device();

	dev.noofports = 24;
	dev.x=0;
	dev.y=0;
	dev.image = "images/c3750g_24_0.gif";

    drawLeds(dev);
	
	// Create the ports
	var port;
	var portWidth = 19;
	var portImages = top.rj45portImages();
	var portInvImages = top.rj45portInvImages();
	var xPortGap = 1;
	var xPortGroupGap = 84;
	var xPortStartPos = 159;
	var xPortCoord = xPortStartPos;
	var yPortCoord;

	// Add the 24 FastEthernet ports in 2 groups of 12 each.
	for(i=0; i<24; i++) {       
		if(i%2 == 0) {
			yPortCoord = 25;
			port = new top.rj45portInv(portInvImages);
		} else {
			yPortCoord = 41;
			port = new top.rj45port(portImages);
		}
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 != 0) {
			xPortCoord += (portWidth + xPortGap);
		}
		if(i==11 || i == 23) {
			xPortCoord += (xPortGroupGap - xPortGap);
		}
		dev.addPort(port);
    }

	return dev;
}



function WSC3750G24TS(int_status, media_type) {
	var dev = new top.device();

	dev.noofports = 28;
	dev.x=0;
	dev.y=0;
	dev.image = "images/c3750g_24_4.gif";

	// Create the Mode Btn
	var modeBtn = new top.modebtn("images/c375024_2_mode.gif");
	modeBtn.x = 33; 
	modeBtn.y = 83;
	modeBtn.id = "mode_btn";
	modeBtn.device = dev;
	dev.modebtn = modeBtn;		

	// Create System LEDs
	var ledImages = top.ledImages();
	var tempLed = new top.led(ledImages);
	tempLed.x = 11; 
	tempLed.y = 41; 
	tempLed.id = "system_led";
	tempLed.device = dev;
	dev.sysleds["SYSTEM"] = tempLed;

	tempLed = new top.led(ledImages);
	tempLed.x = 11; 
	tempLed.y = 47; 
	tempLed.id = "rps_led";
	tempLed.device = dev;
	dev.sysleds["RPS"] = tempLed;
	
	tempLed = new top.led(ledImages);
	tempLed.x = 11; 
	tempLed.y = 53; 
	tempLed.id = "master_led";
	tempLed.device = dev;
	dev.sysleds["MASTER"] = tempLed;
	
	tempLed = new top.led(ledImages);
	tempLed.x = 11; 
	tempLed.y = 59; 
	tempLed.id = "status_led";
	tempLed.device = dev;
	dev.sysleds["STATUS"] = tempLed;

	tempLed = new top.led(ledImages);
	tempLed.x = 11;
	tempLed.y = 65; 
	tempLed.id = "duplex_led";
	tempLed.device = dev;
	dev.sysleds["DUPLEX"] = tempLed;

	tempLed = new top.led(ledImages);
	tempLed.x = 11; 
	tempLed.y = 71; 
	tempLed.id = "speed_led";
	tempLed.device = dev;
	dev.sysleds["SPEED"] = tempLed;
	
	tempLed = new top.led(ledImages);
	tempLed.x = 11; 
	tempLed.y = 77;
	tempLed.id = "stack_led";
	tempLed.device = dev;
	dev.sysleds["STACK"] = tempLed;
	
	// Create the ports
	var port;
	var portWidth = 19;
	var portImages = top.rj45portImages();
	var portInvImages = top.rj45portInvImages();
	var xPortGap = 1;
	var xPortGroupGap = 55;
	var xPortStartPos = 128; 
	var xPortCoord = xPortStartPos;
	var yPortCoord;

	// Add the 24 FastEthernet ports in 2 groups of 12 each.
	for(i=0; i<24; i++) {       
		if(i%2 == 0) {
			yPortCoord = 40; 
			port = new top.rj45portInv(portInvImages);
		} else {
			yPortCoord = 56; 
			port = new top.rj45port(portImages);
		}
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 != 0) {
			xPortCoord += (portWidth + xPortGap);
		}
		if(i==11 || i == 23) {
			xPortCoord += (xPortGroupGap - xPortGap);
		}
		dev.addPort(port);
    }

	// Add the 4 GBIC ports.
	xPortCoord = 498;
	xPortGap = 1;
	portWidth = 21;
	for(i=24; i<28; i++) {       
		yPortCoord = 55; 		
		port = new top.SFPport(int_status[i][6], portImages); // pass the module type plugged-in the SFP slot
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		xPortCoord += (portWidth + xPortGap);
		dev.addPort(port);
	}	
	
	return dev;
}



function WSC3750G16TD(int_status, media_type) {
	var dev = new top.device();

	dev.noofports = 17;
	dev.x=0;
	dev.y=0;
	dev.image = "images/c3750g_16td.gif";

    drawLeds(dev);

	// Create the ports
	var port;
	var portWidth = 19;
	var portImages = top.rj45portImages();
	var portInvImages = top.rj45portInvImages();
	var xPortGap = 1;
	
	var xPortStartPos = 165;
	var xPortCoord = xPortStartPos;
	var yPortCoord;

	// Add the 24 FastEthernet ports in 2 groups of 12 each.
	for(i=0; i<16; i++) {       
		if(i%2 == 0) {
			yPortCoord = 25;
			port = new top.rj45portInv(portInvImages);
		} else {
			yPortCoord = 41;
			port = new top.rj45port(portImages);
		}
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 != 0) {
			xPortCoord += (portWidth + xPortGap);
		}
		dev.addPort(port);
    }

	// Add the 1 10 Gig port.
	xPortCoord = 569;
	i=16;	     
	yPortCoord = 49;
	port = new top.tenGigport(int_status[i][6], portImages); // pass the module type plugged-in the SFP slot
	port.index = i;   
	port.x = xPortCoord;
	port.y = yPortCoord;
	port.id = "port_" + i;
	dev.addPort(port);	
	
	return dev;
}



function WSC3750G24PS(int_status, media_type) {
	var dev = new top.device();

	dev.noofports = 28;
	dev.x=0;
	dev.y=0;
	dev.image = "images/c3750g24_4p.gif";

	drawLedsForPowerSwitch(dev);
	
	// Create the ports
	var port;
	var portWidth = 19;
	var portImages = top.rj45portImages();
	var portInvImages = top.rj45portInvImages();
	var xPortGap = 1;
	var xPortGroupGap = 33;
	var xPortStartPos = 288;
	var xPortCoord = xPortStartPos;
	var yPortCoord;

	// Add the 24 FastEthernet ports in 2 groups of 12 each.
	for(i=0; i<24; i++) {       
		if(i%2 == 0) { 
			yPortCoord = 28;
			port = new top.rj45portInv(portInvImages);
		} else {
			yPortCoord = 44;
			port = new top.rj45port(portImages);
		}
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 != 0) {
			xPortCoord += (portWidth + xPortGap);
		}
		if(i==11 || i == 23) {
			xPortCoord += (xPortGroupGap - xPortGap);
		}
		dev.addPort(port);
    }

	// Add the 4 SFP ports.
	xPortCoord = 584;
	xPortGap = 16;
	yPortCoord = 26;
	portWidth = 21;
	for(i=24; i<28; i++) {
		port = new top.SFPport(int_status[i][6], portImages); // pass the module type plugged-in the SFP slot
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 == 0) {
			yPortCoord = 48;			
		} else {
			yPortCoord = 26;
			xPortCoord += (portWidth + xPortGap);
		  }
                dev.addPort(port);
         }

	dev.modeAliases = new Array ("STATUS", "DUPLEX", "SPEED", "STACK", "PoE");	
	return dev;
}

function WSC3750G24TS1U(int_status, media_type) {
	var dev = new top.device();

	dev.noofports = 28;
	dev.x=0;
	dev.y=0;
	dev.image = "images/c3750g24_4.gif";

    drawLeds(dev);
	
	// Create the ports
	var port;
	var portWidth = 19;
	var portImages = top.rj45portImages();
	var portInvImages = top.rj45portInvImages();
	var xPortGap = 1;
	var xPortGroupGap = 33;
	var xPortStartPos = 288;
	var xPortCoord = xPortStartPos;
	var yPortCoord;

	// Add the 24 FastEthernet ports in 2 groups of 12 each.
	for(i=0; i<24; i++) {       
		if(i%2 == 0) {
			yPortCoord = 28;
			port = new top.rj45portInv(portInvImages);
		} else {
			yPortCoord = 44;
			port = new top.rj45port(portImages);
		}
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 != 0) {
			xPortCoord += (portWidth + xPortGap);
		}
		if(i==11 || i == 23) {
			xPortCoord += (xPortGroupGap - xPortGap);
		}
		dev.addPort(port);
    }

	// Add the 4 SFP ports.
	xPortCoord = 584;
	xPortGap = 16;
	yPortCoord = 26;
	portWidth = 21;
	for(i=24; i<28; i++) {
		port = new top.SFPport(int_status[i][6], portImages); // pass the module type plugged-in the SFP slot
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 == 0) {
			yPortCoord = 48;			
		} else {
			yPortCoord = 26;
			xPortCoord += (portWidth + xPortGap);
		  }
                dev.addPort(port);
         }

	dev.modeAliases = new Array ("STATUS", "DUPLEX", "SPEED", "STACK", "PoE");	
	return dev;

}

function WSC3750G48TS(int_status, media_type) {
	var dev = new top.device();
	dev.noofports = 52;
	dev.x=0;
	dev.y=0;
	dev.image = "images/c3750g48_4.gif";	

        drawLeds(dev);	

	var port;
	var portWidth = 19;
	var portImages = top.rj45portImages();
	var portInvImages = top.rj45portInvImages();
	var xPortGap = 1;
	var xPortGroupGap = 11;
	var xPortStartPos = 72;
	var xPortCoord = xPortStartPos;
	var yPortCoord;

	// Add the 48 FastEthernet ports in 4 groups of 12 each.
	for(i=0; i<48; i++) {       
		if(i%2 == 0) {
			yPortCoord = 27;
			port = new top.rj45portInv(portInvImages);
		} else {
			yPortCoord = 43;
			port = new top.rj45port(portImages);
		}
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 != 0) {
			xPortCoord += (portWidth + xPortGap);
		}
		if(i==15 || i == 31) {
			xPortCoord += (xPortGroupGap - xPortGap);
		}
		dev.addPort(port);
    }

	// Add the 4 SFP ports.
	xPortCoord = 587;
	xPortGap = 14;
	yPortCoord = 27;
	portWidth = 21;
	for(i=48; i<52; i++) {
		port = new top.SFPport(int_status[i][6], portImages); // pass the module type plugged-in the SFP slot
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 == 0) {
			yPortCoord = 49;			
		} else {
			yPortCoord = 27;
			xPortCoord += (portWidth + xPortGap);
		}

		dev.addPort(port);
	}	

	return dev;
}

function WSC3750G48P(int_status, media_type) {
	var dev = new top.device();

	dev.noofports = 52;
	dev.x=0;
	dev.y=0;
	dev.image = "images/c3750g48_4p.gif";

    drawLedsForPowerSwitch(dev);	
	
	// Create the ports
	var port;
	var portWidth = 19;
	var portImages = top.rj45portImages();
	var portInvImages = top.rj45portInvImages();
	var xPortGap = 1;
	var xPortGroupGap = 11;
	var xPortStartPos = 72;
	var xPortCoord = xPortStartPos;
	var yPortCoord;

	// Add the 48 FastEthernet ports in 4 groups of 12 each.
	for(i=0; i<48; i++) {       
		if(i%2 == 0) {
			yPortCoord = 28;
			port = new top.rj45portInv(portInvImages);
		} else {
			yPortCoord = 44;
			port = new top.rj45port(portImages);
		}
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 != 0) {
			xPortCoord += (portWidth + xPortGap);
		}
		if(i==15 || i == 31) {
			xPortCoord += (xPortGroupGap - xPortGap);
		}
		dev.addPort(port);
    }

	// Add the 4 SFP ports.
	xPortCoord = 585;
	xPortGap = 15;
	yPortCoord = 27;
	portWidth = 21;
	for(i=48; i<52; i++) {
		port = new top.SFPport(int_status[i][6], portImages); // pass the module type plugged-in the SFP slot
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 == 0) {
			yPortCoord = 49;			
		} else {
			yPortCoord = 27;
			xPortCoord += (portWidth + xPortGap);
		}

		dev.addPort(port);
	}	

	dev.modeAliases = new Array ("STATUS", "DUPLEX", "SPEED", "STACK", "PoE");	
	return dev;
}

function WSC3750G24_2_2(int_status, media_type) 
{
	var dev = new top.device();

	dev.noofports = 28;
	dev.x=0;
	dev.y=0;
	dev.image = "images/c3750g24_2_2.gif";
	dev.scrollYCord = 45;
	drawLedsForWSC3750G24_2_2(dev);
	
	// Create the ports
	var port;
	var portWidth = 19;
	var portImages = top.rj45portImages();
	var portInvImages = top.rj45portInvImages();
	var xPortGap = 1;
	var xPortGroupGap = 33;
	var xPortStartPos = 234;
	var xPortCoord = xPortStartPos;
	var yPortCoord;

	// Add the 24 FastEthernet ports in 2 groups of 12 each.
	for(i=0; i<24; i++) 
	{       
		if(i%2 == 0) {
			yPortCoord = 48;
			port = new top.rj45portInv(portInvImages);
		} else {
			yPortCoord = 64;
			port = new top.rj45port(portImages);
		}
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		if(i%2 != 0) {
			xPortCoord += (portWidth + xPortGap);
		}
		if(i==11 || i == 23) {
			xPortCoord += (xPortGroupGap - xPortGap);
		}
		dev.addPort(port);
    	}
	// Add the 2 SFP ports.
	xPortCoord = 557;
	xPortGap = 2;
	yPortCoord = 71;
	portWidth = 21;
	for(i=24; i<26; i++) 
	{
		port = new top.SFPport(int_status[i][6], portImages); // pass the module type plugged-in the SFP slot
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
                dev.addPort(port);
		xPortCoord += (portWidth + xPortGap);
         }

	// Add the 2 internal ports.
	xPortCoord = 560;
	xPortGap = 2;
	yPortCoord = 45;
	portWidth = 18;
	portImages = top.internalportImages();
	for(i=26; i<28; i++) 
	{  


                port = new top.internalport(portImages);     
                port.width = 18;
                port.height = 12;
		port.index = i;
		port.x = xPortCoord;
		port.y = yPortCoord;
		port.id = "port_" + i;
		dev.addPort(port);
		xPortCoord += (portWidth + xPortGap);
	}

	dev.modeAliases = new Array ("STATUS", "DUPLEX", "SPEED", "STACK", "PoE");	
	return dev;

}

function drawLeds(dev) {

	// Create the Mode Btn
	var modeBtn = new top.modebtn("images/c375024_2_mode.gif");
	modeBtn.x = 35;
	modeBtn.y = 66;
	modeBtn.height = 10;
	modeBtn.width = 19;
	modeBtn.id = "mode_btn";
	modeBtn.device = dev;
	dev.modebtn = modeBtn;		

	// Create System LEDs
	var ledImages = top.ledImages();
	var tempLed = new top.led(ledImages);
	tempLed.x = 13;
	tempLed.y = 24;
	tempLed.id = "system_led";
	tempLed.device = dev;
	dev.sysleds["SYSTEM"] = tempLed;

	tempLed = new top.led(ledImages);
	tempLed.x = 13;
	tempLed.y = 30;
	tempLed.id = "rps_led";
	tempLed.device = dev;
	dev.sysleds["RPS"] = tempLed;
	
	tempLed = new top.led(ledImages);
	tempLed.x = 13;
	tempLed.y = 36;
	tempLed.id = "master_led";
	tempLed.device = dev;
	dev.sysleds["MASTER"] = tempLed;
	
	tempLed = new top.led(ledImages);
	tempLed.x = 13;
	tempLed.y = 42;
	tempLed.id = "status_led";
	tempLed.device = dev;
	dev.sysleds["STATUS"] = tempLed;

	tempLed = new top.led(ledImages);
	tempLed.x = 13;
	tempLed.y = 48;
	tempLed.id = "duplex_led";
	tempLed.device = dev;
	dev.sysleds["DUPLEX"] = tempLed;

	tempLed = new top.led(ledImages);
	tempLed.x = 13;
	tempLed.y = 54;
	tempLed.id = "speed_led";
	tempLed.device = dev;
	dev.sysleds["SPEED"] = tempLed;
	
	tempLed = new top.led(ledImages);
	tempLed.x = 13;
	tempLed.y = 60;
	tempLed.id = "stack_led";
	tempLed.device = dev;
	dev.sysleds["STACK"] = tempLed;
}


function drawLedsForPowerSwitch(dev) {

	// Create the Mode Btn
	var modeBtn = new top.modebtn("images/c375024_2_mode.gif");
	modeBtn.x = 35;
	modeBtn.y = 67;
	modeBtn.id = "mode_btn";
	modeBtn.device = dev;
	dev.modebtn = modeBtn;		

	// Create System LEDs
	var ledImages = top.ledImages();
	var tempLed = new top.led(ledImages);
	tempLed.x = 13;
	tempLed.y = 22;
	tempLed.id = "system_led";
	tempLed.device = dev;
	dev.sysleds["SYSTEM"] = tempLed;

	tempLed = new top.led(ledImages);
	tempLed.x = 13;
	tempLed.y = 28;
	tempLed.id = "rps_led";
	tempLed.device = dev;
	dev.sysleds["RPS"] = tempLed;
	
	tempLed = new top.led(ledImages);
	tempLed.x = 13;
	tempLed.y = 34;
	tempLed.id = "master_led";
	tempLed.device = dev;
	dev.sysleds["MASTER"] = tempLed;
		
	tempLed = new top.led(ledImages);
	tempLed.x = 13;
	tempLed.y = 40;
	tempLed.id = "status_led";
	tempLed.device = dev;
	dev.sysleds["STATUS"] = tempLed;

	tempLed = new top.led(ledImages);
	tempLed.x = 13;
	tempLed.y = 46;
	tempLed.id = "duplex_led";
	tempLed.device = dev;
	dev.sysleds["DUPLEX"] = tempLed;

	tempLed = new top.led(ledImages);
	tempLed.x = 13;
	tempLed.y = 52;
	tempLed.id = "speed_led";
	tempLed.device = dev;
	dev.sysleds["SPEED"] = tempLed;
	
	tempLed = new top.led(ledImages);
	tempLed.x = 13;
	tempLed.y = 58;
	tempLed.id = "stack_led";
	tempLed.device = dev;
	dev.sysleds["STACK"] = tempLed;
	
	tempLed = new top.led(ledImages);
	tempLed.x = 13;
	tempLed.y = 64;
	tempLed.id = "power_led";
	tempLed.device = dev;
	dev.sysleds["POWER"] = tempLed;
}


function drawLedsForWSC3750G24_2_2(dev) {

	// Create the Mode Btn
	var modeBtn = new top.modebtn("images/c375024_2_mode.gif");
	modeBtn.x = 35;
	modeBtn.y = 87;
	modeBtn.id = "mode_btn";
	modeBtn.device = dev;
	dev.modebtn = modeBtn;		

	// Create System LEDs
	var ledImages = top.ledImages();
	var tempLed = new top.led(ledImages);
	tempLed.x = 13;
	tempLed.y = 43;
	tempLed.id = "system_led";
	tempLed.device = dev;
	dev.sysleds["SYSTEM"] = tempLed;

	tempLed = new top.led(ledImages);
	tempLed.x = 13;
	tempLed.y = 49;
	tempLed.id = "rps_led";
	tempLed.device = dev;
	dev.sysleds["RPS"] = tempLed;
	
	tempLed = new top.led(ledImages);
	tempLed.x = 13;
	tempLed.y = 55;
	tempLed.id = "master_led";
	tempLed.device = dev;
	dev.sysleds["MASTER"] = tempLed;
		
	tempLed = new top.led(ledImages);
	tempLed.x = 13;
	tempLed.y = 61;
	tempLed.id = "status_led";
	tempLed.device = dev;
	dev.sysleds["STATUS"] = tempLed;

	tempLed = new top.led(ledImages);
	tempLed.x = 13;
	tempLed.y = 67;
	tempLed.id = "duplex_led";
	tempLed.device = dev;
	dev.sysleds["DUPLEX"] = tempLed;

	tempLed = new top.led(ledImages);
	tempLed.x = 13;
	tempLed.y = 73;
	tempLed.id = "speed_led";
	tempLed.device = dev;
	dev.sysleds["SPEED"] = tempLed;
	
	tempLed = new top.led(ledImages);
	tempLed.x = 13;
	tempLed.y = 79;
	tempLed.id = "stack_led";
	tempLed.device = dev;
	dev.sysleds["STACK"] = tempLed;
	
	tempLed = new top.led(ledImages);
	tempLed.x = 13;
	tempLed.y = 85;
	tempLed.id = "power_led";
	tempLed.device = dev;
	dev.sysleds["POWER"] = tempLed;
}

function drawACOK_DCOKLEDs(dev)
{
	// Create AC OK LEDs
	var ledImages = top.ledImages();
	var tempLed = new top.led(ledImages);
	tempLed.x = 68;
	tempLed.y = 67;
	tempLed.id = "ac_ok";
	tempLed.device = dev;
	tempLed.showPopup = true;
	dev.sysleds["ACOK"] = tempLed;

	// Create DC OK LEDs
	tempLed = new top.led(ledImages);
	tempLed.x = 103;
	tempLed.y = 67;
	tempLed.id = "dc_ok";
	tempLed.device = dev;
	tempLed.showPopup = true;
	dev.sysleds["DCOK"] = tempLed;

	// Create Fa0 LED
	tempLed = new top.led(ledImages);
	tempLed.x = 138;
	tempLed.y = 67;
	tempLed.id = "fa_0";
	tempLed.device = dev;
	tempLed.showPopup = true;
	dev.sysleds["FA0"] = tempLed;
}

function addLabel( dev, label1, label2 )
{
	var image1 = "images/port_label_"+label1+".gif";
	var image2= "";
	if (label2 != null ) image2= "images/port_label_"+label2+".gif";
	switch (label1)
	{
		case 1:
			// Adding the ten gb port label1
			var portlbtl = new top.portLabel(615, 6, 7, 5, image1);
			portlbtl.id = "portlbtl1";
			dev.addPortLabel(portlbtl);
			break;
		case 2:
			// Adding the ten gb port label2
			var portlbtl = new top.portLabel(615, 55, 7, 5, image1);
	        	portlbtl.id = "portlbtl1";
			dev.addPortLabel(portlbtl);
			break;
		case 25:
		case 49:
			// Adding the top port label1
		        var portlbl = new top.portLabel(604, 6, 7, 5, image1);
	        	portlbl.id = "portlbl1";
		        dev.addPortLabel(portlbl);

		        // Adding the top port label2
		        var portlbl2 = new top.portLabel(625, 6, 7, 5, image2);
	        	portlbl2.id = "portlbl2";
		        dev.addPortLabel(portlbl2);
			break;
		case 27:
		case 51:
		        // Adding the bottom port label1
		        var portlbl3 = new top.portLabel(604, 55, 7, 5, image1);
		        portlbl3.id = "portlbl3";
		        dev.addPortLabel(portlbl3);

		        // Adding the bottom port label2
		        var portlbl4 = new top.portLabel(625, 55, 7, 5, image2);
		        portlbl4.id = "portlbl4";
		        dev.addPortLabel(portlbl4);
	}
}

/////////////////////////c3750 devices end //////////////////////////////////

function createDevice(int_status, media_type, deviceType) {
	var device = null;
	if(deviceType == null)
		return device;	
	if(deviceType == "NME-XD-48ES-2S-P") {
		device = new NMEXD48ES2GE(int_status, media_type);
		device.family = "EtherSwitch Service Module";
	} else if(deviceType == "NME-X-23ES-1G-P") {
		device = new NMEX24ES1GE(int_status, media_type);
		device.family = "EtherSwitch Service Module";
	} else if(deviceType == "NME-XD-24ES-1S-P") {
		device = new NMEXD24ES2ST(int_status, media_type);
		device.family = "EtherSwitch Service Module";
	} else if(deviceType == "NME-16ES-1G-P") {
		device = new NME16ES1GE(int_status, media_type);
		device.family = "EtherSwitch Service Module";
	} else if(deviceType == "NME-XD-48ES-2S") {
		device = new NMEXD48ES2GE_NO_PWR(int_status, media_type);
		device.family = "EtherSwitch Service Module";
	} else if(deviceType == "NME-XD-24ES-1S") {
		device = new NMEXD24ES2ST_NO_PWR(int_status, media_type);
		device.family = "EtherSwitch Service Module";
	} else if(deviceType == "NME-X-23ES-1G") {
		device = new NMEX24ES1GE_NO_PWR(int_status, media_type);
		device.family = "EtherSwitch Service Module";
	} else if(deviceType == "NME-16ES-1G") {
		device = new NME16ES1GE_NO_PWR(int_status, media_type);
		device.family = "EtherSwitch Service Module";
	} else if(deviceType == "WS-C3750-24FS") {
                device = new WSC375024FS(int_status, media_type);
				device.family = "3750";
        } else if(deviceType == "WS-C3750-24P") {
                device = new WSC375024P(int_status, media_type);
				device.family = "3750";
        } else if(deviceType == "WS-C3750G-12S" || deviceType == "WS-C3750G-12S-D") {
                device = new WSC3750G12S(int_status, media_type);
				device.family = "3750";
        } else if(deviceType == "WS-C3750-48P") {
                device = new WSC375048P(int_status, media_type);
				device.family = "3750";
        } else if(deviceType == "WS-C3750G-24T") {
                device = new WSC3750G24T(int_status, media_type);
				device.family = "3750";
        } else if(deviceType == "WS-C3750G-24TS") {
                device = new WSC3750G24TS(int_status, media_type);
				device.family = "3750";
        } else if(deviceType == "WS-C3750G-16TD") {
                device = new WSC3750G16TD(int_status, media_type);
				device.family = "3750";
        } else if(deviceType.indexOf ("WS-C3750-48") != -1) {
                device = new WSC375048TS(int_status, media_type);
				device.family = "3750";
        } else if(deviceType.indexOf ("WS-C3750-24") != -1) {
                device = new WSC375024TS(int_status, media_type);
				device.family = "3750";
        } else if(deviceType == "WS-C3750G-24PS") {
                device = new WSC3750G24PS(int_status, media_type);
				device.family = "3750";
        } else if(deviceType == "WS-C3750G-24TS-1U") {
                device = new WSC3750G24TS1U(int_status, media_type);
				device.family = "3750";
        } else if(deviceType == "WS-C3750G-48PS") {
                device = new WSC3750G48P(int_status, media_type);
				device.family = "3750";
        } else if(deviceType == "WS-C3750G-48TS") {
                device = new WSC3750G48TS(int_status, media_type);
				device.family = "3750";
        } else if(deviceType == "WS-C3750G-24PS-W24" || 
                  deviceType == "WS-C3750G-24PS-W12" || 
                  deviceType == "WS-C3750G-24WS-S24" || 
                  deviceType == "WS-C3750G-24WS-S12" ||
                  deviceType == "WS-C3750G-24WS-S25" ||
                  deviceType == "WS-C3750G-24WS-S50") {
                device = new WSC3750G24_2_2(int_status, media_type);
				device.family = "3750";
        } else if(deviceType == "WS-C3750E-24PD") {
		device = new BULLSEYE24P(int_status, media_type);
		device.family = "3750-E";
	} else if(deviceType == "WS-C3750E-24TD") {
		device = new BULLSEYE24(int_status, media_type);
                device.family = "3750-E";
	} else if(deviceType == "WS-C3750E-48PD") {
		device = new BULLSEYE48P(int_status, media_type);
                device.family = "3750-E";
	} else if(deviceType == "WS-C3750E-48TD") {
		device = new BULLSEYE48(int_status, media_type);
                device.family = "3750-E";
	}

	if(device != null) {
		device.type = deviceType;
	}

	return device;
}
