function window_opener(url,window_name) {
	var window_width_minimum = 800;
	var window_height_minimum = 600;
	var window_width = screen.availWidth;
	var window_height = screen.availHeight;
	if ((window_width  < window_width_minimum) || (window_height < window_height_minimum)) {
		alert('The width and height available on your screen (' +  window_width + 'x' + window_height + ') should be at least (' + window_width_minimum + 'x' + window_height_minimum + ') for this application.');
	}
	var window_width = window_width>1024?1024:window_width;
	var window_height = window_height>700?700:window_height;
	var window_left = (screen.availWidth - window_width) / 2;
	var window_top = (screen.availHeight - window_height) / 2;
	new_window=window.open(url, window_name,'width=' + window_width + ',height=' + window_height + ',left=' + window_left + ',top=' + window_top + ',resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=yes,menubar=no,copyhistory=no');
	new_window.resizeTo(window_width, window_height);
	new_window.moveTo(window_left, window_top);
	if(window.focus) {
		new_window.focus();
	}
	return false;
}

// window_opener('/ndconfig/cgi-bin/ndconfig.cgi','ndconfig');",'','','side/icons/manage_configuration.gif'

var loc = '/img/project_icons/';
var open_projects = new Array();
            open_projects["linux_foundation.jpg"]="http://www.linux-foundation.org/en/Main_Page";
            open_projects["itil.jpg"]="http://www.itil-officialsite.com/home/home.asp";
            open_projects["MySQL.jpg"]="http://www.mysql.com/";
            open_projects["NeDi.jpg"]="http://www.nedi.ch/doku.php";
            open_projects["RRDtool.jpg"]="http://oss.oetiker.ch/rrdtool/";
            open_projects["network_weathermap.jpg"]="http://www.network-weathermap.com/";
            open_projects["snmp_trap_translator.jpg"]="http://www.snmptt.org/";
            open_projects["syslog-ng.jpg"]="http://www.balabit.com/network-security/syslog-ng/";
            open_projects["net-snmp.jpg"]="http://net-snmp.sourceforge.net/";
            open_projects["apache.jpg"]="http://www.apache.org/";
            open_projects["apple.jpg"]="http://www.apple.com";
            open_projects["cpan.jpg"]="http://www.cpan.org/";
            open_projects["freebsd.jpg"]="http://www.freebsd.org/";
            open_projects["gdlibrary.jpg"]="http://www.boutell.com/gd/";
//          open_projects["linux.jpg"]="http://www.linux.org/";
            open_projects["mrtg.jpg"]="http://oss.oetiker.ch/mrtg/";
            open_projects["nagios.jpg"]="http://www.nagios.org/";
//          open_projects["novell.jpg"]="http://www.novell.com/";
            open_projects["openbsd.jpg"]="http://www.openbsd.org/";
            open_projects["oracle.jpg"]="http://www.oracle.com/database/berkeley-db/index.html";
            open_projects["perl.jpg"]="http://www.perl.com/";
            open_projects["php.jpg"]="http://www.php.net/";
            open_projects["postgreSQL.jpg"]="http://www.postgresql.org/";
            open_projects["python.jpg"]="http://www.python.org/";
//          open_projects["slackware.jpg"]="http://www.slackware.com/";
            open_projects["smoke_ping.jpg"]="http://oss.oetiker.ch/smokeping/";
            open_projects["sun.jpg"]="http://www.sun.com";
            open_projects["suse.jpg"]="http://www.novell.com/";
            open_projects["trac.jpg"]="http://www.edgewall.org/blog/projects/trac/newlogo.html";
            open_projects["ubuntu.jpg"]="http://www.ubuntu.com/";



function make_vendor_icon_links(container_id,max_count) {
        //
        // coded by robert smith <spamfree _at_ wansecurity _dot_ com>
        // for wans
        //

        var temp = new Array(); // needed for nested reference_array() function
        MVILreference_array(open_projects);
        temp.sort( MVILRandomize );
        var build_url;
	var counter = 0;
        my_div = document.getElementById(container_id);
	my_div.innerHTML = "";
        for (keyVar in temp) {
		counter++;
        //        if(typeof build_url == "undefined")
        //                build_url = '<a alt="Click here to open project homepage!"  class=vendor_link_icons id=vendor_link_icons href="' + open_projects[temp[keyVar]] + '"><img border=0 src="' + loc + temp[keyVar] + '"></a><br>';
        //        else
        //                build_url = build_url + '<a class=vendor_link_icons id=vendor_link_icons href="' + open_projects[temp[keyVar]] + '"><img border=0 src="' + loc + temp[keyVar] + '"></a><br>';

		var a = document.createElement("a");
		a.setAttribute("href", open_projects[temp[keyVar]]);
		// a.setAttribute("href", "#");  // IE is a peice of shit
		// a.setAttribute("onclick", 'javascript:window.open("'+open_projects[temp[keyVar]]+'","'+open_projects[temp[keyVar]]+'","width=950,height=700,resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=yes,menubar=no,copyhistory=no");return false');
		a.setAttribute("onclick", 'window_opener("'+open_projects[temp[keyVar]]+'","'+open_projects[temp[keyVar]]+'");return false;');
		a.setAttribute("onClick", 'window_opener("'+open_projects[temp[keyVar]]+'","'+open_projects[temp[keyVar]]+'");return false;');
		var img = document.createElement("img");
		img.setAttribute("src", loc + temp[keyVar]);
		img.setAttribute("title", open_projects[temp[keyVar]]);
		img.setAttribute("border", "0");
		img.setAttribute("margin", "0");
		a.appendChild(img);
		my_div.appendChild(a);

		if (counter == max_count) break;
        }
        // document.getElementById(container_id).innerHTML = build_url;
        // alert(my_div);
        // a = document.createElement(a);


        // nested function reference_array
        function MVILreference_array(x) {
                i=0;
                for ( keyVar in x) {
                        temp[i] = keyVar;
                        i++;
                }
        }

        function MVILRandomize() {
                return (Math.round(Math.random())-(Math.random()));
        }

}
