function OpenWindow(file,x,y) {

var vars;
vars = 'width='+x+',height='+y+',left=10,top=10,scrollbars=0,resizable=1';
window.open(file,'PopUp',vars);
}

//-------------------------------------------------------------------
// isInteger(value)
//   Returns true if value contains all digits
//-------------------------------------------------------------------
function isInteger(val){
	if (isBlank(val)){return false;}
	for(var i=0;i<val.length;i++){
		if(!isDigit(val.charAt(i))){return false;}
		}
	return true;
	}

//-------------------------------------------------------------------
// isNumeric(value)
//   Returns true if value contains a positive float value
//-------------------------------------------------------------------
function isNumeric(val){return(parseFloat(val,10)==(val*1));}

//-------------------------------------------------------------------
// isArray(obj)
// Returns true if the object is an array, else false
//-------------------------------------------------------------------
function isArray(obj){return(typeof(obj.length)=="undefined")?false:true;}

//-------------------------------------------------------------------
// isDigit(value)
//   Returns true if value is a 1-character digit
//-------------------------------------------------------------------
function isDigit(num) {
	if (num.length>1){return false;}
	var string="1234567890";
	if (string.indexOf(num)!=-1){return true;}
	return false;
	}
   
function isString(str)
{
   if (!String(str))
      return false;
}   
/**
 * DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */

function isEmail(str) {

   var at="@"
   var dot="."
   var lat=str.indexOf(at)
   var lstr=str.length
   var ldot=str.indexOf(dot)
   if (str.indexOf(at)==-1){
     return false;
   }
   
   if (lstr<8)
      return false;
   
   if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
     return false;
   }
   
   if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
      return false;
   }
   
   if (str.indexOf(at,(lat+1))!=-1){
      return false;
   }
   
   if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
      return false;
   }
   
   if (str.indexOf(dot,(lat+2))==-1){
      return false;
   }
   
   if (str.indexOf(" ")!=-1){
      return false;
   }
   
    return true;			
}


function ShowFlashHeader(hasRightVersion, source)
{
   if(hasRightVersion) {  // if we've detected an acceptable version
		var oeTags = '<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
		+ 'WIDTH="948" HEIGHT="163" id="flashHeader" '
		+ 'CODEBASE="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0">'
		+ '<PARAM NAME="MOVIE" VALUE="flash/' + source + '.swf">'
		+ '<PARAM NAME="PLAY" VALUE="true">'
		+ '<PARAM NAME="LOOP" VALUE="false">'
		+ '<PARAM NAME="QUALITY" VALUE="high">'
		+ '<PARAM NAME="MENU" VALUE="false">'
		+ '<PARAM NAME="BGCOLOR" VALUE="#d4d4d4">'
		+ '<EMBED SRC="flash/' + source + '.swf"'
		+ 'WIDTH="948" HEIGHT="163"'
		+ 'PLAY="true"'
		+ 'LOOP="false"'
		+ 'QUALITY="high"'
		+ 'MENU="false"'
		+ 'BGCOLOR="#d4d4d4"'
		+ 'TYPE="application/x-shockwave-flash"'
		+ 'PLUGINSPAGE="https://www.macromedia.com/go/getflashplayer" name="flashHeader" swLiveConnect=true>'
		+ '<\/EMBED>'
		+ '<\/OBJECT>';
		
		document.write(oeTags);   // embed the flash movie
   } else {  // flash is too old or we can't detect the plugin
     
	 var imgAltText = new Array();
	 imgAltText['www'] = 'Lloyd Fonds AG';
	 imgAltText['vertrieb'] = 'Vertriebspartner';
	 imgAltText['treuhand'] = 'Anleger / Treuhand';
	 
     var alternateContent = '<img src="img/lfag_head_noflash_' + source + '.jpg" alt="' + imgAltText[source] + '" />';      
	 document.write(alternateContent);  // insert non-flash content
	 
   }
}
