var aryTabbedTable = new Array (); aryTabbedTable[ 'table-id' ] = 'item-list'; aryTabbedTable[ 'head-row-pattern' ] = 'category'; aryTabbedTable[ 'content-row-pattern' ] = 'categorygroup'; aryTabbedTable[ 'content-row-pattern-active' ] = 'active-row'; aryTabbedTable[ 'content-row-pattern-inactive' ] = 'inactive-row'; aryTabbedTable[ 'switcher-pattern' ] = 'switchvisibility'; aryTabbedTable[ 'switcher-pattern-img' ] = 'switchvisibilityimg'; aryTabbedTable[ 'switcher-pattern-txt' ] = 'switchvisibilitytxt'; aryTabbedTable[ 'switcher-pattern-row' ] = 'switchvisibilityrow'; aryTabbedTable[ 'txt-hide' ] = 'Artikel verstecken'; aryTabbedTable[ 'txt-show' ] = 'Artikel anzeigen'; aryTabbedTable[ 'pattern-head' ] = 'head'; aryTabbedTable[ 'img-i' ] = '/pics/publikationsbestellung/ic_arrow_i_01.gif'; aryTabbedTable[ 'img-a' ] = '/pics/publikationsbestellung/ic_arrow_a_01.gif'; $(document).ready(function(){ getTabbedTable ( aryTabbedTable ); }); function checkDisplayPurpose(item) { item = parseInt(item); if(document.getElementById('item-'+item).value > 0) { document.getElementById('purpose-p-'+item).style.visibility = "visible"; document.getElementById('purpose-p-'+item).style.display = "block"; } else { document.getElementById('purpose-p-'+item).style.visibility = "hidden"; document.getElementById('purpose-p-'+item).style.display = "none"; document.getElementById('purpose-'+item).value = ""; document.getElementById('item-'+item).value = 0; } } function getTabbedTable ( aryTabbedTable ) { if ( document.getElementById ( aryTabbedTable[ 'table-id' ] ) ) { addTabbedTableSwitchClick ( aryTabbedTable[ 'table-id' ], aryTabbedTable[ 'switcher-pattern' ] ); switchVisibilityTabbedTablesAll ( aryTabbedTable[ 'table-id' ], aryTabbedTable[ 'switcher-pattern' ] ); } } function addTabbedTableSwitchClick ( strTableId, strSwitcherPattern ) { var objTableRows = document.getElementById ( strTableId ).getElementsByTagName( 'tr' ); for ( var i = 0; i < objTableRows.length; i++ ) { if ( objTableRows[ i ].className == aryTabbedTable[ 'pattern-head' ] ) { objSwitcher = objTableRows[ i ].getElementsByTagName ( 'span' ); if ( objSwitcher[ 2 ].id ) { aryIdPatternCheck = objSwitcher[ 2 ].id.split("-"); if ( aryIdPatternCheck[ 0 ] == strSwitcherPattern ) { intCategoryId = aryIdPatternCheck[1]; document.getElementById ( aryTabbedTable[ 'switcher-pattern-row' ]+'-'+intCategoryId ).onclick = function() { aryCategoryId = this.id.split('-'); intCategoryId = aryCategoryId[ 1 ]; switchVisibilityTabbedTablesRow ( intCategoryId , strTableId, strSwitcherPattern ); } } } } } } function switchVisibilityTabbedTablesRow ( intCategoryId, strTableId, strSwitcherPattern ) { if(intCategoryId > 0) { var objTableRows = document.getElementById ( strTableId ).getElementsByTagName( 'tr' ); for ( var i = 0; i < objTableRows.length; i++ ) { aryClassName = objTableRows[ i ].className.split(' '); if ( aryClassName[0] == aryTabbedTable[ 'content-row-pattern' ]+'-'+intCategoryId ) { if ( !aryClassName[1] || aryClassName[1] == aryTabbedTable[ 'content-row-pattern-active' ] ) { document.getElementById ( aryTabbedTable[ 'switcher-pattern-img' ]+'-'+intCategoryId ).src = aryTabbedTable[ 'img-i' ]; document.getElementById ( aryTabbedTable[ 'switcher-pattern-row' ]+'-'+intCategoryId ).title = aryTabbedTable[ 'txt-show' ]; document.getElementById ( strSwitcherPattern+'-'+intCategoryId ).innerHTML = aryTabbedTable[ 'txt-show' ]; objTableRows[ i ].className = aryTabbedTable[ 'content-row-pattern' ]+'-'+intCategoryId+' '+aryTabbedTable[ 'content-row-pattern-inactive' ]; } else { document.getElementById ( aryTabbedTable[ 'switcher-pattern-img' ]+'-'+intCategoryId ).src = aryTabbedTable[ 'img-a' ]; document.getElementById ( aryTabbedTable[ 'switcher-pattern-row' ]+'-'+intCategoryId ).title = aryTabbedTable[ 'txt-hide' ]; document.getElementById ( strSwitcherPattern+'-'+intCategoryId ).innerHTML = aryTabbedTable[ 'txt-hide' ]; objTableRows[ i ].className = aryTabbedTable[ 'content-row-pattern' ]+'-'+intCategoryId+' '+aryTabbedTable[ 'content-row-pattern-active' ]; } } } } } function switchVisibilityTabbedTablesAll ( strTableId, strSwitcherPattern ) { var objTableRows = document.getElementById ( strTableId ).getElementsByTagName( 'tr' ); var arySwitcher = new Array(); x = 0; for ( var i = 0; i < objTableRows.length; i++ ) { if ( objTableRows[ i ].className == aryTabbedTable[ 'pattern-head' ] ) { objSwitcher = objTableRows[ i ].getElementsByTagName ( 'span' ); objNoswitchCheck = objTableRows[ i ].getElementsByTagName ( 'td' ); aryNoswitchChecker = objNoswitchCheck [ 0 ].className.split(' '); if ( objSwitcher[ 2 ].id && aryNoswitchChecker[ 2 ] != 'noswitch' ) { aryIdPatternCheck = objSwitcher[ 2 ].id.split("-"); arySwitcher[ x ] = aryIdPatternCheck[ 1 ]; x++; } } } for ( var x = 0; x < arySwitcher.length; x++ ) { switchVisibilityTabbedTablesRow ( arySwitcher[ x ], strTableId, strSwitcherPattern ); } } // strSeite = Seite, die im Popup geöffnet werden soll (Integer) // intBreite = Breite des Fensters in Pixeln (Integer) // intHoehe = Höhe des Fensters in Pixeln (Integer) // strName = Fenstername des Poups (String) // strScrollbars = Scroll-Balken anzeigen (String: 'yes'/'no') // Beispiel: openPopup('/de/index.html', 500, 300, 'Startseite', 'yes'); function openPopup (strSeite, intBreite, intHoehe, strName, strScrollbars) { var intScreenWidth = screen.width; var intScreenHeight = screen.height; var intPosX = (intScreenWidth / 2) - (intBreite / 2); var intPosY = (intScreenHeight / 2) - (intHoehe / 2); // In der open()-Funktion dürfen keine Leerstellen verwendet // werden, da sonst bei einigen Browsern eine korrekte // Darstellung verhindert wird. winPopup = window.open(strSeite,strName,'width='+ intBreite +',height='+ intHoehe +',left='+ intPosX +',screenX='+ intPosX +',top='+ intPosY +',screenY='+ intPosY +',menubar=no,scrollbars='+ strScrollbars +',resizable=no,location=no,status=no,directories=no,dependent'); winPopup.focus(); }