/****************************************
|
| ILCA-NA Laser District 3
| http://www.d3laser.com
|
| Created by: Kevin Biskaborn
| Copyright 2009 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();
},
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( Browser ) && Browser.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);};
}
},
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;
var domain = ( typeof( requestObj.d ) == "undefined" ) ? null : requestObj.d.slice( 2 );
var ext = ( typeof( requestObj.e ) == "undefined" ) ? "com" : requestObj.e.slice( 2 );
var user = ( typeof( requestObj.u ) == "undefined" ) ? null : requestObj.u.slice( 2 );
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();
/****************************************
|
| ILCA-NA Laser District 3
| http://www.d3laser.com
|
| Created by: Kevin Biskaborn
| Copyright 2009 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;
},
//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_v2.swf";
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 );
}
}
}
/****************************************
|
| ILCA-NA Laser District 3
| http://www.d3laser.com
|
| Created by: Kevin Biskaborn
| Copyright 2009 ScriptReaction
| http://www.scriptreaction.com
|
*****************************************
| Load Dependencies : Global{}
| Run Dependencies : None
****************************************/
var Browser = {
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
Browser.info.type = "ie";
Browser.info.version = 7;
return;
}
else { // Opera, Safari, Firefox
Browser.info.type = "gecko";
return;
}
}
else { //IE6 and below
Browser.info.type = "ie";
Browser.info.version = 6;
}
}
},
populate: {
css: function (){
if( Browser.controls.useBrowserSpecificCSS && Browser.isIE() ){
var cssUrl = "";
if( Browser.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 ********/
Browser.preload();
/****************************************
|
| ILCA-NA Laser District 3
| http://www.d3laser.com
|
| Created by: Kevin Biskaborn
| Copyright 2009 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++ ){
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( !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( NavPrimary.states.isOpen( menuIndex ) ){
if( NavPrimary.controls.useAnimation ){
//
}
else
menuDiv.style.display = "none";
//set anchor appearance
anchorItem.className = "";
//lower the menu open flag
NavPrimary.states.doClose( menuIndex );
}
},
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";
}
}
}
}
/****************************************
|
| ILCA-NA Laser District 3
| http://www.d3laser.com
|
| Created by: Kevin Biskaborn
| Copyright 2009 ScriptReaction
| http://www.scriptreaction.com
|
*****************************************
| Load Dependencies : None
| Run Dependencies : Global{}
****************************************/
var AlphaLogos = {
info: {
isActive: true,
spnAlphaOff: 50,
devAlphaOff: 65,
holderDivId: "logoarea"
},
launch: function (){
if( this.info.isActive )
this.populate();
},
get: {
element: function ( id ){
return document.getElementById( id );
},
inactiveAlphaFromItem: function ( anchorTag ){
if( anchorTag.className == "dev" )
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 );
},
out: function ( anchorTag ){
AlphaLogos.set.itemAlpha( anchorTag, AlphaLogos.get.inactiveAlphaFromItem( anchorTag ) );
}
}
}