/* Copyright 2008 DAB bank AG */
(function($){var dropShadowZindex=1801;$.fn.dropShadow=function(options)
{var opt=$.extend({left:4,top:4,blur:2,opacity:.5,color:"black",swap:false},options);var jShadows=$([]);this.not(".dropShadow").each(function()
{var jthis=$(this);var shadows=[];var blur=(opt.blur<=0)?0:opt.blur;var opacity=(blur==0)?opt.opacity:opt.opacity/(blur*8);var zOriginal=(opt.swap)?dropShadowZindex:dropShadowZindex+1;var zShadow=(opt.swap)?dropShadowZindex+1:dropShadowZindex;var shadowId;if(this.id){shadowId=this.id+"_dropShadow";}
else{shadowId="ds"+(1+Math.floor(9999*Math.random()));}
$.data(this,"shadowId",shadowId);$.data(this,"shadowOptions",options);jthis.attr("shadowId",shadowId).css("zIndex",zOriginal);if(jthis.css("position")!="absolute"){jthis.css({position:"relative",zoom:1});}
bgColor=jthis.css("backgroundColor");if(bgColor=="rgba(0, 0, 0, 0)")bgColor="transparent";if(bgColor!="transparent"||jthis.css("backgroundImage")!="none"||this.nodeName=="SELECT"||this.nodeName=="INPUT"||this.nodeName=="TEXTAREA"){shadows[0]=$("<div></div>").css("background",opt.color);}
else{shadows[0]=jthis.clone().removeAttr("id").removeAttr("name").removeAttr("shadowId").css("color",opt.color);}
shadows[0].addClass("dropShadow").css({height:jthis.outerHeight(),left:blur,opacity:opacity,position:"absolute",top:blur,width:jthis.outerWidth(),zIndex:zShadow});var layers=(8*blur)+1;for(i=1;i<layers;i++){shadows[i]=shadows[0].clone();}
var i=1;var j=blur;while(j>0){shadows[i].css({left:j*2,top:0});shadows[i+1].css({left:j*4,top:j*2});shadows[i+2].css({left:j*2,top:j*4});shadows[i+3].css({left:0,top:j*2});shadows[i+4].css({left:j*3,top:j});shadows[i+5].css({left:j*3,top:j*3});shadows[i+6].css({left:j,top:j*3});shadows[i+7].css({left:j,top:j});i+=8;j--;}
var divShadow=$("<div></div>").attr("id",shadowId).addClass("dropShadow").css({left:opt.left-blur,marginTop:jthis.css("marginTop"),marginRight:jthis.css("marginRight"),marginBottom:jthis.css("marginBottom"),marginLeft:jthis.css("marginLeft"),position:"absolute",top:opt.top-blur,zIndex:zShadow,display:"none"});for(i=0;i<layers;i++){divShadow.append(shadows[i]);}
jthis.after(divShadow);divShadow.fadeIn(100);jShadows=jShadows.add(divShadow);$(window).resize(function()
{try{divShadow.css({left:opt.left-blur,top:opt.top-blur});}
catch(e){}});dropShadowZindex+=2;});return this.pushStack(jShadows);};$.fn.redrawShadow=function()
{this.removeShadow();return this.each(function()
{var shadowOptions=$.data(this,"shadowOptions");$(this).dropShadow(shadowOptions);});};$.fn.removeShadow=function()
{return this.each(function()
{var shadowId=$(this).shadowId();$("div#"+shadowId).fadeOut(100);});};$.fn.shadowId=function()
{return $.data(this[0],"shadowId");};$(function()
{var noPrint="<style type='text/css' media='print'>";noPrint+=".dropShadow{visibility:hidden;}</style>";$("head").append(noPrint);});})(jQuery);var APP_EXTENSION=".html";var FACTSHEET_URL=DAB_MARKETS_BASE_URL+'/kursdetails/{idInstrument}_'+APP_EXTENSION;var MULTI_ASSET_SEARCH_URL=DAB_MARKETS_BASE_URL+'/schnellsuche'+APP_EXTENSION;var IMG_PATH=DAB_MARKETS_BASE_URL+"/img";var aFactsheetUrl=new Array();aFactsheetUrl['FTL']=DAB_PORTAL_BASE_URL+'/maerkte-kurse/aktien-suche/allgemeines_kurssuchergebnis.app.html?swptyp=STK&spring=search&searchfor=';aFactsheetUrl['MDG']=FACTSHEET_URL;var multiAssetSearchUrl=MULTI_ASSET_SEARCH_URL;function hideBackground(){jQuery("#navLevel1Container").css("zIndex","-1");jQuery("#bd").css("zIndex","-1");}
function showBackground(){jQuery("#navLevel1Container").css("zIndex","100");jQuery("#bd").css("zIndex","100");showSelectBoxes();}
function showAutosuggester(){hideBackground();jQuery('#IDMS_autocomplete_choices_dropShadow').show();jQuery('#IDMS_autocomplete_choices').show();}
function hideAutosuggester(){showBackground();jQuery('#IDMS_autocomplete_choices_dropShadow').hide();jQuery('#IDMS_autocomplete_choices').hide();}
function onShowSuggester(){hideSelectBoxes();hideBackground();}
function onHideSuggester(){showSelectBoxes();showBackground();}
function showSelectBoxes(){if(jQuery.browser.msie&&jQuery.browser.version<7){jQuery('#idCategory').css("visibility","visible");}}
function hideSelectBoxes(){if(jQuery.browser.msie&&jQuery.browser.version<7){jQuery('#idCategory').css("visibility","hidden");}}
function SuggestCallback(aCallback){var searchValue=jQuery('input#IDMS_autocomplete').val();var factsheetUrl;if(aCallback['TOOL']=='IND'||aCallback['TOOL']=='COM'||aCallback['TOOL']=='MET'||aCallback['TOOL']=='FUT'||aCallback['TOOL']=='CUR'){factsheetUrl=aFactsheetUrl['MDG'].replace("{idInstrument}",aCallback['ID_NOTATION']);}else if(aCallback['TOOL']=='DAB'){factsheetUrl=aCallback['ISIN']+"&searchValue="+searchValue;}else{factsheetUrl=aFactsheetUrl['FTL']+aCallback['ISIN'];}
var targetUrl=DAB_MARKETS_BASE_URL+"/redirect/redirect.action?redirectUrl="+escape(factsheetUrl)+'&searchValue='+searchValue;location.href=targetUrl;}
var aToolTranslate=new Array();aToolTranslate['STO']="stocks";aToolTranslate['FUN']="funds";aToolTranslate['IND']="indices";aToolTranslate['BON']="bonds";aToolTranslate['CUR']="others";aToolTranslate['COM']="others";aToolTranslate['MET']="others";aToolTranslate['FUT']="others";aToolTranslate['DAB']="cq";function SuggestCategoryCallback(idTool,searchValue){location.href=multiAssetSearchUrl+"?tool="+aToolTranslate[idTool]+"&searchValue="+searchValue;}
function Set_Cookie(name,value,expires,path,domain,secure){var today=new Date();today.setTime(today.getTime());if(expires){expires=expires*1000*60*60*24;}
var expires_date=new Date(today.getTime()+(expires));document.cookie=name+"="+escape(value)+
((expires)?";expires="+expires_date.toGMTString():"")+
((path)?";path="+path:"")+
((domain)?";domain="+domain:"")+
((secure)?";secure":"");}
function Get_Cookie(name){var start=document.cookie.indexOf(name+"=");var len=start+name.length+1;if((!start)&&(name!=document.cookie.substring(0,name.length))){return null;}
if(start==-1)return null;var end=document.cookie.indexOf(";",len);if(end==-1)end=document.cookie.length;return unescape(document.cookie.substring(len,end));}
function Delete_Cookie(name,path,domain){document.cookie=name+"="+
((path)?";path="+path:"")+
((domain)?";domain="+domain:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT";}
function IDMS_ajax_snippet(sParams,sId,sMode,sToolUrl){if(jQuery('#'+sId)){Scheduler.ajaxSnippet(sParams,sId,sMode,sToolUrl);}}
var SchedulerClass={Version:'1.0',initialize:function(){this.aInterval=new Array();this.aIntervalId=new Array();this.sInterval=0;jQuery(window).scroll(function(){Scheduler.scheduleManual();});jQuery(window).resize(function(){Scheduler.scheduleManual();});},scheduleManual:function(){Scheduler.sInterval+=1;for(i=0;i<this.aIntervalId.length;i++){eval(this.aInterval[this.aIntervalId[i]]['ACTION']);}},switchToManuelMode:function(sId,sMode,sAction){if(this.aInterval[sId]['INTERVAL']!='ad_server'){clearInterval(this.aInterval[sId]['INTERVAL']);Scheduler.unsubscribe(sId);Scheduler.subscribe(sId,sMode,sAction);}},ajaxSnippet:function(sParams,sId,sMode,sToolUrl){var sPattern=/^IDMS_[a-zA-Z_]*(_[0-9])$/;var aMatchesValue=sId.match(sPattern);sParams+=(aMatchesValue)?'&AJAX_TARGET_NR='+aMatchesValue[1]:'';if(jQuery('#'+sId+'_loading')){jQuery(sId+'_loading').show();}
var sFileName=(sId==undefined)?'':(Scheduler.skipIdSuffix(sId).replace('IDMS','ajax'))+'.html';var url=(sToolUrl==undefined)?sFileName:sToolUrl+sFileName;var sToolUrl=(sToolUrl==undefined)?'':sToolUrl;$aRequestAsPost='get';if(sMode=='submit'){if(this.aInterval[sId]==undefined){subscribe(sId,sMode,'');Scheduler.incrSubscriptionCount(sId);if(jQuery('#IDMS_save')){IDMS_UpdateMyFtdDataArray(sId,jQuery('#'+sId+'_form').serialize());}
jQuery('#'+sId+'_form').request({parameters:sParams,onComplete:function(response){jQuery('#'+sId).html(response.responseText);Scheduler.unsubscribe(sId);Scheduler.ajaxSnippetCallback(sId);}});}}
else if(sMode=='load'){if(this.aInterval[sId]==undefined){this.subscribe(sId,sMode,'');this.incrSubscriptionCount(sId);if(jQuery('#IDMS_save')){IDMS_UpdateMyFtdDataArray(sId,sParams);}
var myAjax=new Ajax.Request(url,{method:$sMethod,parameters:sParams,onComplete:function(response){jQuery('#'+sId).html(response.responseText);this.unsubscribe(sId);this.ajaxSnippetCallback(sId);}});}}
else if(sMode=='load_all'){var sSearchPattern=new RegExp("IDMS","i");for(i=0;i<this.aIntervalId.length;i++){if(this.aIntervalId[i].match(sSearchPattern)){this.aInterval[this.aIntervalId[i]]['ENFORCE_LOADING']=true;}}}
else if(sMode=='load_smart'){if(this.aInterval[sId]==undefined){this.subscribe(sId,sMode,'this.ajaxSnippet("'+sParams+'","'+sId+'","'+sMode+'","'+sToolUrl+'")');}
if(this.aInterval[sId]['ACTIVE']){this.incrSubscriptionCount(sId);if(this.visiblePosition(sId)||this.aInterval[sId]['ENFORCE_LOADING']){this.aInterval[sId]['ACTIVE']=false;var myAjax=new Ajax.Request(url,{method:'get',parameters:sParams,onComplete:function(response){jQuery('#'+sId).html(response.responseText);this.unsubscribe(sId);this.ajaxSnippetCallback(sId);}});}}}},subscribe:function(sId,sMode,sAction){this.aIntervalId.push(sId);this.aInterval[sId]=new Array();this.aInterval[sId]['ENFORCE_LOADING']=false;this.aInterval[sId]['ACTIVE']=true;this.aInterval[sId]['ID']=sId;this.aInterval[sId]['AJAX_COMPLETE']=false;this.aInterval[sId]['INTERVAL']=sMode;this.aInterval[sId]['ACTION']=sAction;this.aInterval[sId]['COUNT']=0;},incrSubscriptionCount:function(sId){this.aInterval[sId]['COUNT']++;},getSubscriptionCount:function(sId){return this.aInterval[sId]['COUNT'];},unsubscribe:function(sId){this.aInterval[sId]['AJAX_COMPLETE']=true;this.aIntervalId=jQuery.grep(this.aIntervalId,function(value){return value!=sId;});delete this.aInterval[sId];},ajaxSnippetCallback:function(sId){var iCountScriptSections=document.getElementById(sId).getElementsByTagName('script').length;for(i=0;i<iCountScriptSections;i++){eval(document.getElementById(sId).getElementsByTagName('script')[i].html());}},skipIdSuffix:function(sId){var sPattern=/^IDMS_[a-zA-Z_]*(_[0-9])$/;var aMatchesValue=sId.match(sPattern);return(aMatchesValue)?(sId.replace(aMatchesValue[1],'')):sId;},visiblePosition:function(sId){return(Position.page(jQuery('#'+sId))[1]<=this.getWindowHeight()&&Position.page(jQuery('#'+sId))[1]>=0);},numsort:function(a,b){return b-a;},getWindowHeight:function(){var aWindowHeight=new Array(document.body.clientHeight,document.documentElement.clientHeight,window.innerHeight);aWindowHeight.compact();aHeight=aWindowHeight.sort(this.numsort);return aHeight[0];},printAll:function(){var newId='PRINT_ALL';this.scheduleManual();if(this.aInterval[newId]==undefined){this.aIntervalId.push(newId);this.aInterval[newId]=new Array();this.aInterval[newId]['INTERVAL']=setInterval('this.printAll("'+newId+'")',100);this.aInterval[newId]['ACTION']='';this.aInterval[newId]['ACTIVE']=true;this.aInterval[newId]['ID']=newId;this.aInterval[newId]['AJAX_COMPLETE']=true;this.aInterval[newId]['COUNT']=0;jQuery('#'+newId).src='/images/print_ani.gif';this.ajaxSnippet('','','load_all','');}
this.incrSubscriptionCount(newId);var sSearchPattern=new RegExp("IDMS","i");var sAllIds=this.aIntervalId.join(' ');if(!(sAllIds.match(sSearchPattern))){clearInterval(this.aInterval[newId]['INTERVAL']);this.unsubscribe(newId);jQuery('#'+newId).src='/images/print.gif';print();}},monitorStart:function(){if(!(jQuery('#IDMS_debug'))){var DebugDiv=Builder.node('div',{id:'IDMS_debug',style:'display: none;'},'&nbsp;');var body=document.getElementsByTagName("body").item(0);body.appendChild(DebugDiv);}
sInterval=0;IntervalDebug=window.setInterval('Scheduler.monitorShow()',250);jQuery('#IDMS_debug').show();},monitorStop:function(){clearInterval(IntervalDebug);jQuery('#IDMS_debug').hide();},monitorShow:function(){var output;var mystyle='font-size:10px;border:solid red 2px; position:fixed;top:130px;right:10px;z-index:1000; background-color:white;color:black';output='<table style="'+mystyle+'" cellspacing="0" cellpadding="0" border="1">';output+='<tr>';output+='<td colspan="6" style="font-size:12px;text-align:center"><b>Scheduler Monitor&nbsp;</b><span style="font-size:10px">('+this.sInterval+' intervals)</span><\/td>';output+='<\/tr>';output+='<tr>';output+='<th width="170">Target Id<\/th>';output+='<th width="40">Y-Pos.<br>Target<\/th>';output+='<th width="60">Action<\/th>';output+='<th width="30">Attempts <br>to load<\/th>';output+='<th width="30">Activ<\/th>';output+='<th width="30">Ajax<br>done<\/th>';output+='<\/tr>';for(i=0;i<this.aIntervalId.length;i++){sId=this.aIntervalId[i];yOffset=(jQuery('#'+sId)).offset().top;jQuery('#'+sId).css('visibility','hidden');jQuery('#'+sId).show();jQuery('#'+sId).css('visibility','visible');yPosition=(jQuery('#'+sId)).offset().top;yPosTarget=yPosition-yOffset;output+='<tr>';output+='<td>&nbsp;'+this.aIntervalId[i]+'<\/td>';output+='<td align="center">'+yPosTarget+'<\/td>';output+='<td align="center">'+this.aInterval[sId]['INTERVAL']+'<\/td>';output+='<td align="center">'+this.aInterval[sId]['COUNT']+'<\/td>';output+=(this.aInterval[sId]['ACTIVE'])?'<td align="center" style="background-color:lightgreen">'+this.aInterval[sId]['ACTIVE']+'<\/td>':'<td align="center" style="background-color:red">'+this.aInterval[sId]['ACTIVE']+'<\/td>';output+=(this.aInterval[sId]['AJAX_COMPLETE'])?'<td align="center" style="background-color:lightgreen">'+this.aInterval[sId]['AJAX_COMPLETE']+'<\/td>':'<td align="center" style="background-color:red">'+this.aInterval[sId]['AJAX_COMPLETE']+'<\/td>';output+='<\/tr>';}
output+='<\/table>';jQuery('#IDMS_debug').html(output);}}
var Scheduler=SchedulerClass;Scheduler.initialize();c=new Array();c['AF']='Afghanistan';c['EG']='&Auml;gypten';c['AL']='Albanien';c['DZ']='Algerien';c['VI']='Amerik. Jungferninseln';c['AS']='Amerikanisch-Samoa';c['AD']='Andorra';c['AO']='Angola';c['AI']='Anguilla';c['AG']='Antigua und Barbuda';c['GQ']='&Auml;quatorialguinea';c['AR']='Argentinien';c['AM']='Armenien';c['AW']='Aruba';c['AZ']='Aserbaidschan';c['ET']='&Auml;thiopien';c['AU']='Australien';c['BS']='Bahamas';c['BH']='Bahrain';c['BD']='Bangladesch';c['BB']='Barbados';c['BE']='Belgien';c['BZ']='Belize';c['BJ']='Benin';c['BM']='Bermuda';c['BT']='Bhutan';c['BO']='Bolivien';c['BA']='Bosnien und Herzegowina';c['BW']='Botsuana';c['BR']='Brasilien';c['VG']='Britische Jungferninseln';c['BN']='Brunei';c['BG']='Bulgarien';c['BF']='Burkina Faso';c['BI']='Burundi';c['CL']='Chile';c['CN']='China';c['CR']='Costa Rica';c['DK']='D&auml;nemark';c['DE']='Deutschland';c['DM']='Dominica';c['DO']='Dominikanische Republik';c['DJ']='Dschibuti';c['EC']='Ecuador';c['SV']='El Salvador';c['CI']='Elfenbeink&uuml;ste';c['ER']='Eritrea';c['EE']='Estland';c['FO']='Faroer';c['FJ']='Fidschi';c['FI']='Finnland';c['FR']='Frankreich';c['GF']='Franz&ouml;sisch-Guayana';c['PF']='Franz&ouml;sisch-Polynesien';c['GA']='Gabun';c['GM']='Gambia';c['GE']='Georgien';c['GH']='Ghana';c['GI']='Gibraltar';c['GD']='Grenada';c['GR']='Griechenland';c['GL']='Gr&ouml;nland';c['GB']='Gro&szlig;britannien';c['GP']='Guadeloupe';c['GU']='Guam';c['GT']='Guatemala';c['GG']='Guernsey';c['GN']='Guinea';c['GW']='Guinea-Bissau';c['GY']='Guyana';c['HT']='Haiti';c['HN']='Honduras';c['HK']='Hong Kong';c['IN']='Indien';c['ID']='Indonesien';c['IQ']='Irak';c['IR']='Iran';c['IE']='Irland';c['IS']='Island';c['IM']='Isle of man';c['IL']='Israel';c['IT']='Italien';c['JM']='Jamaika';c['JP']='Japan';c['YE']='Jemen';c['JE']='Jersey';c['JO']='Jordanien';c['YU']='Jugoslawien, F&ouml;derative Republik';c['KY']='Kaiman Inseln';c['KH']='Kambodscha';c['CM']='Kamerun';c['CA']='Kanada';c['CV']='Kap Verde';c['KZ']='Kasachstan';c['QA']='Katar';c['KE']='Kenia';c['KG']='Kirgisistan';c['KI']='Kiribati';c['CO']='Kolumbien';c['KM']='Komoren';c['CD']='Kongo, Dem. Republik';c['CG']='Kongo, Republik';c['HR']='Kroatien';c['CU']='Kuba';c['KW']='Kuwait';c['LA']='Laos';c['LS']='Lesotho';c['LV']='Lettland';c['LB']='Libanon';c['LR']='Liberia';c['LY']='Libyen';c['LI']='Liechtenstein';c['LT']='Litauen';c['LU']='Luxemburg';c['MO']='Macao';c['MG']='Madagaskar';c['MW']='Malawi';c['MY']='Malaysia';c['MV']='Malediven';c['ML']='Mali';c['MT']='Malta';c['MP']='Mariannen';c['MA']='Marokko';c['MH']='Marshallinseln';c['MQ']='Martinique';c['MR']='Mauretanien';c['MU']='Mauritius';c['YT']='Mayotte';c['MK']='Mazedonien';c['MX']='Mexiko';c['FM']='Mikronesien';c['MD']='Moldavien';c['MC']='Monaco';c['MN']='Mongolei';c['ME']='Montenegro';c['MZ']='Mosambik';c['MM']='Myanmar';c['NA']='Namibia';c['NP']='Nepal';c['NC']='Neukaledonien';c['NZ']='Neuseeland';c['NI']='Nicaragua';c['NL']='Niederlande';c['NE']='Niger';c['NG']='Nigeria';c['AN']='NL-Antillen';c['KP']='Nordkorea';c['NO']='Norwegen';c['OM']='Oman';c['TL']='Ost Timor';c['AT']='&Ouml;sterreich';c['PK']='Pakistan';c['PW']='Palau';c['PA']='Panama';c['PG']='Papua Neuguinea';c['PY']='Paraguay';c['PE']='Peru';c['PH']='Philippinen';c['PL']='Polen';c['PT']='Portugal';c['PR']='Puerto Rico';c['RE']='R&eacute;union';c['RW']='Ruanda';c['RO']='Rum&auml;nien';c['RU']='Russland';c['EH']='Sahara Arabische Republik';c['SB']='Salomonen';c['ZM']='Sambia';c['WS']='Samoa';c['SM']='San Marino';c['ST']='S&atilde;o Tom&eacute; und Pr&iacute;ncipe';c['SA']='Saudi-Arabien';c['SE']='Schweden';c['CH']='Schweiz';c['SN']='Senegal';c['RS']='Serbien';c['CS']='Serbien und Montenegro';c['SC']='Seychellen';c['SL']='Sierra Leone';c['ZW']='Simbabwe';c['SG']='Singapur';c['SK']='Slowakische Republik';c['SI']='Slowenien';c['SO']='Somalia';c['ES']='Spanien';c['LK']='Sri Lanka';c['KN']='St. Kitts und Nevis';c['LC']='St. Lucia';c['VC']='St. Vincent / Grenadinen';c['ZA']='S&uuml;dafrika';c['SD']='Sudan';c['KR']='S&uuml;dkorea';c['SR']='Surinam';c['SZ']='Swasiland';c['SY']='Syrien';c['TJ']='Tadschikistan';c['TW']='Taiwan';c['TZ']='Tansania';c['TH']='Thailand';c['TG']='Togo';c['TO']='Tonga';c['TT']='Trinidad und Tobago';c['TD']='Tschad';c['CZ']='Tschechische Republik';c['TN']='Tunesien';c['TR']='T&uuml;rkei';c['TM']='Turkmenistan';c['TV']='Tuvalu';c['UG']='Uganda';c['UA']='Ukraine';c['HU']='Ungarn';c['UY']='Uruguay';c['US']='USA';c['UZ']='Usbekistan';c['VU']='Vanuatu';c['VE']='Venezuela';c['AE']='Ver. Arabische Emirate';c['VN']='Vietnam';c['BY']='Weissrussland';c['WG']='West Bank und Gaza';c['CF']='Zentralafrik. Rep.';c['CY']='Zypern';c['EU']='Europa';var aReturnNameFields=new Array('NAME','ID_NOTATION','ISIN');var aSearchNameFields=new Array('NAME','ISIN');if(s=='undefined'||s==null){var s=new Array();}
if(s['STO']==null)s['STO']=new Array();if(s['BON']==null)s['BON']=new Array();if(s['FUN']==null)s['FUN']=new Array();if(s['IND']==null)s['IND']=new Array();if(s['COM']==null)s['COM']=new Array();if(s['MET']==null)s['MET']=new Array();if(s['CUR']==null)s['CUR']=new Array();if(s['FUT']==null)s['FUT']=new Array();if(s['BON']==null)s['BON']=new Array();if(s['DAB']==null)s['DAB']=new Array();var aToolName=new Array();aToolName['STO']='Aktien';aToolName['IND']='Indizes';aToolName['FUN']='Fonds';aToolName['CUR']='W\u00E4hrungen';aToolName['MET']='Edelmetalle';aToolName['COM']='Rohstoffe';aToolName['FUT']='Futures';aToolName['BON']='Anleihen';aToolName['DAB']='DAB';var aTools=new Array('STO','IND','FUN','CUR','MET','COM','FUT','BON','DAB');var aToolMatches=new Array();aToolMatches['STO']=5;aToolMatches['IND']=5;aToolMatches['FUN']=5;aToolMatches['CUR']=5;aToolMatches['MET']=5;aToolMatches['COM']=5;aToolMatches['FUT']=5;aToolMatches['BON']=5;aToolMatches['DAB']=5;var isShadowEffectEnabled=true;var aNameFieldsPosition=new Array();for(i=0;i<aReturnNameFields.length;i++){aNameFieldsPosition[aReturnNameFields[i]]=0;}
function internalCallback(sCallbackValues){var aCallbackKeys=new Array();aCallbackKeys[0]='TOOL';for(m=0;m<aReturnNameFields.length;m++){aCallbackKeys[m+1]=aReturnNameFields[m];}
var aCallbackValues=sCallbackValues.split('|||');var aCallback=new Array(aCallbackKeys);for(i=0;i<aCallbackKeys.length;i++){aCallback[aCallbackKeys[i]]=aCallbackValues[i];}
SuggestCallback(aCallback);}
function Suggester(IdInputField,IdSuggestList,UrlLiveSuggest){jQuery('#'+IdInputField).autocomplete(IdSuggestList,UrlLiveSuggest,'');}
(function(jQuery){jQuery.fn.extend({autocomplete:function(IdSuggestList,UrlSuggest,options){options=jQuery.extend({},jQuery.Autocompleter.defaults,{url:UrlSuggest});return this.each(function(){new jQuery.Autocompleter(this,options);});}});jQuery.Autocompleter=function(input,options){var KEY={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};var timeout;var lastKeyPressCode;var blockSubmit;var previousValue="";var hasFocus=0;var config={mouseDownOnSelect:false};var $input=jQuery(input).attr("autocomplete","off");var select=jQuery.Autocompleter.Select(options,input,selectCurrent,config);var element=jQuery("#IDMS_autocomplete_choices").css("position","absolute").css("display","none");jQuery.browser.opera&&jQuery(input.form).bind("submit.autocomplete",function(){if(blockSubmit){blockSubmit=false;return false;}});$input.bind((jQuery.browser.opera?"keypress":"keydown")+".autocomplete",function(event){lastKeyPressCode=event.keyCode;switch(event.keyCode){case KEY.UP:case KEY.DOWN:case KEY.PAGEUP:case KEY.PAGEDOWN:case KEY.TAB:case KEY.RETURN:break;case KEY.ESC:hideResultsNow();select.hide();break;default:clearTimeout(timeout);timeout=setTimeout(onChange,options.delay);break;}}).focus(function(){hasFocus++;}).click(function(){onChange("click",true);}).blur(function(){hasFocus=0;if(!config.mouseDownOnSelect){hideResults();}});function selectCurrent(){var selected=select.selected();if(!selected)
return false;var v=selected.result;previousValue=v;hideResultsNow();$input.trigger("result",[selected.data,selected.value]);return true;}
function updateChoices(choices){if(choices.match('<li>')){onShowSuggester();jQuery('#IDMS_autocomplete_choices').html(choices);if(isShadowEffectEnabled){jQuery('#IDMS_autocomplete_choices').fadeIn("fast");jQuery("#IDMS_autocomplete_choices").redrawShadow({left:590,top:50,blur:1,color:"light-grey"});}else{jQuery('#IDMS_autocomplete_choices').show();}
var offset=$input.offset();var topFix=20;}
else{if(isShadowEffectEnabled){jQuery("#IDMS_autocomplete_choices").removeShadow();jQuery('#IDMS_autocomplete_choices').fadeOut("fast");}else{jQuery("#IDMS_autocomplete_choices").hide();}}}
function onChange(crap,skipPrevCheck){if(input.value.length==0){hideResultsNow();}
if(lastKeyPressCode==KEY.DEL){select.hide();return;}
var currentValue=$input.val();if(!skipPrevCheck&&currentValue==previousValue){return;}
previousValue=currentValue;if(currentValue.length>=options.minChars){getUpdatedChoices();}
else{select.hide();}}
function hideResults(){clearTimeout(timeout);timeout=setTimeout(hideResultsNow,200);}
function hideResultsNow(){onHideSuggester();$input.val("");if(isShadowEffectEnabled){jQuery('#IDMS_autocomplete_choices').fadeOut("fast");jQuery("#IDMS_autocomplete_choices").removeShadow();}else{jQuery("#IDMS_autocomplete_choices").hide();}
var wasVisible=select.visible();select.hide();clearTimeout(timeout);if(options.mustMatch){$input.search(function(result){if(!result){$input.val("");}});}
if(wasVisible)
jQuery.Autocompleter.Selection(input,input.value.length,input.value.length);}
function buildSuggestList(aInput){var d=new Array();for(i=0;i<aTools.length;i++){d[aTools[i]]=new Array();}
if(!(aInput==undefined)){eval(aInput);}
var aInstrument=new Array();for(i=0;i<aTools.length;i++){aInstrument[aTools[i]]=new Array();for(j=0;j<aReturnNameFields.length;j++){aInstrument[aTools[i]][aReturnNameFields[j]]=new Array();}}
var aToolMatchesFound=new Array();var iLinkNumber=0;var sSearchValue=($input.val().match(options.AllowedPattern))?$input.val().toUpperCase():'sign not allowed';var sSearchPattern=new RegExp(""+sSearchValue+"","i");var sToHighLite='';var sHightLite='';var aToolUrl=new Array();for(i=0;i<aTools.length;i++){aToolMatchesFound[aTools[i]]=0;}
for(i=0;i<aTools.length;i++){for(j=0;j<aReturnNameFields.length;j++){aNameFieldsPosition[aReturnNameFields[j]]=j;}
var iDatasetOffset=aReturnNameFields.length;var sTool=aTools[i];var iCount=(s[sTool]).length;sSearchValue=(aTranslate[sSearchValue]==undefined)?sSearchValue:aTranslate[sSearchValue];var sSearchPattern=new RegExp(""+sSearchValue+"","i");for(j=0;j<iCount;j+=iDatasetOffset){if(aToolMatchesFound[sTool]>=aToolMatches[sTool]){break;}
else{var sSearchValues='';for(m=0;m<aSearchNameFields.length;m++){sSearchValues+=s[sTool][aNameFieldsPosition[aSearchNameFields[m]]]+'{|}';}
if((sSearchValues).match(sSearchPattern)){var instrumentsAsString='{|}'+(aInstrument[sTool]['NAME']).join('{|}');var instrumentAsItem='{|}'+s[sTool][aNameFieldsPosition['NAME']];if(instrumentsAsString.indexOf(instrumentAsItem)=='-1'&&s[sTool][aNameFieldsPosition['ID_NOTATION']]!=''){for(k=0;k<aReturnNameFields.length;k++){aInstrument[sTool][aReturnNameFields[k]].push(s[sTool][aNameFieldsPosition[aReturnNameFields[k]]]);}
aToolMatchesFound[sTool]++;}}
for(k=0;k<aReturnNameFields.length;k++){aNameFieldsPosition[aReturnNameFields[k]]+=iDatasetOffset;}}}}
for(i=0;i<aTools.length;i++){for(j=0;j<aReturnNameFields.length;j++){aNameFieldsPosition[aReturnNameFields[j]]=j;}
var iDatasetOffset=aReturnNameFields.length;var sTool=aTools[i];var iCount=(d[sTool]).length;for(j=0;j<iCount;j+=iDatasetOffset){if(aToolMatchesFound[sTool]>=aToolMatches[sTool]){break;}
else{if(((aInstrument[sTool]['NAME']).join('{|}').indexOf(d[sTool][aNameFieldsPosition['NAME']]))=='-1'&&d[sTool][aNameFieldsPosition['ID_NOTATION']]!=''){for(k=0;k<aReturnNameFields.length;k++){aInstrument[sTool][aReturnNameFields[k]].push(d[sTool][aNameFieldsPosition[aReturnNameFields[k]]]);}
aToolMatchesFound[sTool]++;}}
for(k=0;k<aReturnNameFields.length;k++){aNameFieldsPosition[aReturnNameFields[k]]+=iDatasetOffset;}}}
var SuggestList='<ul>';for(i=0;i<aTools.length;i++){sTool=aTools[i];iCount=(aInstrument[sTool]["NAME"]).length;if(iCount>0){$sIeFix=(navigator.userAgent.indexOf('MSIE')!='-1')?'style="margin-top:-1px"':'';SuggestList+='<li class="IDMS_Suggestheader" '+$sIeFix+'>';SuggestList+='<span style="float: left">'+aToolName[sTool]+' ('+iCount+') </span>';if(sSearchValue.length>=3){SuggestList+="<span style=\"float: right\"><a style=\"display: inline\" href=\"javascript:SuggestCategoryCallback('"+sTool+"','"+sSearchValue+"')\">Alle Treffer</a></span>";}
SuggestList+='</li>';iLinkNumber+=1;for(j=0;j<iCount;j++){SuggestList+='<li>';sToHighLite=(aInstrument[sTool]['NAME'][j]).substr(0,32);sHightLite=sToHighLite.replace(sSearchPattern,'<b>'+sSearchValue+'</b>');var sCallbackValues=sTool;for(k=0;k<aReturnNameFields.length;k++){sCallbackValues+='|||'+aInstrument[sTool][aReturnNameFields[k]][j];}
sIsin=aInstrument[sTool]['ISIN'][j];iIdNotation=aInstrument[sTool]['ID_NOTATION'][j];sName=aInstrument[sTool]['NAME'][j];SuggestList+='<a id="link_'+iLinkNumber+'" title="'+sName+'" href="javascript:internalCallback('+"'"+sCallbackValues+"'"+')"><div class="IDMS_Suggest1Col">'+sHightLite+'</div>';sToHighLite=sIsin;sHightLite=sToHighLite.replace(sSearchPattern,'<b>'+sSearchValue+'</b>');sHightLite=(sHightLite=='')?'&nbsp;':sHightLite;if(sTool!='DAB'){SuggestList+='<div class="IDMS_Suggest2Col">'+sHightLite+'</div>';sFlagId=(sTool=='CUR')?'':(sIsin.substr(0,2));if(options.show_flags){sCountry=(c[sFlagId]==undefined)?'':c[sFlagId];sFlag='<img title="'+sCountry+'" src="'+IMG_PATH+'/flags/'+sFlagId.toLowerCase()+'_flag.gif" alt="" />';SuggestList+='<div class="IDMS_Suggest0Col">'+sFlag+'</div></a>';}}
SuggestList+='</li>';iLinkNumber+=1;}}}
SuggestList+='</ul>';updateChoices(SuggestList);if(sSearchValue=='-SHOWPANEL--'){jQuery('#IDMS_panel').show();Set_Cookie('SHOW_IDMS_PANEL','1',30,'/','','');jQuery('#SHOW_IDMS_PANEL:checkbox').val(['SHOW_IDMS_PANEL']);}}
function getUpdatedChoices(){entry=encodeURIComponent('SEARCH_VALUE')+'='+
encodeURIComponent($input.val());if($input.val().match(options.AllowedPattern)){if($input.val().length>=options.ask_backend){buildSuggestList();if(typeof(Scheduler)=='object'){if(Scheduler.aInterval['IDMS_autocomplete_choices']==undefined){var now=new Date();Scheduler.subscribe('IDMS_autocomplete_choices','load','');if(USE_XHR){document.getElementById('ifrm_ajax').contentWindow.xGet(options.url+"?"+entry,null,function(text){buildSuggestList(text);if(typeof(Scheduler)=='object'){Scheduler.unsubscribe('IDMS_autocomplete_choices');Scheduler.ajaxSnippetCallback('IDMS_autocomplete_choices');}},'html');}else{jQuery.ajax({type:"GET",url:options.url+"?"+entry,dataType:'html',success:function(text){buildSuggestList(text);if(typeof(Scheduler)=='object'){Scheduler.unsubscribe('IDMS_autocomplete_choices');Scheduler.ajaxSnippetCallback('IDMS_autocomplete_choices');}}});}}}}
else{buildSuggestList();}}}};jQuery.Autocompleter.defaults={minChars:2,ask_backend:3,delay:100,show_flags:true,max:20,mustMatch:false,selectFirst:true,width:0,AllowedPattern:/^[0-9a-zA-Z-_!\.&\u00E4\u00F6\u00FC\u00C4\u00D6\u00DC\u00DF\s]{0,30}$/,highlight:function(value,term){var sSearchValue=(term.match(options.AllowedPattern))?term.toUpperCase():'sign not allowed';var sSearchPattern=new RegExp(""+term+"","i");var sToHighLite='';var sHightLite='';sToHighLite=value.substr(0,19);sHightLite=sToHighLite.replace(sSearchPattern,'<b>'+sSearchValue+'</b>');return sHightLite;},scroll:false,scrollHeight:180};jQuery.Autocompleter.Select=function(options,input,select,config){var CLASSES={ACTIVE:"ac_over"};var listItems,active=-1,data,term="",element,list;return{display:function(d,q){init();data=d;term=q;},next:function(){moveSelect(1);},prev:function(){moveSelect(-1);},pageUp:function(){if(active!=0&&active-8<0){moveSelect(-active);}else{moveSelect(-8);}},pageDown:function(){if(active!=listItems.size()-1&&active+8>listItems.size()){moveSelect(listItems.size()-1-active);}else{moveSelect(8);}},hide:function(){element&&element.hide();listItems&&listItems.removeClass(CLASSES.ACTIVE);active=-1;},visible:function(){return element&&element.is(":visible");},current:function(){return this.visible()&&(listItems.filter("."+CLASSES.ACTIVE)[0]||options.selectFirst&&listItems[0]);},show:function(){var offset=jQuery(input).offset();element.css({width:typeof options.width=="string"||options.width>0?options.width:jQuery(input).width(),top:offset.top+input.offsetHeight,left:offset.left}).show();if(options.scroll){list.scrollTop(0);list.css({maxHeight:options.scrollHeight,overflow:'auto'});if(jQuery.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var listHeight=0;listItems.each(function(){listHeight+=this.offsetHeight;});var scrollbarsVisible=listHeight>options.scrollHeight;list.css('height',scrollbarsVisible?options.scrollHeight:listHeight);if(!scrollbarsVisible){listItems.width(list.width()-parseInt(listItems.css("padding-left"))-parseInt(listItems.css("padding-right")));}}}}};}
jQuery.Autocompleter.Selection=function(field,start,end){if(field.createTextRange){var selRange=field.createTextRange();selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select();}else if(field.setSelectionRange){field.setSelectionRange(start,end);}else{if(field.selectionStart){field.selectionStart=start;field.selectionEnd=end;}}
field.focus();}})(jQuery);