var BrowserName	   = navigator.appName;
var BrowserVersion = navigator.appVersion;	
var VersionShort   = BrowserVersion.substr(0, 1);
function WinOpen(seite)
   {
seite = seite+session_sid+"?forward=";

var high =690;
var wide =980;


if(VersionShort  >3){
   if(BrowserName == "Netscape")
   {
   wavewin=window.open(seite,"_blank","fullscreen=no,scrollbars=no,toolbar=no,resizable=0,resizable=no,menubar=no,location=no,status=no,hotkeys=no,height=" + high	+ ",width=" + wide);
   wavewin.focus();
  //window.moveTo(0, 0);
   }
 }
 
if(BrowserName == "Microsoft Internet Explorer")
     {
wavewin=open(seite,"","fullscreen=no,scrollbars=no,resizable=yes,toolbar=no,menubar=no,location=no,status=no,hotkeys=no,height=" + high + " ,width=" +	wide);	
      if(wavewin != null && typeof(wavewin.moveTo) =="function")
      {
      wavewin.moveTo(0,0);
      //wavewin.focus();
      }
    }
  //return false;
 //-->
 
 }
// This funktion is used from a link which is configured with the 'send' handler
function openlinkWindow(winLocation,high,wide,target,send_url)
{ 
    //send_url = encodeURIComponent(send_url);
    wavewin=window.open(winLocation+send_url,target,"fullscreen=no,scrollbars=no,resizable=yes,toolbar=no,menubar=no,location=no,status=no,hotkeys=no,height=" + high + " ,width=" +	wide);
	wavewin.focus();
	//return false;
}


function reload_opener()
{    	
    if(typeof(window.opener) == "undefined" 
        )
	    return;
	 opener.location.reload();
	 window.close();
}
/* Funktion um auf eine bestimmte Seite zu sprigen.
Z.B. aus der Navigation.
Der Eintrag im BO 'URL oder lokaler Pfad:' würde dann
z.B. javascript:siteJump('hxcms/production_category','client_article_mainnav/sport/formel_1','')
so aussehen.
*/

function siteJump(path,main_category,main_object_id){
/*    alert('path = '+path);
      alert('session = '+session_sid);
      alert('category = ' + main_category);
      alert('object_id = ' + main_object_id);
*/      
    if (session_sid != '')
        redirect_path = pre_path + path +session_sid+
        +"\/"+main_category+"\/"+main_object_id;
    else
       redirect_path = pre_path + path 
       +"\/"+main_category+"\/"+main_object_id;
    
//    alert(redirect_path);
    window.location.href=redirect_path;
  }
/*
Allgemeinefunktionalität um Formularfeldinhalte zu überprüfen.
Dazu diese Funktion benützen:
FO_validateForm(attribs);
Dort ist folgene Form einzuhalten.
<attrib_name>,<Anzuzeigender Name>,<form>|<attrib_name>,<Anzuzeigender Name>,<form>|...
Bsp.
'ext_abo_lastname,Name,R|ext_abo_firstname,Prename,R|ext_abo_email,eMail,RisEmail'
<form> Möglichkeiten R für muss da sein
                     RisEmail für die Emailsyntax
                     RisNum fü numerische Werte
*/

<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm(arg1,arg2,arg3,arg4, success) { //v4.1: new optional success parameter
// NEW: only if last parameter is present, then ERROR STRING or 'success' value is obtained 
// - else true or false!
  var errmsg_email        = 'muss eine Email-Adresse beinhalten.';
  var errormsg_between    = 'muss eine Zahl zwischen';
  var errormsg_between1   = 'und';
  var errormsg_between2   = 'enthalten';
  var errormsg_main       = 'Beheben Sie folgende(n) Fehler:';
  var errormsg_containnr  = 'muss eine Nummer beinhalten';
  var errormsg_used       = 'wird benoetigt';
  var errormsg_morethan   = ' Zeichen noetig';

  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; 
       val=MM_findObj(args[i]);
   if (val) 
   { nm=arg4; if ((val=val.value)!="") 
	{
      p=0;
	  if (test.indexOf('isEmail')!=-1)
	    { p=val.indexOf('@');
         if (p<1 || p==(val.length-1)) errors+='- '+nm+' '+errmsg_email+'\n';
        } 
      
	  else if (test.indexOf('M')!=-1)
	  {
	  	//alert(test.substring(1));
	  	//alert(nm);alert(val.length);
	  	
	  	if (test.substring(1)-1>=val.length){
	  	   more=test.substring(1);
	  	   errors += '- '+nm+' '+more+' '+errormsg_morethan +'\n';	
	  	   }
	  }	   
	  else if (test!='R') 
	    { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
          if (test.indexOf('inRange') != -1)
		     { p=test.indexOf(':');
             min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' '+errormsg_between+' '+min+' '+errormsg_between1+' '+max+' '+errormsg_between2+'\n';
             }
		 }
	  } 
	 else if (test.charAt(0) == 'R') errors += '- '+nm+' '+errormsg_used +'\n'; 
	 
	 }
  } 
document.MM_returnValue = (errors == '');
if (errors != '') { if (success==null)	{ alert(errormsg_main +'\n'+errors); return false; 
					} else return errors; // String!
		  } else {
			 if (success==null) return true; 
					else return success; 
			}
}

function FO_validateForm(attribs) { //v1.1
	var err='';
 	var attribs_array = attribs.split("|");
	for(i=0;i<attribs_array.length;i++){
		var attribs_expression = attribs_array[i].split(",");
		attrib_value = attribs_expression[1];
		attrib_expression =  attribs_expression[2];
		attrib_name      =  attribs_expression[0];
		//alert(attrib_name+" "+attrib_expression," ",attrib_value);

	// NEW: last parameter is present, so '' or ERROR STRING is obtained:
	err = err + MM_validateForm(attrib_name,'',attrib_expression,attrib_value, '');
	} // for

	if (err == '') return true;
	else	 { alert('Beheben Sie folgende(n) Fehler:\n'+err); 
		   return false; 	
		 }
}

/*
Diese Funktion zählt den Wert inCount rückwärts bis 0 und vergleicht
diesen mit der Länge des Feldes inFormObject (Übergabe: this.form.<attrib_name>). 
Soll der Aktuelle Count in einem Textfield zurückgegeben werden, so
muss das Object reachedObject (Übergabe: this.form.<inputfieldname>) auch noch übergeben werden.
Soll am Ende des Countdowns ein Warnausgabe Javascript erfolgen, so ist
der Warntext inAlert zu übergeben
*/
function counterField(reachedObject,inFormObject,inCount,inAlert)
 {
  if (typeof(reachedObject) != "undefined" && reachedObject !="")
     reachedObject.value = inCount -inFormObject.value.length;
	 
  if (inFormObject.value.length >  inCount ) {
      inFormObject.value = inFormObject.value.substr(0, inCount);
	  if (typeof(reachedObject) != "undefined" && reachedObject !="")
	 	 reachedObject.value = 0;
	  if (typeof(inAlert) != "undefined" && inAlert != "")
	  	  alert(inAlert);
	   }  
 }
 
       m_id = 0;
       function openWindow(theme)
       {
         var win = new Window(m_id++, {className: theme,  width:350, height:400, zIndex: 100, resizable: true, title: "Internet Professional", showEffect:Effect.BlindDown, hideEffect: Effect.SwitchOff, draggable:true})
	 win.getContent().innerHTML= "<div style='padding:10px; font-size: 10pt;'>Dies ist das Testfenster Nr. "+m_id+"</div>";
	 win.showCenter();
       } 

       function openUrl(theme,title,openUrl,width,height)
       {
         if (typeof(width)=="undefined") width=380;
         if (typeof(height)=="undefined") height=420;
         var win = new Window(m_id++, {className: theme,  width: width, height: height, zIndex: 100, resizable: true, title: title, showEffect:Effect.BlindDown, hideEffect: Effect.SwitchOff, draggable:true, url: openUrl });
	 win.showCenter();
       }

       function openAlert()
       {
	 Dialog.alert("<strong style='color:red;'>Achtung</strong>Test eines Alert Fensters, alle anderen Elemente sind jetzt gesperrt", 
             {windowParameters: {className: "alphacube", width:300}, okLabel: "OK", 
              ok:function(win) {return true;}});
       }
    

function showDescription(rowNo,iconActiv,iconInactiv,ImgServer,Stat)
 {
  if(document.getElementById || document.all)
    {
    if(document.getElementById(rowNo))
	  {
	    var descriptionNo = rowNo;
		var imageName = 'comment_'+rowNo;
		if(document.getElementById(descriptionNo).style.display == 'none')
		  {
		  document.getElementById(descriptionNo).style.display = 'block';
		  document.images[imageName].src = ImgServer + 'pix/'+iconActiv+'.gif';
					       }
					       else if(document.getElementById(descriptionNo).style.display == 'block')
					       {
					         document.getElementById(descriptionNo).style.display = 'none';
					         document.images[imageName].src = ImgServer + 'pix/'+iconInactiv+'.gif';
					       }
					     }
				     }
				    
				  }
//-->
<!-- 

// Browserweiche   
var w3c = document.getElementById&&!document.all?1:0;
var msie = document.all?1:0;


function intro() {

 // Event-Listener fuer Doppelklick registrieren  

 if(w3c) { // DOM Level 2 kompatible Browser  
  var field = document.getElementById("dict");
  field.addEventListener("dblclick", fetchSel, true);
 }

 if(msie) { // MS Internet Explorer  
  var field = document.all.dict;
  field.ondblclick = fetchSel;
 }
}


function fetchSel() {

 // Selektierten Text in Variable speichern

 if(document.selection) {
  selected = document.selection.createRange().text;
  if(selected != "") {
   document.selection.empty();
  }
 }
 else if(window.getSelection) {
  selected = window.getSelection().toString();
  selected = selected.replace(/["!?;:,.]/g, "");
 }
 
 popup(selected);
}


function popup(selected) {

 // Deutsche Wikipedia
 var searchURL ="http://de.wikipedia.org/";
 var attr= "wiki/" + escape(selected);

 // Alternative: Deutsch-Englisches Woerterbuch
 // var searchURL = "http://dict.leo.org/";
 // var attr = "?search=" + escape(selected) + "&amp;lang=en";

 // Parameter fuer das Popup-Fenster
 var param = "width=590,height=430";
 param += ",left=300,top=60";
 param += ",menubar=1";
 param += ",location=1";
 param += ",scrollbars=1";
 param += ",resizable=1";
 param += ",toolbar=1";
 param += ",status=0";

 if(selected != "") {
  // Popup oeffnen
  popWin = window.open(searchURL + attr,"s",param);
  // Popup in den Vordergrund schicken 
  popWin.focus();
 }
}


// Special function for the voting form
function checkRadio(theForm,feld) {
	for (i=0; i<feld.length; i++){
			if(feld[i].checked == true){
				theForm.ext_setvote_radio.value = feld[i].value;
		}
	}
}                    



//-->

