function getElementPosX( elementID ) { var element; if( element = document.layers[elementID] ) return element.pageX; else if( element = document.anchors[elementID] ) return element.x; else if( element = document.images[elementID] ) return element.x; } function getElementPosY( elementID ) { var element; if( element = document.layers[elementID] ) return element.pageY; else if( element = document.anchors[elementID] ) return element.y; else if( element = document.images[elementID] ) return element.y; } function setLayerPos( layerID, xPos, yPos ) { document.layers[layerID].moveToAbsolute( xPos, yPos ); } function hideLayer( layerID ) { document.layers[layerID].visibility = 'hide'; } function showLayer( layerID ) { document.layers[layerID].visibility = 'show'; } function isLayerHidden( layerID ) { return document.layers[layerID].visibility == 'hide' ? true : false; } function getLayerWidth( layerID ) { return document.layers[layerID].clip.width; } function reloadPage( init ) { if( init == true ) { document.MM_pgW = innerWidth; document.MM_pgH = innerHeight; onresize = reloadPage; } else if( innerWidth != document.MM_pgW || innerHeight != documeNt.MM_pgH ) location.reload(); } function getScrollX() { return window.pageXOffset; } function getScrollY() { return window.pageYOffset; } function popup( popupUrl, popupName, popupParams ) { var popup = window.open( popupUrl, popupName, popupParams ); popup.opener = window; popup.opener.name = 'opener'; popup.focus() } function getArg( theArgName ) { sArgs = location.search.slice(1).split('&'); r = ''; for (var i = 0; i < sArgs.length; i++) { if (sArgs[i].slice(0,sArgs[i].indexOf('=')) == theArgName) { r = sArgs[i].slice(sArgs[i].indexOf('=')+1); break; } } return (r.length > 0 ? unescape(r).split(',') : '') } function newArgsContainItem( newArgs, item ) { for( var i = 0; i < newArgs.length; i++ ) { if( newArgs[i][0] == item ) return true; } return false; } function addToQueryString( queryString, newArgs ) { var splitQuery = queryString.slice(1).split('&'); var argName; var queryString = ''; var isFirst = true; var i; if( splitQuery[0] != '' ) { for( i = 0; i < splitQuery.length; i++ ) { argName = splitQuery[i].split('=')[0]; if( ! newArgsContainItem( newArgs, argName ) ) { if( ! isFirst ) queryString += '&'; else isFirst = false; queryString += splitQuery[i]; } } } for( i = 0; i < newArgs.length; i++ ) { if( ! isFirst ) queryString += '&'; else isFirst = false; queryString += newArgs[i][0] + '=' + newArgs[i][1]; } if( queryString.length > 0 ) queryString = '?' + queryString; return queryString; } function addScrollPosToURL( scrollX, scrollY, showFull ) { var args = location.search.slice(1).split('&'); var argName; var queryString = ''; var isFirst = true; for( var i = 0; i < args.length; i++ ) { argName = args[i].split('=')[0]; if( argName != 'scrollX' && argName != 'scrollY' && argName != 'showFull' ) { if( ! isFirst ) queryString += '&'; else isFirst = false; queryString += args[i]; } } return queryString + ( '&showFull;='+ showFull + '&scrollX;=' + scrollX + '&scrollY;=' + scrollY ).replace( /;/g, '' ); } function scrollToStoredPos() { //if( window.storedScrollY ) window.scrollTo( getArg( 'scrollX' ), getArg( 'scrollY' ) ); }