var partners_info = { name : 0, logo : 1, website : 2, description : 3 };
var total_partners = 0;
var partners = new Array();
partners[total_partners++] = new Array("3Com",      "logo_3com.gif",      "http://www.3com.com/",               "3Com is a product leader in the computer network industry market.  Robert Metcalfe is one of the co-founders of the most widely used network technology in the world. They focus themselves on computers, communication, and compatibility. 3Com provides wired and wireless network components to complex security appliances and advanced IP telephony products.");
partners[total_partners++] = new Array("AIPHONE",   "logo_aiphone.gif",   "http://www.aiphone.com/",            "Aiphone products range from simple do-it-yourself door answering units to sophisticated video entry security systems, complex microprocessor-based commercial systems, and luxury condo/apartment security and communication systems. Their products are unrivaled in design simplicity, technical excellence and reliability.  With over 25 standard systems, and additional manufacturing by special order, they can create a system for virtually any intercom application.");
//partners[total_partners++] = new Array("AVG",       "logo_avg.gif",       "http://www.avg.com/",                "");
partners[total_partners++] = new Array("Avtech",    "logo_avtech.gif",    "http://www.avtech.com/",             "AVTECH is one of the best companies that provide products to remotely monitor and alert of any changes to a room's environment.  From simple room temperature monitoring to smoke, water, and ups monitoring.  Configuration is through a simple web interface for their products that allows for setting up simple to complex alert systems.  Users can be alerted by email, SNMP, email to SMS and more to be sent to a monitor's cell phone.  AVTECH products are ideal for server room monitoring or even simply monitor temperature of a remote location with internet access.");
partners[total_partners++] = new Array("Brivo",     "logo_brivo.gif",     "http://www.brivo.com/",              "Brivo enables businesses to control physical access to offices, warehouses, remote/unmanned buildings, or sensitive areas such as computer rooms, where real-time control and accountability of entry are important. The company's Web-hosted solutions are based on proprietary technology that connects dispersed facilities to the Internet using secure, wide-area communications.");
//partners[total_partners++] = new Array("CA",        "logo_ca.gif",        "http://www.ca.com/",                 "");
partners[total_partners++] = new Array("Carbonite", "logo_carbonite.gif", "http://www.carbonite.com/",          "Computer users should not have to think about backup or choosing which files are important enough to be saved which is why Carbonite Online Backup was designed to automatically seek out new and changed files on a computer and save the data on remote servers. Once the one-time, easy software installation is complete, Carbonite Online Backup works quietly in the background and does not interrupt normal computer use.");
//partners[total_partners++] = new Array("Dell",      "logo_dell.gif",      "http://www.dell.com/",               "");
partners[total_partners++] = new Array("DSC",       "logo_dsc.gif",       "http://www.dsc.com/",                "DSC (Digital Security Controls) is a world leader in electronic security. Since the company's genesis, the experts at DSC have been leading the way. From their revolutionary control panels, to their industry-leading IP alarm monitoring products and now to their sleek, contemporary self-contained wireless panels, DSC has always been front and center in the security space.");
partners[total_partners++] = new Array("Engenius",  "logo_engenius.gif",  "http://www.engeniustech.com/",       "EnGenius products are designed for the SME market providing long - range wireless communications solutions in demanding business environments in our ISO 9001 manufacturing facilities.");
partners[total_partners++] = new Array("Ganz",      "logo_ganz.gif",      "http://computarganz.com/",           "Computar lenses have long been recognized as the leader in surveillance lenses; the Ganz brand has assumed a parallel position in the manufacture of cameras, recorders and a wide range of peripherals providing end-to-end surveillance solutions.");
partners[total_partners++] = new Array("GE",        "logo_ge.gif",        "http://www.gesecurity.com/",         "GE Security is a wholly owned subsidiary of the General Electric Company focused on communication and information technologies for security, safety and lifestyle enhancements. GE Security has operations in more than 30 countries and is represented by some of the best-known brand names for intrusion and fire detection, access and building control, video surveillance, explosive and drug detection, key management, and structured wiring.");
partners[total_partners++] = new Array("Honeywell", "logo_honeywell.gif", "http://www.security.honeywell.com/", "Honeywell Access Systems provide access control products for applications ranging from small multi-door systems to enterprise-wide, networked systems containing thousands of entry points. Honeywell Security &amp; Communications includes ADEMCO security and fire controls, IntelliSense sensors and AlarmNet communications products. Honeywell Video Systems provides digital video and CCTV systems and components, including equipment for specialized applications, and financial and retail transaction verification systems.");
partners[total_partners++] = new Array("HP",        "logo_hp.gif",        "http://www.hp.com/",                 "HP is a leading company in the computer industry market.  Providing business desktop computers, business workstations, business laptops, business servers, advanced network equipment and so much more. HP product and service history is built on cost-effectiveness and reliability.  HP products are ideal for small to enterprise businesses and even home users who desire quality products.");
partners[total_partners++] = new Array("Linear",    "logo_linear.gif",    "http://www.linearcorp.com/",         "Linear LLC is a pioneer in engineered radio frequency (RF) products and is a major supplier of wireless residential security systems, access control, intercoms, garage door operators, gate operators, short and long-range radio remote controls, and medical/emergency reporting systems. In recent years the company, through acquisition, has expanded into a wide range of consumer electronics, including whole house audio/video distribution systems, central vacuum systems, music/communications systems, speaker systems and structured wiring systems. ");
//partners[total_partners++] = new Array("Linksys",   "logo_linksys.gif",   "http://www.linksysbycisco.com/",     "");
//partners[total_partners++] = new Array("Microsoft", "logo_microsoft.gif", "http://www.microsoft.com/",          "");
partners[total_partners++] = new Array("Pelco",     "logo_pelco.gif",     "http://www.pelco.com/",              "Pelco is a world leader in the design, development and manufacture of video and security systems and equipment ideal for any industry. With a long and prestigious history of offering high-quality products and exceptional customer service, Pelco has become the most sought-after product supplier in the security industry.");
partners[total_partners++] = new Array("Speco",     "logo_speco.gif",     "http://www.specotech.com/",          "For over fifty years Speco Technologies has dedicated themselves to providing the latest innovations in closed circuit video surveillance and electronic accessories, as well as the highest quality audio products for residential and commercial use. They have committed themselves to providing affordable, dependable merchandise, delivering exceptional customer service, and offering extensive product training, technical and marketing support.");
//partners[total_partners++] = new Array("Startech",  "logo_startech.gif",  "http://www.startech.com/",           "");
//partners[total_partners++] = new Array("Symantec",  "logo_symantec.gif",  "http://www.symantec.com/",           "");

function displayPartnersMenuList()
{
	var menu = '<h4><a href="partners.html" style="color: #000000;">AdCom Partners</a></h4><ul>';
	for (var i = 0; i < total_partners; ++i)
		menu += '<li><a href="partners.html?partner=' + i + '"/>' + partners[i][partners_info.name] + '</a></li>';
	menu += "</ul>";
	
	document.getElementById('menu_partners').innerHTML = menu;
}

function displayPartnersNavList()
{
	var nav = '<ul>';
	for (var i = 0; i < total_partners; ++i)
		nav += '<li><a href="partners.html?partner=' + i + '"/>' + partners[i][partners_info.name] + '</a></li>';
	nav += '</ul><div class="btm-bg"></div>';
	
	document.getElementById('nav_partners').innerHTML = nav;
}

function displayPartnersInfo(i)
{
	var content = "";
	
	if (i >= 0 && i < total_partners)
	{
		content += '<h1>' + partners[i][partners_info.name] + '</h1>';
		content += '<p><img src="images/' + partners[i][partners_info.logo] + '" align="right" alt="" border="0" style="padding: 0px 0px 0px 10px;">' + partners[i][partners_info.description] + '</p>';
		content += '<p>Vist them at <a href="' + partners[i][partners_info.website] + '">' + partners[i][partners_info.website] + '</a></p>';
	}
	else
	{
		content += '<h1>Our Partners</h1>';
		content += '<p>AdCom Technologies works with industry leaders to provide the best solutions possible.</p>';
	}
	
	document.getElementById('content_partners').innerHTML = content;
}

function displayPartners()
{
	if (isPartnersPage())
	{
		displayPartnersMenuList();
		displayPartnersInfo(getPartnerId(-1));
	}
	
	if (isHomePage())
		displayPartnersMenuList();
		
	displayPartnersNavList();
}

function getPartnerId(failsafe)
{
	return parseInt(getUrlParameter('partner', failsafe), 10);
}

function isHomePage()
{
	if (location.href.toLowerCase().match('index.html'))
		return 1;
	return 0;
}

function isPartnersPage()
{
	if (location.href.toLowerCase().match('partners.html'))
		return 1;
	return 0;
}

function getUrlParameter(name, failsafe)
{
	name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
	
	var regexS = "[\\?&]" + name + "=([^&#]*)";
	var regex = new RegExp(regexS);
	var results = regex.exec(window.location.href);
	
	if (results == null)
		return "" + failsafe;
	else
		return results[1];
}

displayPartners();

