function getParameter ( queryString, parameterName ) { // Add "=" to the parameter name (i.e. parameterName=value) var parameterName = parameterName + "="; if ( queryString.length > 0 ) { // Find the beginning of the string begin = queryString.indexOf ( parameterName ); // If the parameter name is not found, skip it, otherwise return the value if ( begin != -1 ) { // Add the length (integer) to the beginning begin += parameterName.length; // Multiple parameters are separated by the "&" sign end = queryString.indexOf ( "&" , begin ); if ( end == -1 ) { end = queryString.length } // Return the string return unescape ( queryString.substring ( begin, end ) ); } // Return "null" if no parameter has been found return "null"; } } // FUNCTION FOR EXPANDING or COLLAPSING ANY SINGLE WIDGET function toggleWidget(WidgetID,Action) { if(Action=='open') { document.getElementById(WidgetID).style.display='block'; document.getElementById(WidgetID+'-hide').style.display='block'; document.getElementById(WidgetID+'-show').style.display='none'; //var Col1Div=document.getElementById('leftcol'); //var Col2Div=document.getElementById('contentcol'); //alert('open, ' + Col1Div.offsetHeight + ', ' + Col2Div.offsetHeight); document.getElementById('contentcol').style.height='100%'; adjustColHeight('leftcol','contentcol',45); //alert('open, ' + Col1Div.offsetHeight + ', ' + Col2Div.offsetHeight); } else { document.getElementById(WidgetID).style.display='none'; document.getElementById(WidgetID+'-show').style.display='block'; document.getElementById(WidgetID+'-hide').style.display='none'; //alert('widget ' + Col1Div.offsetHeight + ', ' + Col2Div.offsetHeight); document.getElementById('contentcol').style.height='100%'; adjustColHeight('leftcol','contentcol',45); //alert('widget ' + Col1Div.offsetHeight + ', ' + Col2Div.offsetHeight); } } // END // FUNCTIONS FOR EXPANDING/COLLAPSING TITLE LISTS ON HOME/CATEGORY/MY SWC PAGES function initializeTabs () { openLists = "null" if (top.location) if(top.location.search) { // Open each list that is specified in the query string QueryString=top.location.search.toString(); openLists = getParameter(QueryString, 'openLists'); } if (openLists != "null") { divider="," openListNames=openLists.split(divider); for (i = 0; i < openListNames.length; i++) { toggleTitleList(openListNames[i],''); } } else { toggleTitleList('bestsellers',''); toggleTitleList('premiertitles',''); } } counter=0 tabcounter=0 function toggleTitleList(ListName,Option) { listID=ListName+'list'; if (document.getElementById(listID) != null) { if(Option=='open') { if(counter==0) { document.getElementById(listID).style.display='block'; counter=1; } else { } } if(Option=='otherlink') { if(document.getElementById(listID).style.display=='block') { } else { document.getElementById(listID).style.display='block'; document.getElementById(ListName+'-show').style.display='none'; document.getElementById(ListName+'-hide').style.display='block'; //var Col1Div=document.getElementById('leftcol'); //var Col2Div=document.getElementById('contentcol'); //alert('TitleList ' + Col1Div.offsetHeight + ', ' + Col2Div.offsetHeight); document.getElementById('contentcol').style.height='100%'; adjustColHeight('leftcol','contentcol',45); //alert('TitleList ' + Col1Div.offsetHeight + ', ' + Col2Div.offsetHeight); } } else { if(document.getElementById(listID).style.display=='block') { document.getElementById(listID).style.display='none'; document.getElementById(ListName+'-hide').style.display='none'; document.getElementById(ListName+'-show').style.display='block'; document.getElementById('contentcol').style.height='100%'; adjustColHeight('leftcol','contentcol',45); } else { document.getElementById(listID).style.display='block'; document.getElementById(ListName+'-show').style.display='none'; document.getElementById(ListName+'-hide').style.display='block'; document.getElementById('contentcol').style.height='100%'; adjustColHeight('leftcol','contentcol',45); } } tabcounter=0; for (x = 0; x < ListNames.length; x++) { var list = document.getElementById(ListNames[x]+'list'); if(list != null && list.style.display=='none') { tabcounter++; } else { if(list != null && list.style.display=='') { tabcounter++; } else { } } } if(tabcounter==ListNames.length) { for (x = 0; x < ListNames.length; x++) { var all_show = document.getElementById(ListNames[x]+'-all-show'); var all_hide = document.getElementById(ListNames[x]+'-all-hide'); if (all_show != null) { all_show.style.display='block'; } if (all_hide != null) { all_hide.style.display='none'; } } } else { } tabcounter=0; for (x = 0; x < ListNames.length; x++) { var list = document.getElementById(ListNames[x]+'list'); if(list != null && list.style.display=='block') { tabcounter++; } else { } } if(tabcounter==ListNames.length) { for (x = 0; x < ListNames.length; x++) { var all_show = document.getElementById(ListNames[x]+'-all-show'); var all_hide = document.getElementById(ListNames[x]+'-all-hide'); if (all_show != null) { all_show.style.display='none'; } if (all_hide != null) { all_hide.style.display='block'; } } } else { } } } function expandAllTabs() { for (x = 0; x < ListNames.length; x++) { var list = document.getElementById(ListNames[x]+'list'); if (list != null) { list.style.display='block'; document.getElementById(ListNames[x]+'-show').style.display='none'; document.getElementById(ListNames[x]+'-hide').style.display='block'; document.getElementById(ListNames[x]+'-all-show').style.display='none'; document.getElementById(ListNames[x]+'-all-hide').style.display='block'; } } document.getElementById('contentcol').style.height='100%'; adjustColHeight('leftcol','contentcol',45); } function collapseAllTabs() { counter=1; for (x = 0; x < ListNames.length; x++) { var list = document.getElementById(ListNames[x]+'list'); if (list != null) { list.style.display='none'; document.getElementById(ListNames[x]+'-hide').style.display='none'; document.getElementById(ListNames[x]+'-show').style.display='block'; document.getElementById(ListNames[x]+'-all-show').style.display='block'; document.getElementById(ListNames[x]+'-all-hide').style.display='none'; } } document.getElementById('contentcol').style.height='100%'; adjustColHeight('leftcol','contentcol',45); } function collapseAllHelps() { for (x = 0; x < HelpNames.length; x++) { document.getElementById(HelpNames[x]+'help').style.display='none'; document.getElementById(HelpNames[x]+'help-hide').style.display='none'; document.getElementById(HelpNames[x]+'help-show').style.display='block'; } } // END // FUNCTIONS FOR EXPANDING/COLLAPSING THE MENU ITEMS IN THE BROWSE BY CATEGORY WIDGET function toggleCatList(ListName,Status) { listID=ListName+'list'; if(Status=='open') { if(counter==0) { document.getElementById(listID).style.display='block'; counter=1 } else { } } if(document.getElementById(listID).style.display=='block') { document.getElementById(listID).style.display='none'; document.images[ListName].src='/us/html/images/shared/expand.gif'; document.getElementById('contentcol').style.height='100%'; adjustColHeight('leftcol','contentcol',45); } else { document.getElementById(listID).style.display='block'; document.images[ListName].src='/us/html/images/shared/collapse.gif'; document.getElementById('contentcol').style.height='100%'; adjustColHeight('leftcol','contentcol',45); } } var MenuImageName = new Array( "Games" , "Business and Professional" , "Personal Productivity" , "Tools and Utilities" , "Travel" , "Medical" , "Finance" , "Entertainment" , "Education/References" ); var MenuImageName = new Array( "Wirtschaft und Fachwesen" , "Werkzeuge und Hilfsprogramme" , "Finanzwesen" , "Spiele" , "Unterhaltung" , "Medizin" , "Persönliche Produktivität" , "Reisen" , "Ausbildung/Referenzen" ); function expandAllCats() { document.getElementById('menuhide').style.display='block'; document.getElementById('menushow').style.display='none'; document.getElementById('menuhidebtm').style.display='block'; document.getElementById('menushowbtm').style.display='none'; for (x = 0; x < MenuImageName.length; x++) { document.images[MenuImageName[x]].src='/us/html/images/shared/collapse.gif'; document.getElementById(MenuImageName[x]+'list').style.display="block"; } document.getElementById('contentcol').style.height='100%'; adjustColHeight('leftcol','contentcol',45); } function collapseAllCats() { counter=1; document.getElementById('menuhide').style.display='none'; document.getElementById('menushow').style.display='block'; document.getElementById('menuhidebtm').style.display='none'; document.getElementById('menushowbtm').style.display='block'; for (x = 0; x < MenuImageName.length; x++) { document.images[MenuImageName[x]].src='/us/html/images/shared/expand.gif'; document.getElementById(MenuImageName[x]+'list').style.display="none"; } document.getElementById('contentcol').style.height='100%'; adjustColHeight('leftcol','contentcol',45); } // END //preferred for "image" rollovers /* Standards Compliant Rollover Script Author : Daniel Nolan http://www.bleedingego.co.uk/webdev.php */ function initRollovers() { if (!document.getElementById) return var aPreLoad = new Array(); var sTempSrc; var aImages = document.getElementsByTagName('img'); for (var i = 0; i < aImages.length; i++) { if (aImages[i].className == 'imgover') { var src = aImages[i].getAttribute('src'); var ftype = src.substring(src.lastIndexOf('.'), src.length); var hsrc = src.replace(ftype, '_over'+ftype); aImages[i].setAttribute('hsrc', hsrc); aPreLoad[i] = new Image(); aPreLoad[i].src = hsrc; aImages[i].onmouseover = function() { sTempSrc = this.getAttribute('src'); this.setAttribute('src', this.getAttribute('hsrc')); } aImages[i].onmouseout = function() { if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_over'+ftype, ftype); this.setAttribute('src', sTempSrc); } } else if (aImages[i].className == 'screen100') { aImages[i].onmouseover = function() { this.className='screen160'; } aImages[i].onmouseout = function() { this.className='screen100'; } } } } window.onload = initRollovers; // END // FUNCTION FOR OPENING URL IN A PARENT WINDOW FROM A CHILD POPUP WINDOW function OpenInParentWindow(ExtURL,CloseChild) { if (!top) return true; if(window.opener == null) { window.open(ExtURL,"") } else { window.opener.focus(); window.opener.location=ExtURL; } if (CloseChild=='close') { window.close(); } } // END // FUNCTION FOR OPENING POPUP WINDOW // always include a value for "winname" - this ensures that only content designed for that popup loads in the window function NewNamedWindow(pageurl,winname,wide,tall,scroll) { window.open(pageurl,winname,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=" + scroll + ",resizable=yes,width=" + wide + ",height=" + tall + ",left=25,top=25"); } // END // FUNCTION FOR OPENING POPUP WINDOW // always include a value for "winname" - this ensures that only content designed for that popup loads in the window function NewNamedWindowNoResize(pageurl,winname,wide,tall,scroll) { window.open(pageurl,winname,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=" + scroll + ",resizable=0,width=" + wide + ",height=" + tall + ",left=25,top=25"); } // END // FUNCTIONS FOR NAVIGATING TO URL IN PARENT WINDOW FROM FORM SELECTION IN POPUP FormSelectValue='' function SelectVariable (whichItem) { var whichDest = whichItem[whichItem.selectedIndex].value; if (whichDest == "") { whichItem.selectedIndex = 0; } else { FormSelectValue = whichDest; } } function ForwardToSelectedURL (errormsg) { if(FormSelectValue=='') { window.alert(errormsg) } else { OpenInParentWindow(FormSelectValue,'close') } } // END // FUNCTIONS FOR SUBMITTING FORMS USING ENTER function submitenter(myfield,e) { var keycode; if (window.event) keycode = window.event.keyCode; else if (e) keycode = e.which; else return true; //alert(navigator.appName); if (keycode == 13 && navigator.appName == "Microsoft Internet Explorer") { myfield.form.submit(); return false; } else return true; } // END // FUNCTION FOR ENLARGING THE ON-SCREEN SIZE OF AN IMAGE ImageID='' Factor='' function EnlargeImage(ID,MultiValue,Width,Height,ImageTop) { DivID=ID; ImageID=ID+'-img'; Multiplier=MultiValue; ImageWidth=document.getElementById(ImageID).offsetWidth; ImageHeight=document.getElementById(ImageID).offsetHeight; if(document.getElementById(DivID+'-shadow')) { document.getElementById(ImageID).style.top=ImageTop+'em'; document.getElementById(DivID+'-shadow').style.backgroundColor='transparent'; } else { document.getElementById(DivID).style.zIndex='10'; } WidthAdj=(Width*10)/ImageWidth; OriginalWidth=ImageWidth*WidthAdj/10+'em'; OriginalHeight=ImageHeight*WidthAdj/10+'em'; document.getElementById(ImageID).style.width=ImageWidth*Multiplier+'px'; document.getElementById(ImageID).style.height=ImageHeight*Multiplier+'px'; } function ReduceImage() { document.getElementById(ImageID).style.width=OriginalWidth; document.getElementById(ImageID).style.height=OriginalHeight; if(document.getElementById(DivID+'-shadow')) { document.getElementById(ImageID).style.top='0'; document.getElementById(DivID+'-shadow').style.backgroundColor='#b4b4b4'; } else { document.getElementById(DivID).style.zIndex='1'; } } // END //FUNCTION FOR DYNAMICALLY BALANCING HEIGHTS OF TWO DIVS // AddCol1 and AddCol2 values will add their specified value to the height of their respective Columns/Divs function balanceColHeights(Col1,Col2,AddCol1,AddCol2) { Col1Div=document.getElementById(Col1); Col2Div=document.getElementById(Col2); //alert('balanceHeights: ' + Col1Div.offsetHeight + ', ' + Col2Div.offsetHeight); if (Col1Div.offsetHeight > Col2Div.offsetHeight) { Col2Div.style.height = Col1Div.offsetHeight + AddCol2 + 'px'; } else { Col1Div.style.height = Col2Div.offsetHeight + AddCol1 + 'px'; } //alert('balanceHeights: ' + Col1Div.offsetHeight + ', ' + Col2Div.offsetHeight); } //END //FUNCTION FOR ADJUSTING HEIGHT OF ONE DIV TO AT LEAST THE SAME HEIGHT AS ANOTHER // AddCol values will add the specified value to the height of the Column/Div to be balanced function adjustColHeight(Col1,Col2,AddCol) { Col1Div=document.getElementById(Col1); Col2Div=document.getElementById(Col2); //alert('adjustHeight: ' + Col1Div.offsetHeight + ', ' + Col2Div.offsetHeight); if (Col2Div.offsetHeight > Col1Div.offsetHeight + AddCol) { } else { Col2Div.style.height = Col1Div.offsetHeight + AddCol + 'px'; } //alert('adjustHeight: ' + Col1Div.offsetHeight + ', ' + Col2Div.offsetHeight); } //END