var ref=1;

//wird im neuen Layout nicht mehr fuer die Indizes benoetigt!!!kann weg!!
function links(){
        switch (ref){
        case 1: location.href="http://ard.gedif.de/ard/kurse_listen.htm?portal=ard&sektion=dax";
				
        break;
        case 2: location.href="http://ard.gedif.de/ard/kurse_listen.htm?portal=ard&sektion=estoxx&s=965814&l=840&b=9";
        
        break;
        case 3: location.href="http://ard.gedif.de/ard/kurse_listen.htm?portal=ard&sektion=djii&erweitert=0&s=DJI.DJ&l=840&b=101";
        
        break;
        case 4: location.href="http://ard.gedif.de/ard/kurse_listen.htm?portal=ard&sektion=nasdaq100&erweitert=0&s=NDX_X.IQ&l=840&b=100";
        
        break;
        }
}
 
function chgChart(chart) {
			switch (chart) {
				case 1:		document.reiter.src="img/reiter_dax.gif";
					    document.chart.src=imgDAX;
              ref=1;

                            break;
				case 2:		document.reiter.src="img/reiter_estx50.gif";
							document.chart.src=imgSTOX;
							ref=2;
                            break;
				case 3:		document.reiter.src="img/reiter_dow.gif";
							document.chart.src=imgDOW;
							ref=3;
                            break;
				case 4:		document.reiter.src="img/reiter_nsdq.gif";
							document.chart.src=imgNASDAQ;
							ref=4;
                            break;																					
			}
}
//ende wird fuer die indizes benoetigt!! 
function ChangePic_forward(idx) {
	var Pic = idx;
	var id = DOC_ID;
	var hdParam = "";
  var hd = S_HAUPTDOKUMENT;
	if(hd != "") {
    hdParam = "&hd=" + hd;
  }
	if(Pic < (I_ANZ_PIC - 1)) {	
		Pic++;		
		location.href="fotoserie.jsp?id=" + id + "&index=" + Pic + hdParam;
	} else {
		Pic = 0;
		location.href="fotoserie.jsp?id=" + id + "&index=" + Pic + hdParam;
	}	
}
function ChangePic_back(idx) {
	var Pic = idx;
	var id = DOC_ID;
	var hdParam = "";
  var hd = S_HAUPTDOKUMENT;
	if(hd != "") {
    hdParam = "&hd=" + hd;
  }
	if(Pic > 0) {	
		Pic--;
		location.href="fotoserie.jsp?id=" + id + "&index=" + Pic + hdParam;
	} else {
		Pic = I_ANZ_PIC - 1;
		location.href="fotoserie.jsp?id=" + id + "&index=" + Pic + hdParam;
	}
}
function printCurrentPic(idx) {
	var id = DOC_ID;
	location.href="druck_fotoserie.jsp?id=" + id + "&index=" + idx;
}
function printAllPic() {
	var id = DOC_ID;
	location.href="druck_fotoserie.jsp?id=" + id;
}
function openLinkPic() {
	var intern = S_INTERN_AKT;
	var linkstr = S_LINK_AKT;
	if(intern == "true") { // interner Link?
		document.location.href = linkstr;
	} else {
		window.open(linkstr);
	}
}
function ChangeTxt_forward(idx) {
	var Txt = idx;
	var key = DOC_KEY;		
	if(Txt < (I_ANZ_TXT - 1)) {	
		Txt++;		
		location.href="clickthrough.jsp?key=" + key + "&index=" + Txt;
	} else {
		Txt = 0;
		location.href="clickthrough.jsp?key=" + key + "&index=" + Txt;
	}	
}
function ChangeTxt_back(idx) {
	var Txt = idx;
	var key = DOC_KEY;
	if(Txt > 0) {	
		Txt--;
		location.href="clickthrough.jsp?key=" + key + "&index=" + Txt;
	} else {
		Txt = I_ANZ_TXT - 1;
		location.href="clickthrough.jsp?key=" + key + "&index=" + Txt;
	}
}
function printCurrentTxt(idx) {
	var key = DOC_KEY;
	location.href="druck_clickthrough.jsp?key=" + key + "&index=" + idx;
}
function printAllTxt() {
	var key = DOC_KEY;
	location.href="druck_clickthrough.jsp?key=" + key;
}
function openLinkTxt() {
	var intern = S_INTERN_AKT;
	var linkstr = S_LINK_AKT;
	var gatrixx = S_GATRIXX;
	if(intern == "true") { // interner Link?
		opener.location.href = linkstr;
	} else {
			if(gatrixx=="true") {
					window.name = "ccc";
					window.open(linkstr,'Kurse','scrollbars=yes,width=787,height=840,resizable=yes');
			} else {
					window.open(linkstr);
			}		
	}
}
function ChangeChart_forward(idx) {
	var Pic = idx;
	var key = DOC_KEY;		
	if(Pic < (I_ANZ_CHART - 1)) {	
		Pic++;		
		location.href="chartserie.jsp?key=" + key + "&index=" + Pic;
	} else {
		Pic = 0;
		location.href="chartserie.jsp?key=" + key + "&index=" + Pic;
	}	
}
function ChangeChart_back(idx) {
	var Pic = idx;
	var key = DOC_KEY;
	if(Pic > 0) {	
		Pic--;
		location.href="chartserie.jsp?key=" + key + "&index=" + Pic;
	} else {
		Pic = I_ANZ_CHART - 1;
		location.href="chartserie.jsp?key=" + key + "&index=" + Pic;
	}
}
function printCurrentChart(idx) {
	var key = DOC_KEY;
	location.href="druck_chartserie.jsp?key=" + key + "&index=" + idx;
}
function printAllChart() {
	var key = DOC_KEY;
	location.href="druck_chartserie.jsp?key=" + key;
}
function openLinkChart() {
	var intern = S_INTERN_AKT;
	var linkstr = S_LINK_AKT;
	if(intern == "true") { // interner Link?
		opener.location.href = linkstr;
	} else {
		window.open(linkstr);
	}
}
function openChart() {
	var link = S_CHARTLINK;
	opener.location=link;
}
// Wird das noch gebraucht???
function openGatrixx() {
//			theURL = parURL;
	//		if (theURL !=0){
	  	//      document.location.href=""+theURL;
		//	}
}

function Check(){     
		   var i;
		   var i_value;
					var radiochecked = false;
		   for (i = 0; i < document.votefrm.rowid.length; i ++) {
		      if (document.votefrm.rowid[i].checked == true) {
		         i_value = document.votefrm.rowid[i].value;
		         radiochecked = true;
		      }
		   }																				
					if(radiochecked) {
								document.votefrm.submit();
     } else {
        alert('Bitte wählen Sie eine Antwort!');
     }   
}
function DasErstePopup(tTarget,tWx,tWy) {
 //if (dasErstePopupWin)
 // if(!dasErstePopupWin.closed) 
 //  dasErstePopupWin.close();

 dasErstePopupWin=window.open(tTarget,"DasErstePopup","width="+tWx+",height="+tWy+""); 
 dasErstePopupWin.focus(); 
}
function clearText(field){
    if (field.defaultValue == field.value) field.value = '';
    else if (field.value == '') field.value = field.defaultValue;
}
