﻿

//////////////////////////SWF ADDRESS BUTTON FUNCTIONS//////////////////////

function JsAddr_SetValue(dl) {
	
	alert("Set DeepLink Value");
	SWFAddress.setValue(dl);
};//

function JsAddr_SetStatus() {
	
	SWFAddress.setStatus(this.deepLink);
};//

function JsAddr_ResetStatus() {
	
	SWFAddress.resetStatus();
};//

/*
///////////////////////////SWF ADDRESS ON INIT FUNCTION/////////////////////

SWFAddress.onInit = function () {
	trace("");
	trace("SWF ADDRESS - ON INITIAL FUNCTION");
	trace("getPath - "+SWFAddress.getPath());
	trace("getPathName - "+SWFAddress.getPathNames());
	trace("getValue - "+SWFAddress.getValue());
	trace("getBaseURL - "+SWFAddress.getBaseURL());
	trace("getHistory - "+SWFAddress.getHistory());
	trace("getParameterNames - "+SWFAddress.getParameterNames());
	trace("getgetQueryString - "+SWFAddress.getQueryString());
	trace("getStatus - "+SWFAddress.getStatus());
	trace("getStrict - "+SWFAddress.getStrict());
	trace("getTitle - "+SWFAddress.getTitle());
	trace("getTracker - "+SWFAddress.getTracker());
	
	Set_BrowserTitle();
	Process_DeepLink();
	

};//END




///////////////////////////SWF ADDRESS ON CHANGE HANDLER FUNCTION///////////////////

SWFAddress.onChange = function() {
	
	trace("")
	trace("SWF ADDRESS - ON CHANGE FUNCTION")
	trace("getPath - "+SWFAddress.getPath());
	trace("getPathName - "+SWFAddress.getPathNames());
	trace("getValue - "+SWFAddress.getValue());
	trace("getBaseURL - "+SWFAddress.getBaseURL());
	trace("getHistory - "+SWFAddress.getHistory());
	trace("getParameterNames - "+SWFAddress.getParameterNames());
	trace("getgetQueryString - "+SWFAddress.getQueryString());
	trace("getStatus - "+SWFAddress.getStatus());
	trace("getStrict - "+SWFAddress.getStrict());
	trace("getTitle - "+SWFAddress.getTitle());
	trace("getTracker - "+SWFAddress.getTracker());
	
	Set_BrowserTitle();
	Process_DeepLink();
	
		
};//END SWFAddress.onChange


/////////////////////////////SET BROWSER TITLE///////////////////////////

function Set_BrowserTitle(){
		
		var BrowserTitle = "MONEY";//seen on brower tabs
		var PathNames = SWFAddress.getPathNames();
		for (var i = 0; i < PathNames.length; i++) {
			BrowserTitle += ' / ' + PathNames[i].substr(0,1).toUpperCase() + PathNames[i].substr(1);
		}//end for
		SWFAddress.setTitle(BrowserTitle);
		
};//END Set_BrowserTitle





/////////////////////////////GET ARRAY INDEX PROTOTYPE///////////////////////////

Array.prototype.Get_ArrayIndex = function(val) {

    var pos = -1;
	
	for (i=0; i< this.length; i++) {
    	if (this[i] == val) {
            pos = i;
            break;
        }
    }
    return pos;// returns the position in the Categories array
	
};//END prototype




/////////////////////////////GET ARRAY VALUE PROTOTYPE///////////////////////////

Array.prototype.Get_ArrayValue = function(linkval) {
	
    for (i=0; i<this.length; i++) {
        if (this[i] == linkval) 
		{
            val = this[i];
            break;
			
        }// end if
    }//end for
	
    return val;//returns the value in the LinksCat array
	
};//END prototype 

/*

///////////////////////////MOVIES/////////////////////

var MovieDeepLinks = ['/','/intro/','/pdm/'];



///////////////////////////PROJECT CATEGORIES AND DEEP LINK ARRAYS/////////////////////

var Categories = ["services", "interfaces", "design", "audio", "disk"];

var Cat1_DpLinks = ['/services/','/services/1/','/services/2/','/services/3/'];
var Cat2_DpLinks = ['/interfaces/','/interfaces/youtube/'];
var Cat3_DpLinks = ['/design/','/design/examples/'];
var Cat4_DpLinks = ['/audio/intro/','/audio/eaglescomm/','/audio/mjmix/','/audio/niracomm/'];
var Cat5_DpLinks = ['/disk/'];



DeepLinkValue = SWFAddress.getValue();
trace("DeepLinkValue = "+DeepLinkValue);
	
StrStart = 1;
StrEnd = DeepLinkValue.indexOf("/", 3);//value to search string for, number of where to start from "/"
DeepLinkCore  = DeepLinkValue.substring(StrStart,StrEnd);
trace("DeepLinkCore = "+DeepLinkCore);
	  
DLMovieNum = MovieDeepLinks.Get_ArrayIndex(DeepLinkValue) + 1;// set here for index movie
trace("DeepLink Movie Number = "+DLMovieNum);

*/


/*
function Process_DeepLink(){
	
	CurrPath = SWFAddress.getPath();
	//DLMovieNum = MovieDeepLinks.Get_ArrayIndex(CurrPath) + 1;// set here for index number of movie
	//trace("DeepLink Movie Number = "+DLMovieNum);
	
	switch (CurrPath) {
		case '/' : 
		
			trace("/");
			//gotoAndStop("Start");
		break; 
		case '/gallery/' : 
		
			trace("/gallery/");
			//gotoAndStop("Gallery");
		break; 
		case '/about/' : 
		
			trace("/about/");
			//gotoAndStop("About");
		break; 
		case '/contact/' : 
		
			trace("/contact/");
			//gotoAndStop("Contact");
		break; 
		default : // not a movie deepLink - set category deepLink
		
			//Process_CatDeepLink();
			gotoAndStop("a");
	
	}//END Switch 
	
};//END Process_DeepLinks

*/










