//alert("loading qsimg.js"); 
var qs_img;
var qs_ref_name;
var qs_http_target;
var qs_ref_status;
   
function qs_img_init() {
   qs_img = new Array(); 
   
   qs_img['JAVA_LIB'] = qs_path + '/img/java80x80.jpg'; 
   qs_img['C_LIB']    = qs_path + '/img/clib.jpg' ;
   qs_img['WIN_GUI']  = qs_path + '/img/wgui.jpg' ; 
   qs_img['JAVA_APP'] = qs_path + '/img/java80x80.jpg';    // same as JAVA_LIB
   qs_img['JAVA_GUI'] = qs_path + '/img/javagui.jpg' ;
   qs_img['CONCORDE'] = qs_path + '/img/d15_80x80.jpg' ;
   qs_img['TSP_GUI']  = qs_path + '/img/fulton80x80.jpg' ;
   qs_img['QSX']  = qs_path + '/img/qsx.jpg' ;
   qs_img['NEOS']  = qs_path + '/img/neos_globe.jpg' ;
   
   qs_ref_name = new Array(); 
   qs_ref_name['JAVA_LIB'] = 'QSopt Java library';
   qs_ref_name['C_LIB']    = 'QSopt C library';
   qs_ref_name['WIN_GUI']  = 'Windows GUI'; 
   qs_ref_name['JAVA_APP'] = 'Applet GUI';
   qs_ref_name['JAVA_GUI'] = 'Applet GUI';
   qs_ref_name['CONCORDE'] = 'Concorde';
   qs_ref_name['TSP_GUI']  = 'Cuttingplane Applet';
   qs_ref_name['QSX']  = 'QSopt_ex';
   qs_ref_name['NEOS']  = 'NEOS Server';
   
   qs_http_target = new Array(); 
   qs_http_target['DOWNLOADS'] = qs_target_file(qs_location('Downloads', undefined));
   qs_http_target['JAVA_LIB'] = qs_target_file(qs_location('Software', 'Java'));
   qs_http_target['C_LIB']    = qs_target_file(qs_location('Software', undefined));
   qs_http_target['WIN_GUI']  = qs_path + "/software/msgui.htm";
   qs_http_target['JAVA_APP'] = qs_path + "/downloads/codes/java/applet.htm";
   qs_http_target['JAVA_GUI'] = qs_path + "/downloads/codes/java/applet.htm";
   qs_http_target['CONCORDE'] = qs_httpConcorde;
   qs_http_target['TSP_GUI']  = qs_httpTspApplet;
   qs_http_target['QSX'] = qs_path + "/ex/index.html";
   qs_http_target['NEOS'] = "http://www-neos.mcs.anl.gov/neos/solvers/milp:qsopt_ex/MPS.html";
   
   qs_ref_status = new Array(); 
   qs_ref_status['DOWNLOADS'] = qs_location('Downloads', undefined);
   qs_ref_status['JAVA_LIB'] = qs_location('Software', 'Java');
   qs_ref_status['C_LIB']    = qs_location('Software', undefined);
   qs_ref_status['WIN_GUI']  = qs_location('Software', 'MS Windows') + " - GUI";
   qs_ref_status['JAVA_GUI'] = qs_location("Software", "Java") + " - GUI Applet";
   qs_ref_status['JAVA_APP'] = qs_location("Software", "Java") + " - GUI Applet";
   qs_ref_status['CONCORDE'] = qs_httpConcorde + " - Concorde Home"; 
   qs_ref_status['TSP_GUI']  = qs_httpTspApplet + " - Cutting Plane Applet";
}

function qs_add_label(s, label) 
{
   s = "<TABLE border=0px><TR><TD>" + 
         s + 
         "</TD></TR><TR><TD align=center>" + 
	 '<font size="-2">' + label + "</font>" + 
         "</TD></TR></TABLE>"; 
   return s; 
} 

function qs_http_text_link(kind, text)
{
   if (qs_img == undefined) { qs_img_init(); } 
   s = qs_file_loc_ref(qs_my_location, 
                  qs_http_target[kind],
                  qs_ref_status[kind], 
	          text); 
   return s;
} 

function qs_http_img_link(kind, dolabel, height)
{
   //alert("qs_http_img_link: " + kind);
   if (qs_img == undefined) { qs_img_init(); } 
   if (height == undefined) {
      height = ""; 
   } else {
      height = "height=" + height + "px"; 
   }
   img = '<img src="' + qs_img[kind] + '" ' + 
               height + ' ' + 
              'alt="' + qs_ref_name[kind] + '">'; 
   s = qs_http_text_link(kind, img); 
   if (dolabel) { 
      s = qs_add_label(s, qs_http_text_link(kind, qs_ref_name[kind])); 
   }
   return s;
} 

function qs_java_lib(text, height)
{
   if (text == undefined) {
      return qs_http_img_link('JAVA_LIB', true, height); 
   }  else { 
      return  qs_http_text_link('JAVA_LIB', text); 
   }
}

function qs_C_lib(text, height)
{
   if (text == undefined) {
      return qs_http_img_link('C_LIB', true, height); 
   }  else { 
      return  qs_http_text_link('C_LIB', text); 
   }
}

function qs_ms_gui(text, height)
{
   if (text == undefined) {
      return qs_http_img_link('WIN_GUI', true, height); 
   }  else { 
      return  qs_http_text_link('WIN_GUI', text); 
   }
}

function qs_java_gui(text, height)
{
   if (text == undefined) {
      return qs_http_img_link('JAVA_GUI', true, height); 
   }  else { 
      return  qs_http_text_link('JAVA_GUI', text); 
   }
}

function qs_concorde(text, height)
{
   if (text == undefined) {
      return qs_http_img_link('CONCORDE', true, height); 
   }  else { 
      return  qs_http_text_link('CONCORDE', text); 
   }
}

function qs_tsp_applet(text, height)
{
   if (text == undefined) {
      return qs_http_img_link('TSP_GUI', true, height); 
   }  else { 
      return  qs_http_text_link('TSP_GUI', text); 
   }
}

function qs_qsx(text, height)
{
   if (text == undefined) {
      return qs_http_img_link('QSX', true, height); 
   }  else { 
      return  qs_http_text_link('QSX', text); 
   }
}

function qs_neos(text, height)
{
   if (text == undefined) {
      return qs_http_img_link('NEOS', true, height); 
   }  else { 
      return  qs_http_text_link('NEOS', text); 
   }
}
//alert("loading qsimg.js DONE"); 
