// JavaScript Document
//----------------------------------------------------------------------------------------------------------browser detection
var N   = (document.layers) ? true:false;                 // netscape 4
var I   = (document.all) ? true:false;                    // IE4+ & Opera4+
var DOM = ((document.getElementById)&&(!I))?true:false;   // ns6 etc.
//------------------------ Variables---------------------------------------------
var D1;
var id;
var Tables;
var Countries;
//-------------------------------------------------------------------------------------------------------------dynamic handles
function initDynamicHandles(){
	if (I)	{	

		D1 = document.all.D1;

	} else 	{
   
		D1 = document.getElementById("D1");


	}
}
//-------------------------------------------------------------------------------------------------------------dynamic handles
function initDynamicIntros(){
	if (I)	{	

		Tables = document.all.Tables;
		Countries = document.all.Countries;

	} else 	{
   
		Tables = document.getElementById(Tables);
		Countries = document.getElementById(Countries);


	}
}


//------------------------------------------------------------SHOWDOC ----------------------------------
var table;
var country;

function showDoc() {

    table = document.Intros.Tables.options[document.Intros.Tables.selectedIndex].value;
    country = document.Intros.Countries.options[document.Intros.Countries.selectedIndex].value;
    window.open("/MISSOC/DOCS/"+table+"_"+country+".doc");
}

//--------------------------------------------------------TRANSFERTOPIC----------------------------------
function transferTopic(Quelle, Ziel, Entfernen){
var WertVorhanden = false
var ZielVorhanden = (typeof Ziel != "undefined") && (Ziel != null)
    if (!ZielVorhanden){
        Entfernen = true
        }

    for (var Nr = 0; Nr < Quelle.length; Nr++){
    var QuellOption = Quelle.options[Nr]

    if (QuellOption.value != "K"){
       if (QuellOption.selected){
          if(ZielVorhanden){

              for (var Pos = 0; Pos < Ziel.length;){
                  WertVorhanden = (Ziel.options[Pos++].value == QuellOption.value);
                  if (WertVorhanden){
                      break
                  }
              }

              if (!WertVorhanden){
                  Ziel.options[Ziel.length] = new Option(QuellOption.text, QuellOption.value);
                  document.SEARCHCRITERIA.topicIDs.value += QuellOption.value + ";";
              }
          }
          if (Entfernen){
              Quelle.options[Nr] = null;
              document.Tabellen_Auswahl.topicIDs.value="";
              for (var Nr = 0; Nr < Quelle.length; Nr++){
                  if(Quelle.options[Nr].value != null){
                      document.SEARCHCRITERIA.topicIDs.value += Quelle.options[Nr].value + ";";
                  }
              }
          }
       }
    }
    }
}

//----------------------------------------------------------------------------------------------------
var newwindow;
 function showWindow(URI, title) {
	if (I) {
	    newwindow = window.open(URI, '', 'top=40,left=10,width=1200,height=1400,menubar=0,toolbar=0,scrollbars=yes');
	} else {
	    newwindow = window.open(URI, title, 'top=40,left=10,width=1200,height=1400,menubar=0,toolbar=0,scrollbars=yes');
	}
 }
//-----------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------
var newwindow2;
 function showWindowBrowsable(URI, title) {
	if (I) {
	    newwindow2 = window.open(URI, '', 'top=40,left=10,width=1200,height=1400,menubar=1,toolbar=1,scrollbars=yes');
	} else {
	    newwindow2 = window.open(URI, title, 'top=40,left=10,width=1200,height=1400,menubar=1,toolbar=1,scrollbars=yes');
	}
 }
//-----------------------------------------------------------------------------------------------------

