/****************************************
|
| A-Line / Muru
| http://www.a-linetool.com
|
| Created by: Kevin Biskaborn
| Copyright 2010 ScriptReaction
| http://www.scriptreaction.com
|
*****************************************
| Load Dependencies : None
| Run Dependencies : None
****************************************/
var Global = {
includePrefix: "",
controls: {
allowImageAltStripping: true
},
preload: function (){
this.addEvent( window, "load", this.postload );
},
postload: function (){
Global.format.pageImages();
FlashFilter.delayGetPrompt();
},
exists: function ( object ){
return ( typeof( object ) == "undefined" ) ? false : true;
},
addEvent: function ( object, eventType, functionName ){
if( object.addEventListener ){
object.addEventListener( eventType, functionName, false );
return true;
}
else if( object.attachEvent )
return object.attachEvent( "on" + eventType, functionName );
else
return false;
},
attach: {
cssLink: function ( fileId ){
output = "";
output += "";
this.toDoc( output );
},
jsLink: function ( fileId ){
output = "";
output += "";
this.toDoc( output );
},
toDoc: function ( output ){
document.writeln( output );
}
},
format: {
pageImages: function (){
if( Global.exists( BrowserDetector ) && BrowserDetector.isIE() ){
var imageArray = document.images;
var whichImage;
for( var i = 0; i < imageArray.length; i++ ){
whichImage = imageArray[ i ];
whichImage.galleryimg = "no";
if( Global.controls.allowImageAltStripping )
whichImage.alt = "";
}
}
}
},
display: {
goTop: function (){
var y1=y2=y3=0;if(document.documentElement){y1=document.documentElement.scrollTop||0;};if(document.body){y2=document.body.scrollTop||0;};
y3=window.scrollY||0;var y=Math.max(y1,Math.max(y2,y3));window.scrollTo(0,Math.floor(y/1.4));if(y>0){window.setTimeout("Global.display.goTop()",25);};
},
comingSoonMsg: function (){
var output = "";
output += "A-LineTool.com\n";
output += "-------------------\n";
output += "*** Content Not Yet Available ***\n\n";
output += "Please check again soon.\n\n";
output += "We apologize for any inconvinience.\nWe are developing our site to serve you better.\n\n";
output += "- the A-Line/Muru Team";
alert( output );
}
},
modify: {
setDivContent: function ( divId, content ){
if( document.all )
this.divContent( document.all[ divId ], content );
else
this.divContent( document.getElementById( divId ), content );
},
divContent: function ( div, content ){
if( div )
div.innerHTML = content;
},
setAlpha: function ( object, opacity ){
opacity = ( opacity == 100 ) ? 99.999 : opacity;
object.style.filter = "alpha(opacity:" + opacity + ")"; //ie/win
object.style.KHTMLOpacity = opacity/100; //safari<1.2,konqueror
object.style.MozOpacity = opacity/100; //older mozilla/firefox
object.style.opacity = opacity/100; //safari 1.2,newer firefox/mozilla,css3
}
},
email: {
count: 0,
attach: function ( requestObj ){
var output = "";
var address = this.build( requestObj );
if( address ){
output += "";
output += "";
output += address + "";
}
if( output )
Global.attach.toDoc( output );
},
build: function ( requestObj ){
var output = null;
// specify the data prefix
// this is appended before ALL field values and must be stripped
var dataPrefix = "a-line";
var prefixLength = dataPrefix.length;
var domain = ( typeof( requestObj.d ) == "undefined" ) ? null : requestObj.d.slice( prefixLength );
var ext = ( typeof( requestObj.e ) == "undefined" ) ? "com" : requestObj.e.slice( prefixLength );
var user = ( typeof( requestObj.u ) == "undefined" ) ? null : requestObj.u.slice( prefixLength );
if( domain && user )
this[ "emailObj_" + ++this.count ] = output = user + "@" + domain + "." + ext;
return output;
},
execute: function (){
var id = parseInt( arguments[ 0 ] );
if( id && id > 0 && this[ "emailObj_" + id ] )
top.location.href = "mailto:" + this[ "emailObj_" + id ];
}
}
}
/******** GLOBAL LAUNCH ********/
Global.preload();
/****************************************
|
| A-Line / Muru
| http://www.a-linetool.com
|
| Created by: Kevin Biskaborn
| Copyright 2010 ScriptReaction
| http://www.scriptreaction.com
|
****************************************/
var JS_Format = {
array: {
itemExistsInArray: function ( needle, haystackArray ){
var output = false;
for( var i = 0; i < haystackArray.length; i++ ){
if( haystackArray[ i ] == needle ){
output = true;
break;
}
}
return output;
},
unique: {
//accepts object arrays by reference
//otherwise, use: myArray = addItem( newItem, myArray );
addItem: function ( itemToAdd, haystackArray ){
if( !JS_Format.array.itemExistsInArray( itemToAdd, haystackArray ) )
haystackArray.push( itemToAdd );
return haystackArray;
},
removeItem: function ( itemToRemove, haystackArray ){
for( var i = 0; i < haystackArray.length; i++ ){
if( haystackArray[ i ] == itemToRemove ){
haystackArray.splice( i, 1 );
break;
}
}
return haystackArray;
}
},
clear: function ( inputArray ){
return inputArray.splice( 0, inputArray.length );
},
shuffle: function ( inputArray ){
var output = new Array();
var index;
// continue extracting items while the array has more to give
while( inputArray.length > 0 ){
// get the next index to be extracted
index = JS_Format.number.randomize.fromZero( inputArray.length );
// add the element at that index to the output
output.push( inputArray[ index ] );
// remove the element from the array
inputArray.splice( index, 1 );
}
return output;
},
strip: {
lastElementIfEmpty:function ( inputArray ){
// get the last index in the array
var lastIndex = inputArray.length - 1;
// get the last element in the array
var lastElement = inputArray[ lastIndex ];
// determine if the element is empty
if( lastElement == "" || lastElement == null )
// remove the last element
inputArray.splice( lastIndex, 1 );
return inputArray;
}
}
},
string: {
trim: {
doubleSpace: function ( str ){
return str.replace( /\s\s/, " " );
},
left: function ( str ){
return str.replace( /^\s+/, "" );
},
right: function ( str ){
return str.replace( /\s+$/, "" );
},
full: function ( str ){
return this.right( this.left( str ) );
}
},
strip: {
htmlTags: function ( inputString ){
return inputString.replace( /(<([^>]+)>)/ig, "" );
}
},
condition: {
beginsWith: function ( inputString, prefix ){
if( inputString.substring( 0, prefix.length ) == prefix )
return true;
else
return false;
},
endsWith: function ( inputString, suffix ){
if( inputString.substring( inputString.length - suffix.length, inputString.length ) == suffix )
return true;
else
return false;
}
},
remove: {
prefix: function ( inputString, prefix ){
if( JS_Format.string.condition.beginsWith( inputString, prefix ) )
return inputString.substring( prefix.length, inputString.length );
else
return inputString;
},
suffix: function ( inputString, suffix ){
if( JS_Format.string.condition.endsWith( inputString, suffix ) )
return inputString.substring( 0, inputString.length - suffix.length );
else
return inputString;
}
},
parseQueryStringToObject: function ( queryString ){
var output = new Object();
//remove the leading query string char
queryString = JS_Format.string.remove.prefix( queryString, "?" );
//remove the trailing query string char
queryString = JS_Format.string.remove.suffix( queryString, "&" );
//split the query string
//into individual data items
var dataItemArray = queryString.split( "&" );
//create variable containers
var dataItem = "";
var itemArray = Array();
//cycle through all data items
for( var i = 0; i < dataItemArray.length; i++ ){
dataItem = dataItemArray[ i ];
//split the data item
//into id and value pairs
itemArray = dataItem.split( "=" );
//add the item to the output
output[ itemArray[ 0 ] ] = itemArray[ 1 ];
}
return output;
},
parseSpanClassTags: function ( inputString ){
return JS_Format.string.parseClassTags( inputString, "span" );
},
parseClassTags: function ( inputString, tagName ){
var output = "";
// specify the separation delimiters
var delimStart = "%%=";
var delimEnd = "%%;"
// split the input string on all end delimiters
// sample elements at this point: className=value
var arrayOfEntries = inputString.split( delimEnd );
// check if the last element is empty
arrayOfEntries = JS_Format.array.strip.lastElementIfEmpty( arrayOfEntries );
// create loop containers
var entry, pairArray, nameOfClass, tagContents;
// cycle through all the entries
for( var i = 0; i < arrayOfEntries.length; i++ ){
// get the next entry
entry = arrayOfEntries[ i ];
// split he entry into a class/value pair
pairArray = entry.split( delimStart );
// extract pair values
nameOfClass = pairArray[ 0 ];
tagContents = pairArray[ 1 ];
// buld the tag
// and add it to the output stream
output += "<" + tagName + " class=\"" + nameOfClass + "\">";
output += tagContents;
output += "" + tagName + ">";
}
return output;
}
},
number: {
padding: {
prefix_zero: function ( inputNumber, size ){
return this.prefix( inputNumber.toString(), "0", size );
},
prefix: function ( numberString, padCharString, size ){
while( numberString.length < size )
numberString = padCharString + numberString;
return numberString;
}
},
randomize: {
fromOneToMax: function ( maximum ){
this.fromZero( maximum ) + 1;
},
fromZero: function ( maximum ){
return Math.floor( Math.random() * maximum );
}
}
},
date: {
monthCodeArrays: {
code3_short: Array( "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec" )
}
},
elementClass: {
addToElement: function ( elementObject, classToAdd ){
this.set( elementObject, this.add( classToAdd, elementObject.className ) );
},
removeFromElement: function ( elementObject, classToRemove ){
this.set( elementObject, this.remove( classToRemove, elementObject.className ) );
},
add: function ( classToAdd, className ){
classArray = className.split( " " );
if( !JS_Format.array.itemExistsInArray( classToAdd, classArray ) )
classArray.push( classToAdd );
return classArray.join( " " );
},
remove: function ( classToRemove, className ){
classArray = className.split( " " );
for( var i = 0; i < classArray.length; i++ ){
if( classArray[ i ] == classToRemove ){
classArray.splice( i, 1 );
break;
}
}
return classArray.join( " " );
},
set: function ( elementObject, newClassString ){
elementObject.className = newClassString;
},
existsOnElement: function ( elementObject, className ){
//create a class exists flag
var classExists = false;
//verify that the object has a className parameter
if( elementObject.className ){
//get an array of all the classes on the element
var classArray = elementObject.className.split( " " );
//check whether the requested class exists in the array
classExists = JS_Format.array.itemExistsInArray( className, classArray );
}
return classExists;
}
},
elementAlpha: {
info: {
defaultFadeSpeed: 20
},
empty: function ( objectElement ){
this.set( objectElement, 0 );
},
fill: function ( objectElement ){
this.set( objectElement, 100 );
},
set: function ( objectElement, targetAlpha ){
Global.modify.setAlpha( objectElement, targetAlpha );
},
fadeIn: function ( inputObject ){
inputObject.initialAlpha = 0;
inputObject.targetAlpha = 100;
inputObject.fadeDirection = 1;
var fader = new JS_Format.elementAlpha.activeFader( inputObject );
fader.apply( fader );
},
fadeOut: function ( inputObject ){
inputObject.initialAlpha = 100;
inputObject.targetAlpha = 0;
inputObject.fadeDirection = -1;
var fader = new JS_Format.elementAlpha.activeFader( inputObject );
fader.apply( fader );
},
activeFader: function ( inputObject ){
this.activeObject = inputObject[ "objectElement" ];
this.fadeDirection = inputObject[ "fadeDirection" ];
this.targetAlpha = inputObject[ "targetAlpha" ];
this.initialAlpha = inputObject[ "initialAlpha" ];
this.activeAlpha = this.initialAlpha;
this.onFinishMethod = ( !( typeof( inputObject[ "onFinishMethod" ] ) == null ) )
? inputObject[ "onFinishMethod" ] : "";
//get the fade speed
this.fadeSpeed = ( !(typeof( inputObject[ "fadeSpeed" ] ) == null) )
? inputObject[ "fadeSpeed" ] : JS_Format.elementAlpha.info.defaultFadeSpeed;
this.fadeJump = 10;
this.updateAlpha = function (){
JS_Format.elementAlpha.set( this.activeObject, this.activeAlpha );
}
this.onFinish = function (){
if( typeof( this.onFinishMethod ) != "undefined" && !( this.onFinishMethod == "" ) )
eval( this.onFinishMethod )();
}
//set the active object to its initial alpha
this.updateAlpha();
this.apply = function ( fadeObject ){
var fadeComplete = false;
if( fadeObject.fadeDirection > 0 ){
//FADING IN
if( fadeObject.activeAlpha < fadeObject.targetAlpha )
fadeObject.activeAlpha += fadeObject.fadeJump;
else {
fadeObject.activeAlpha = fadeObject.targetAlpha;
fadeComplete = true;
}
}
else {
//FADING OUT
if( fadeObject.activeAlpha > fadeObject.targetAlpha )
fadeObject.activeAlpha -= fadeObject.fadeJump;
else {
this.activeAlpha = fadeObject.targetAlpha;
fadeComplete = true;
}
}
//update the new alpha
fadeObject.updateAlpha();
//check for fade completion
if( fadeComplete )
fadeObject.onFinish();
else
setTimeout( fadeObject.apply, fadeObject.fadeSpeed, fadeObject );
}
}
},
divElement: {
getById: function ( id ){
return document.getElementById( id );
},
setDisplay_block: function ( divElement ){
this.setStyle.divDisplay( divElement, "block" );
},
setDisplay_none: function ( divElement ){
this.setStyle.divDisplay( divElement, "none" );
},
setDivContent_byDivId: function ( divId, newContents ){
Global.modify.setDivContent( divId, newContents );
},
setDivContent_byDivElement: function ( divElement, newContents ){
Global.modify.divContent( divElement, newContents );
},
getDivContent_byDivElement: function ( divElement ){
return divElement.innerHTML;
},
refreshDivContent: function ( divElement ){
this.setDivContent_byDivElement( divElement, this.getDivContent_byDivElement( divElement ) );
},
setStyle: {
divDisplay: function( divElement, displayMode ){
divElement.style.display = displayMode;
},
divBackgroundImage: function ( divElement, bgImagePath ){
var newBg = ( bgImagePath == "none" ) ? bgImagePath : "url(" + bgImagePath + ")";
divElement.style.backgroundImage = newBg;
}
},
getAllOnPage_usingClass: function ( classNameString ){
return JS_Format.get.allElementsOnPage_usingClass( "div", classNameString );
}
},
file: {
get: {
extension: function ( filePathString ){
var extStartIndex = filePathString.lastIndexOf( "." );
return filePathString.slice( extStartIndex + 1, filePathString.length );
}
}
},
get: {
arrayOfElementsByTagName: function ( tagName ){
return document.getElementsByTagName( tagName );
},
allElementsOnPage_usingClass: function ( elementTag, classNameString ){
//create output container
var outputArray = new Array();
//get all elements with the requested tag name
var arrayOfElements = this.arrayOfElementsByTagName( elementTag );
//create element container
var element;
//cycle through all elements
for( var i in arrayOfElements ){
//get the next element
element = arrayOfElements[ i ];
//test if the element is using the requested class
if( JS_Format.elementClass.existsOnElement( element, classNameString ) )
//add the element to the output array
outputArray.push( element );
}
return outputArray;
}
}
}
/****************************************
|
| A-Line / Muru
| http://www.a-linetool.com
|
| Created by: Kevin Biskaborn
| Copyright 2010 ScriptReaction
| http://www.scriptreaction.com
|
*****************************************
| Load Dependencies : None
| Run Dependencies : Global{}
****************************************/
var FlashFilter = {
controls: {
allowDetection: true,
detectionApplied: false,
flashIsEnabled: false,
minPlayerVersion: 8
},
launch: function (){
FlashFilter.fv = [ 0,0 ];
FlashFilter.detectVersion();
this.controls.flashIsEnabled = ( FlashFilter.hasVersion( FlashFilter.controls.minPlayerVersion ) ) ? true : false;
this.controls.detectionApplied = true;
Global.addEvent( window, "load", this.spawn.apply );
},
flashEnabled: function (){
return this.controls.flashIsEnabled;
},
hasVersion: function ( minVersion ) {
return ( FlashFilter.fv[ 0 ] > minVersion ) ? true : false;
},
delayGetPrompt: function (){
setTimeout( FlashFilter.showGetPrompt, 1000 );
},
showGetPrompt: function (){
// get the flash box element
// this contains the download flash link
var boxElement = $( "flashbox" );
if( boxElement != null )
JS_Format.elementClass.addToElement( boxElement, "active" );
},
downloadAlert: function (){
var msg = "";
msg += "After installing Flash Player, REFRESH THIS PAGE.";
msg += "\n\n";
msg += "If Flash is still not detected (after installing),";
msg += "\n";
msg += "close ALL open browser windows and start the browser again.";
msg += "\n\n";
msg += "Click OK to continue getting Flash...";
msg += "\n\n";
alert( msg );
},
//begin FlashFilter.detectVersion()
detectVersion: function (){
// this method, detectVersion()
// is a ScriptReaction extension of:
// Unobtrusive Flash Objects v3.20
// http://www.bobbyvandersluis.com/ufo/
if ( navigator.plugins && typeof navigator.plugins[ "Shockwave Flash" ] == "object" ) {
FlashFilter.pluginType = "npapi";
var _d = navigator.plugins[ "Shockwave Flash" ].description;
if ( typeof _d != "undefined" ) {
_d = _d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
var _m = parseInt( _d.replace(/^(.*)\..*$/, "$1"), 10 );
var _r = /r/.test( _d ) ? parseInt(_d.replace(/^.*r(.*)$/, "$1"), 10) : 0;
FlashFilter.fv = [ _m, _r ];
}
}
else if ( window.ActiveXObject ) {
FlashFilter.pluginType = "ax";
try { // avoid fp 6 crashes
var _a = new ActiveXObject( "ShockwaveFlash.ShockwaveFlash.7" );
}
catch( e ) {
try {
var _a = new ActiveXObject( "ShockwaveFlash.ShockwaveFlash.6" );
FlashFilter.fv = [6, 0];
_a.AllowScriptAccess = "always"; // throws if fp < 6.47
}
catch( e ) {
if ( FlashFilter.fv[0] == 6 ) return;
}
try {
var _a = new ActiveXObject( "ShockwaveFlash.ShockwaveFlash" );
}
catch(e) {}
}
if ( typeof _a == "object" ) {
var _d = _a.GetVariable( "$version" ); // bugs in fp 6.21/6.23
if ( typeof _d != "undefined" ) {
_d = _d.replace(/^\S+\s+(.*)$/, "$1").split(",");
FlashFilter.fv = [ parseInt( _d[0], 10 ), parseInt( _d[2], 10 ) ];
}
}
}
},
//end FlashFilter.detectVersion()
attach: function ( requestObject ){
if( this.controls.allowDetection && !this.controls.detectionApplied )
this.launch();
this.spawn.requestArray.push( requestObject );
},
spawn: {
requestArray: Array(),
apply: function (){
if( FlashFilter.flashEnabled() ){
var path = FlashFilter.spawn;
var rqArray = path.requestArray;
var whichObject;
for( var i = 0; i < rqArray.length; i++ ){
whichObject = rqArray[ i ];
if( whichObject.target )
path.populate( whichObject.target, path.buildObject( whichObject, i ) );
}
}
},
buildObject: function ( inputObject, objectId ){
var output = "";
var allowBuild = ( inputObject.source ) ? true : false;
if( allowBuild ){
var source = inputObject.source;
var version = ( inputObject.version ) ? inputObject.version : 1;
var bground = ( inputObject.bground ) ? inputObject.bground : null;
var width = ( inputObject.width ) ? parseInt( inputObject.width ).toString() : "100%";
var height = ( inputObject.height ) ? parseInt( inputObject.height ).toString() : "100%";
var name = ( inputObject.name ) ? inputObject.name : "flashObject_" + objectId;
var wmode = ( inputObject.wmode ) ? inputObject.wmode : "transparent";
var setvar = ( inputObject.setvar ) ? inputObject.setvar : null;
var param = ( inputObject.param ) ? inputObject.param.toString() : null;
setvar = ( param != null && setvar == null ) ? "inputRequest" : setvar;
var usevar = ( setvar != null && param != null ) ? true : false;
var usebg = ( bground != null ) ? true : false;
var baseFolder = "assets/flash/";
var baseUrl = Global.includePrefix + baseFolder;
var url = baseUrl + "global_loader_v1.swf"; // *** specify the loader version ***
var dynamic = "swf=" + source + "&url=" + baseUrl + "&version=" + version;
if( usevar ) dynamic += "&rqvar=" + setvar + "¶m=" + param;
output += '';
}
return output;
},
populate: function ( targetDivId, flashObject ){
Global.modify.setDivContent( targetDivId, flashObject );
}
}
}
/****************************************
|
| A-Line / Muru
| http://www.a-linetool.com
|
| Created by: Kevin Biskaborn
| Copyright 2010 ScriptReaction
| http://www.scriptreaction.com
|
*****************************************
| Load Dependencies : Global
| Run Dependencies : None
****************************************/
/*
* Focal Feed (Manager)
*/
var FocalFeed = {
settings: {
addClassToNewWindowHrefTags: true,
newWindowHrefTagClass: "openWindowLink"
},
launch: function (){
if( this.settings.addClassToNewWindowHrefTags )
this.actions.applyNewWindowHrefTags();
},
get: {
focalFeedContainer: function (){
return this.element_byId( "focalfeed" );
},
element_byId: function ( id ){
return document.getElementById( id );
}
},
actions: {
applyNewWindowHrefTags: function (){
//get the focal feed div element
var targetContainer = FocalFeed.get.focalFeedContainer();
//get all divs in the container
var feedDivArray = targetContainer.getElementsByTagName( "div" );
//set the target div
var applyToTargetId = "content";
var divElement = null;
var targetFound = false;
//cycle through all div elements
for( var i = 0; i < feedDivArray.length && !targetFound; i++ ){
divElement = feedDivArray[ i ];
//test each div id for the target
if( divElement.id == applyToTargetId ){
targetFound = true;
//get all anchor tags in the div
var anchorArray = divElement.getElementsByTagName( "a" );
var aElement = null;
//cycle through all anchor elements
for( j in anchorArray ){
aElement = anchorArray[ j ];
//test if the anchor target is a new window
if( aElement.target == "_blank" )
aElement.className = FocalFeed.settings.newWindowHrefTagClass;
}
}
}
//end outer for loop
}
}
}
/****************************************
|
| A-Line / Muru
| http://www.a-linetool.com
|
| Created by: Kevin Biskaborn
| Copyright 2010 ScriptReaction
| http://www.scriptreaction.com
|
*****************************************
| Load Dependencies : Global{}
| Run Dependencies : None
****************************************/
var BrowserDetector = {
info: {
type: "",
version: -1
},
controls: {
useBrowserSpecificCSS: true
},
preload: function (){
this.detect.clientBrowser();
this.populate.css();
},
detect: {
clientBrowser: function (){
if( window.XMLHttpRequest ){
if( window.ActiveXObject ){ //IE 7
BrowserDetector.info.type = "ie";
BrowserDetector.info.version = 7;
return;
}
else { // Opera, Safari, Firefox
BrowserDetector.info.type = "gecko";
return;
}
}
else { //IE6 and below
BrowserDetector.info.type = "ie";
BrowserDetector.info.version = 6;
}
}
},
populate: {
css: function (){
if( BrowserDetector.controls.useBrowserSpecificCSS && BrowserDetector.isIE() ){
var cssUrl = "";
if( BrowserDetector.info.version > 6 )
cssUrl = "global_fixIE7";
else
cssUrl = "global_fixIE6";
Global.attach.cssLink( cssUrl );
}
}
},
isIE: function (){
return ( this.info.type == "ie" ) ? true : false;
}
}
/******** GLOBAL LAUNCH ********/
BrowserDetector.preload();
/****************************************
|
| A-Line / Muru
| http://www.a-linetool.com
|
| Created by: Kevin Biskaborn
| Copyright 2010 ScriptReaction
| http://www.scriptreaction.com
|
*****************************************
| Load Dependencies : None
| Run Dependencies : Global{}
****************************************/
var NavPrimary = {
controls: {
anchorDivId: "navigation",
subMenuDivPrefix: "nav_",
useAnimation: false,
menuHideDelay: 1500 //delay before menu closes on mouseout
},
info: {
activeAnchorArray: Array(),
activeMenuArray: Array(),
menuOpenArray: Array(),
menuCount: 0
},
launch: function (){
if( this.controls.useAnimation )
Global.attach.jsLink( "tween" );
this.populatePrimaryAnchors();
this.setupMenuDivs();
this.actions.closeAll();
},
get: {
element: function ( id ){
return document.getElementById( id );
},
menuNameFromId: function ( id ){
return id.split( "_" )[ 0 ];
},
menuIndexFromId: function ( id ){
return id.split( "_" )[ 1 ];
},
menuDivFromArrayById: function ( id ){
return NavPrimary.info.activeMenuArray[ this.menuIndexFromId( id ) ];
},
menuDivFromDocById: function ( id ){
return this.element( NavPrimary.controls.subMenuDivPrefix + this.menuNameFromId( id ) );
},
anchorTagFromArrayById: function ( id ){
return this.anchorTagFromArrayByIndex( this.menuIndexFromId( id ) );
},
anchorTagFromArrayByIndex: function ( index ){
return NavPrimary.info.activeAnchorArray[ index ];
}
},
states: {
isOpen: function ( menuIndex ){
return NavPrimary.info.menuOpenArray[ menuIndex ];
},
set: function ( menuIndex, state ){
NavPrimary.info.menuOpenArray[ menuIndex ] = state;
},
doOpen: function ( menuIndex ){
this.set( menuIndex, true );
},
doClose: function ( menuIndex ){
this.set( menuIndex, false );
}
},
populatePrimaryAnchors: function () {
var anchorDiv = this.get.element( this.controls.anchorDivId );
var anchorTagArray = anchorDiv.getElementsByTagName( "a" );
var whichAnchor;
for( var i = 0; i < anchorTagArray.length; i++ ){
whichAnchor = anchorTagArray[ i ];
if( whichAnchor.name ){ //check if anchor tag has name param set
//update the anchor name
whichAnchor.name = whichAnchor.name + "_" + this.info.menuCount++;
//anchor has a corresponding sub menu
whichAnchor.onmouseover = function (){
NavPrimary.actions.closeAll();
NavPrimary.actions.over( this.name );
}
whichAnchor.onmouseout = function (){
NavPrimary.actions.out( this.name );
}
whichAnchor.onclick = function (){
this.blur();
}
//save the anchor
this.info.activeAnchorArray.push( whichAnchor );
//save the corresponding menu
this.info.activeMenuArray.push( this.get.menuDivFromDocById( whichAnchor.name ) );
//save the menu open state
this.info.menuOpenArray.push( true );
}
else { //anchor has NO sub menu
whichAnchor.onmouseover = function (){
NavPrimary.actions.closeAll();
}
}
}
},
setupMenuDivs: function (){
var anchorArray = this.info.activeAnchorArray;
var menuDivArray = this.info.activeMenuArray;
var i, j, whichMenu, menuName, menuOptions, whichOption;
for( i = 0; i < menuDivArray.length; i++ ){
if( menuDivArray[ i ] != null ){
whichMenu = menuDivArray[ i ];
menuId = anchorArray[ i ].name;
menuOptions = whichMenu.getElementsByTagName( "a" );
for( j = 0; j < menuOptions.length; j++ )
this.assignOptionEvents( menuOptions[ j ], menuId );
//assign the actions to the other menu components
this.assignOptionEvents( whichMenu.getElementsByTagName( "div" )[0], menuId );
}
}
},
assignOptionEvents: function ( element, elementId ){
element.name = elementId;
element.onmouseover = function (){
NavPrimary.actions.over( this.name );
}
element.onmouseout = function (){
NavPrimary.actions.out( this.name );
}
element.onclick = function (){
this.blur();
NavPrimary.actions.closeAll();
}
},
collapse: function (){
this.actions.closeAll();
},
actions: {
get:{
menuById: function ( id ){
return NavPrimary.get.menuDivFromArrayById( id );
},
anchorById: function ( id ){
return NavPrimary.get.anchorTagFromArrayById( id );
},
menuIndexFromId: function ( id ){
return NavPrimary.get.menuIndexFromId( id );
}
},
over: function ( id ){
var menuDiv = this.get.menuById( id );
var anchorItem = this.get.anchorById( id );
var menuIndex = this.get.menuIndexFromId( id );
NavPrimary.timers.destroy( menuIndex );
if( !NavPrimary.states.isOpen( menuIndex ) )
this.openMenu( id );
},
out: function ( id ){
var menuDiv = this.get.menuById( id );
var anchorItem = this.get.anchorById( id );
var menuIndex = this.get.menuIndexFromId( id );
NavPrimary.timers.create( menuIndex );
},
openMenu: function ( id ){
var menuDiv = this.get.menuById( id );
var anchorItem = this.get.anchorById( id );
var menuIndex = this.get.menuIndexFromId( id );
if( menuDiv != null && !NavPrimary.states.isOpen( menuIndex ) ){
if( NavPrimary.controls.useAnimation ){
/*var targetY = NavPrimary.animate.get.posY_active( menuDiv );
if( menuDiv.style.top <= targetY ){
menuDiv.style.top = targetY;
t1 = new Tween(menuDiv.style,'top',Tween.strongEaseOut,parseInt(menuDiv.style.top),parseInt(targetY),.2,'px');
t1.start();
}*/
}
else {
menuDiv.style.display = "block";
//raise the menu open flag
NavPrimary.states.doOpen( menuIndex );
}
}
//set anchor appearance
anchorItem.className = "active";
},
closeMenu: function ( id ){
var menuDiv = this.get.menuById( id );
var anchorItem = this.get.anchorById( id );
var menuIndex = this.get.menuIndexFromId( id );
if( menuDiv != null && NavPrimary.states.isOpen( menuIndex ) ){
if( NavPrimary.controls.useAnimation ){
//
}
else
menuDiv.style.display = "none";
//lower the menu open flag
NavPrimary.states.doClose( menuIndex );
}
//set anchor appearance
anchorItem.className = "";
},
closeAll: function (){
var anchorArray = NavPrimary.info.activeAnchorArray;
for( var i = 0; i < anchorArray.length; i++ )
this.closeMenu( anchorArray[ i ].name );
}
},
timers: {
create: function ( index ){
this.destroy( index );
this[ "timer_" + index ] = setTimeout( "NavPrimary.timers.expire(" + index + ")", NavPrimary.controls.menuHideDelay );
},
expire: function ( index ){
NavPrimary.actions.closeMenu( NavPrimary.get.anchorTagFromArrayByIndex( index ).name );
},
destroy: function ( index ){
if( typeof( this[ "timer_" + index ] ) != "undefined" )
clearTimeout( this[ "timer_" + index ] );
}
},
animate: {
get: {
posY_active: function ( menuDiv ){
return 0 + "px";
},
posY_inactive: function ( menuDiv ){
return (-1 * menuDiv.clientHeight) + "px";
}
}
}
}
/****************************************
|
| A-Line / Muru
| http://www.a-linetool.com
|
| Created by: Kevin Biskaborn
| Copyright 2010 ScriptReaction
| http://www.scriptreaction.com
|
*****************************************
| Load Dependencies : None
| Run Dependencies : Global{}
****************************************/
var AlphaLogos = {
info: {
isActive: true,
spnAlphaOff: 50,
devAlphaOff: 65,
holderDivId: "logoarea",
devElementClass: "scriptrx"
},
launch: function (){
if( this.info.isActive )
this.populate();
},
get: {
element: function ( id ){
return document.getElementById( id );
},
inactiveAlphaFromItem: function ( anchorTag ){
if( anchorTag.className == AlphaLogos.info.devElementClass )
return AlphaLogos.info.devAlphaOff;
else
return AlphaLogos.info.spnAlphaOff;
}
},
set: {
itemAlpha: function ( anchorTag, targetAlpha ){
Global.modify.setAlpha( anchorTag.getElementsByTagName( "img" )[ 0 ], targetAlpha );
}
},
populate: function (){
var holder = this.get.element( this.info.holderDivId );
var itemArray = holder.getElementsByTagName( "a" );
var whichItem;
var itemClass;
var itemImage;
//cycle through all a tags
//and apply actions to image tag
for( var i = 0; i < itemArray.length; i++ ){
whichItem = itemArray[ i ];
whichItem.onmouseover = function (){
AlphaLogos.actions.over( this );
}
whichItem.onmouseout = function (){
AlphaLogos.actions.out( this );
}
whichItem.onmouseout();
}
},
actions: {
over: function ( anchorTag ){
AlphaLogos.set.itemAlpha( anchorTag, 100 );
// check if the element does NOT have the designed by class
// if it does NOT, allow the title to activate
if( !( anchorTag.className == AlphaLogos.info.devElementClass ) )
AlphaLogos.title.activate();
},
out: function ( anchorTag ){
AlphaLogos.set.itemAlpha( anchorTag, AlphaLogos.get.inactiveAlphaFromItem( anchorTag ) );
AlphaLogos.title.deactivate();
}
},
title: {
activate: function (){
JS_Format.elementClass.addToElement( $( "logoarea_title" ), "active" );
},
deactivate: function (){
JS_Format.elementClass.removeFromElement( $( "logoarea_title" ), "active" );
}
}
}