/*
Macromedia(r) Flash(r) JavaScript Integration Kit License


Copyright (c) 2005 Macromedia, inc. All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.

3. The end-user documentation included with the redistribution, if any, must
include the following acknowledgment:

"This product includes software developed by Macromedia, Inc.
(http://www.macromedia.com)."

Alternately, this acknowledgment may appear in the software itself, if and
wherever such third-party acknowledgments normally appear.

4. The name Macromedia must not be used to endorse or promote products derived
from this software without prior written permission. For written permission,
please contact devrelations@macromedia.com.

5. Products derived from this software may not be called "Macromedia" or
"Macromedia Flash", nor may "Macromedia" or "Macromedia Flash" appear in their
name.

THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MACROMEDIA OR
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.

--

This code is part of the Flash / JavaScript Integration Kit:
http://www.macromedia.com/go/flashjavascript/

Created by:

Christian Cantrell
http://weblogs.macromedia.com/cantrell/
mailto:cantrell@macromedia.com

Mike Chambers
http://weblogs.macromedia.com/mesh/
mailto:mesh@macromedia.com

Macromedia
*/

/**
 * Create a new Exception object.
 * name: The name of the exception.
 * message: The exception message.
 */
function Exception(name, message)
{
    if (name)
        this.name = name;
    if (message)
        this.message = message;
}

/**
 * Set the name of the exception. 
 */
Exception.prototype.setName = function(name)
{
    this.name = name;
}

/**
 * Get the exception's name. 
 */
Exception.prototype.getName = function()
{
    return this.name;
}

/**
 * Set a message on the exception. 
 */
Exception.prototype.setMessage = function(msg)
{
    this.message = msg;
}

/**
 * Get the exception message. 
 */
Exception.prototype.getMessage = function()
{
    return this.message;
}

/**
 * Generates a browser-specific Flash tag. Create a new instance, set whatever
 * properties you need, then call either toString() to get the tag as a string, or
 * call write() to write the tag out.
 */

/**
 * Creates a new instance of the FlashTag.
 * src: The path to the SWF file.
 * width: The width of your Flash content.
 * height: the height of your Flash content.
 */
function FlashTag(src, width, height)
{
    this.src       = src;
    this.width     = width;
    this.height    = height;
    this.version   = '7,0,14,0';
    this.id        = null;
    this.bgcolor   = 'ffffff';
    this.flashVars = null;
}

/**
 * Sets the Flash version used in the Flash tag.
 */
FlashTag.prototype.setVersion = function(v)
{
    this.version = v;
}

/**
 * Sets the ID used in the Flash tag.
 */
FlashTag.prototype.setId = function(id)
{
    this.id = id;
}

/**
 * Sets the background color used in the Flash tag.
 */
FlashTag.prototype.setBgcolor = function(bgc)
{
    this.bgcolor = bgc;
}

/**
 * Sets any variables to be passed into the Flash content. 
 */
FlashTag.prototype.setFlashvars = function(fv)
{
    this.flashVars = fv;
}

/**
 * Get the Flash tag as a string. 
 */
FlashTag.prototype.toString = function()
{
    var ie = (navigator.appName.indexOf ("Microsoft") != -1) ? 1 : 0;
    var flashTag = new String();
    if (ie)
    {
        flashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
        if (this.id != null)
        {
            flashTag += 'id="'+this.id+'" ';
        }
        flashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+this.version+'" ';
        flashTag += 'width="'+this.width+'" ';
        flashTag += 'height="'+this.height+'">';
        flashTag += '<param name="movie" value="'+this.src+'"/>';
        flashTag += '<param name="quality" value="high"/>';
        flashTag += '<param name="bgcolor" value="#'+this.bgcolor+'"/>';
        if (this.flashVars != null)
        {
            flashTag += '<param name="flashvars" value="'+this.flashVars+'"/>';
        }
        flashTag += '</object>';
    }
    else
    {
        flashTag += '<embed src="'+this.src+'" ';
        flashTag += 'quality="high" '; 
        flashTag += 'bgcolor="#'+this.bgcolor+'" ';
        flashTag += 'width="'+this.width+'" ';
        flashTag += 'height="'+this.height+'" ';
        flashTag += 'type="application/x-shockwave-flash" ';
        if (this.flashVars != null)
        {
            flashTag += 'flashvars="'+this.flashVars+'" ';
        }
        if (this.id != null)
        {
            flashTag += 'name="'+this.id+'" ';
        }
        flashTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer">';
        flashTag += '</embed>';
    }
    return flashTag;
}

/**
 * Write the Flash tag out. Pass in a reference to the document to write to. 
 */
FlashTag.prototype.write = function(doc)
{
    doc.write(this.toString());
}

/**
 * The FlashSerializer serializes JavaScript variables of types object, array, string,
 * number, date, boolean, null or undefined into XML. 
 */

/**
 * Create a new instance of the FlashSerializer.
 * useCdata: Whether strings should be treated as character data. If false, strings are simply XML encoded.
 */
function FlashSerializer(useCdata)
{
    this.useCdata = useCdata;
}

/**
 * Serialize an array into a format that can be deserialized in Flash. Supported data types are object,
 * array, string, number, date, boolean, null, and undefined. Returns a string of serialized data.
 */
FlashSerializer.prototype.serialize = function(args)
{
    var qs = new String();

    for (var i = 0; i < args.length; ++i)
    {
        switch(typeof(args[i]))
        {
            case 'undefined':
                qs += 't'+(i)+'=undf';
                break;
            case 'string':
                qs += 't'+(i)+'=str&d'+(i)+'='+escape(args[i]);
                break;
            case 'number':
                qs += 't'+(i)+'=num&d'+(i)+'='+escape(args[i]);
                break;
            case 'boolean':
                qs += 't'+(i)+'=bool&d'+(i)+'='+escape(args[i]);
                break;
            case 'object':
                if (args[i] == null)
                {
                    qs += 't'+(i)+'=null';
                }
                else if (args[i] instanceof Date)
                {
                    qs += 't'+(i)+'=date&d'+(i)+'='+escape(args[i].getTime());
                }
                else // array or object
                {
                    try
                    {
                        qs += 't'+(i)+'=xser&d'+(i)+'='+escape(this._serializeXML(args[i]));
                    }
                    catch (exception)
                    {
                        throw new Exception("FlashSerializationException",
                                            "The following error occurred during complex object serialization: " + exception.getMessage());
                    }
                }
                break;
            default:
                throw new Exception("FlashSerializationException",
                                    "You can only serialize strings, numbers, booleans, dates, objects, arrays, nulls, and undefined.");
        }

        if (i != (args.length - 1))
        {
            qs += '&';
        }
    }

    return qs;
}

/**
 * Private
 */
FlashSerializer.prototype._serializeXML = function(obj)
{
    var doc = new Object();
    doc.xml = '<fp>'; 
    this._serializeNode(obj, doc, null);
    doc.xml += '</fp>'; 
    return doc.xml;
}

/**
 * Private
 */
FlashSerializer.prototype._serializeNode = function(obj, doc, name)
{
    switch(typeof(obj))
    {
        case 'undefined':
            doc.xml += '<undf'+this._addName(name)+'/>';
            break;
        case 'string':
            doc.xml += '<str'+this._addName(name)+'>'+this._escapeXml(obj)+'</str>';
            break;
        case 'number':
            doc.xml += '<num'+this._addName(name)+'>'+obj+'</num>';
            break;
        case 'boolean':
            doc.xml += '<bool'+this._addName(name)+' val="'+obj+'"/>';
            break;
        case 'object':
            if (obj == null)
            {
                doc.xml += '<null'+this._addName(name)+'/>';
            }
            else if (obj instanceof Date)
            {
                doc.xml += '<date'+this._addName(name)+'>'+obj.getTime()+'</date>';
            }
            else if (obj instanceof Array)
            {
                doc.xml += '<array'+this._addName(name)+'>';
                for (var i = 0; i < obj.length; ++i)
                {
                    this._serializeNode(obj[i], doc, null);
                }
                doc.xml += '</array>';
            }
            else
            {
                doc.xml += '<obj'+this._addName(name)+'>';
                for (var n in obj)
                {
                    if (typeof(obj[n]) == 'function')
                        continue;
                    this._serializeNode(obj[n], doc, n);
                }
                doc.xml += '</obj>';
            }
            break;
        default:
            throw new Exception("FlashSerializationException",
                                "You can only serialize strings, numbers, booleans, objects, dates, arrays, nulls and undefined");
            break;
    }
}

/**
 * Private
 */
FlashSerializer.prototype._addName= function(name)
{
    if (name != null)
    {
        return ' name="'+name+'"';
    }
    return '';
}

/**
 * Private
 */
FlashSerializer.prototype._escapeXml = function(str)
{
    if (this.useCdata)
        return '<![CDATA['+str+']]>';
    else
        return str.replace(/&/g,'&amp;').replace(/</g,'&lt;');
}

/**
 * The FlashProxy object is what proxies function calls between JavaScript and Flash.
 * It handles all argument serialization issues.
 */

/**
 * Instantiates a new FlashProxy object. Pass in a uniqueID and the name (including the path)
 * of the Flash proxy SWF. The ID is the same ID that needs to be passed into your Flash content as lcId.
 */
function FlashProxy(uid, proxySwfName)
{
    this.uid = uid;
    this.proxySwfName = proxySwfName;
    this.flashSerializer = new FlashSerializer(false);
}

/**
 * Call a function in your Flash content.  Arguments should be:
 * 1. ActionScript function name to call,
 * 2. any number of additional arguments of type object,
 *    array, string, number, boolean, date, null, or undefined. 
 */
FlashProxy.prototype.call = function()
{

    if (arguments.length == 0)
    {
        throw new Exception("Flash Proxy Exception",
                            "The first argument should be the function name followed by any number of additional arguments.");
    }

    var qs = 'lcId=' + escape(this.uid) + '&functionName=' + escape(arguments[0]);

    if (arguments.length > 1)
    {
        var justArgs = new Array();
        for (var i = 1; i < arguments.length; ++i)
        {
            justArgs.push(arguments[i]);
        }
        qs += ('&' + this.flashSerializer.serialize(justArgs));
    }

    var divName = '_flash_proxy_' + this.uid;
    if(!document.getElementById(divName))
    {
        var newTarget = document.createElement("div");
        newTarget.id = divName;
        document.body.appendChild(newTarget);
    }
    var target = document.getElementById(divName);
    var ft = new FlashTag(this.proxySwfName, 1, 1);
    ft.setVersion('6,0,65,0');
    ft.setFlashvars(qs);
    target.innerHTML = ft.toString();
}

/**
 * This is the function that proxies function calls from Flash to JavaScript.
 * It is called implicitly.
 */
FlashProxy.callJS = function()
{
    var functionToCall = eval(arguments[0]);
    var argArray = new Array();
    for (var i = 1; i < arguments.length; ++i)
    {
        argArray.push(arguments[i]);
    }
    functionToCall.apply(functionToCall, argArray);
}


/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;



//----------------------------------------------------------------------------------------------------------------------------------------------------------------//
//		bp_danny(flying danny)
//----------------------------------------------------------------------------------------------------------------------------------------------------------------//
var bp_danny_Object = new Object();
//----------------------------------------------------------------------------------------------------------------------------------------------------------------//
//		INIT
//----------------------------------------------------------------------------------------------------------------------------------------------------------------//
function bp_danny_init(){
	var width = 150;
	var height = 230;
	bp_danny_Object.movieWidth = width;
	bp_danny_Object.movieHeight = height;
	bp_danny_Object.keySize = 0;
	bp_danny_Object.swfDir = 'http://www2.nissan.co.jp/NOTE/E11/SWF/SPECIAL/';
	bp_danny_Object.otherSwfContainerList = new Array();
	bp_danny_Object.bNotResize = false;
	bp_danny_Object.pxyBlogParts = "blogparts";
	bp_danny_Object.bIE = /*@cc_on!@*/false;
	bp_danny_Object.ua = 	navigator.userAgent;
	bp_danny_Object.bSafari = (bp_danny_Object.ua.indexOf("Safari")!=-1);
	if(bp_danny_Object.ua.indexOf("Windows") > -1){
		bp_danny_Object.bWin = true;
	}
	if (bp_danny_Object.ua.match(/Gecko/)) {
		if (bp_danny_Object.ua.match(/(Firebird|Firefox)\/([\.\d]+)/)) {
			bp_danny_Object.bFoxy = true;
		}
	}
	if(window.opera){
		bp_danny_Object.bOpera = true;
	}
	if (bp_danny_Object.bIE && typeof document.body.style.maxHeight != "undefined") {
		bp_danny_Object.bIE7 = true;
	}
	bp_danny_Object.body = document["CSS1Compat" == document.compatMode ? "documentElement":"body"];	
	var uidbp_danny_float = "bp_danny_float";
	var uidbp_danny_main = "uidbp_danny_main";
	var pxybp_danny_float = new FlashProxy(uidbp_danny_float, bp_danny_Object.swfDir + 'JavaScriptFlashGateway.swf');
	var pxybp_danny_main = new FlashProxy(uidbp_danny_main, bp_danny_Object.swfDir + 'JavaScriptFlashGateway.swf');
	//	-----------------------------------------------------------------------------------------------------------------------------------------------------------//
	//		ATTACH BLOG PARTS
	//	-----------------------------------------------------------------------------------------------------------------------------------------------------------//
	bp_danny_Object.attachBlogParts = function(){
	//	var htmlBuffer = '<div id="bp_danny_float'+this.movieWidth+'">';
		var so = new SWFObject(this.swfDir + 'bp_danny.swf', 'bp_danny_float', this.movieWidth, this.movieHeight, '8', '#ffffff');
		so.addParam("allowScriptAccess", "always");
		so.addParam('wmode', 'transparent');
		so.addVariable("url", document.URL);
		so.addVariable("partsSize", this.keySize);
		so.addVariable("lcId", pxybp_danny_float);
	//	htmlBuffer += so.getSWFHTML();
	//	htmlBuffer += '</div>';
	//	document.write(htmlBuffer);
		so.write("bp_danny");
	}
	//	-----------------------------------------------------------------------------------------------------------------------------------------------------------//
	//		ATTACH MAIN SWF
	//	-----------------------------------------------------------------------------------------------------------------------------------------------------------//	
	bp_danny_Object.attachMain = function(){
		mainContainer = document.createElement("div");
		mainContainer.setAttribute("id","bp_danny_main");
		mainContainer.style.zIndex = "10001";
		mainContainer.style.position = "absolute";
		mainContainer.style.width = this.getWidth() + "px";
		mainContainer.style.height = this.getHeight() + "px";
		document.body.appendChild(mainContainer);
		/*
		if(this.bIE7){
			mainContainer.style.left = "-9999px";
			this.bNotResize = true;
		}else	if(!this.bIE){
			mainContainer.style.visibility='hidden';
		}
		*/
		var soMain = new SWFObject(this.swfDir + 'flying.swf', 'preloader', '100%', '100%', '8', '#ffffff');
		soMain.addParam("allowScriptAccess", "always");
		soMain.addParam('wmode', 'transparent'); 
		soMain.addVariable("lcId", uidbp_danny_main);
		mainContainer.innerHTML = soMain.getSWFHTML();
		this.replaceResize();
}

	bp_danny_Object.removeMain = function(){
		var mainContainer = document.getElementById('bp_danny_main');
		//while(mainContainer.firstChild){
		//	mainContainer.removeChild(mainContainer.firstChild);
		//}
		document.body.removeChild(mainContainer);
	}	
	//	-----------------------------------------------------------------------------------------------------------------------------------------------------------//
	//		IN/VISIBLE OTHER OBJECT
	//	-----------------------------------------------------------------------------------------------------------------------------------------------------------//
	bp_danny_Object.hideOther = function(){
		this.hideOtherObject(document.getElementsByTagName('object'));
		this.hideOtherObject(document.getElementsByTagName('embed'));
		this.hideOtherObject(document.getElementsByTagName('select'));
		this.hideOtherObject(document.getElementsByTagName('iframe'));	
	}
		//	-----------------------------------------------------------------------------------------------------------------------------------------------------------//
		//		INVISIBLE OTHER OBJECT
		//	-----------------------------------------------------------------------------------------------------------------------------------------------------------//
	bp_danny_Object.hideOtherObject = function(_arg){
		var tmpList = _arg.length;
		for( var i=0; i<tmpList; i++ ){
			if( _arg[i].style.visibility != 'hidden' ){
				if(_arg[i].id.indexOf("bp_danny_") == -1){
					bp_danny_Object.otherSwfContainerList.push(_arg[i]);
					_arg[i].style.visibility='hidden';
				}
			}
		}		
	}
		//	-----------------------------------------------------------------------------------------------------------------------------------------------------------//
		//		INVISIBLE OTHER OBJECT
		//	-----------------------------------------------------------------------------------------------------------------------------------------------------------//
	bp_danny_Object.respawnOtherObject = function(){
		for( var i=0; i<bp_danny_Object.otherSwfContainerList.length; i++ ){
			bp_danny_Object.otherSwfContainerList[i].style.visibility = 'visible';
		}
	}	
//----------------------------------------------------------------------------------------------------------------------------------------------------------------//
//		get Scroll / Size
//----------------------------------------------------------------------------------------------------------------------------------------------------------------//
bp_danny_Object.getScrollX = function(){
	var returnVal;
	if(this.bOpera){
		returnVal = window.pageXOffset;
	}else if(document.all && document.getElementById && (document.compatMode == 'CSS1Compat')){
		returnVal = document.documentElement.scrollLeft;
	}else if(document.all){
		returnVal = document.body.scrollLeft;
	}else if(!document.all && (document.layers || document.getElementById)){
		returnVal = window.pageXOffset;
	}
	return returnVal;
}

bp_danny_Object.getScrollY = function(){
	var returnVal;
	if(this.bOpera){
		returnVal = window.pageYOffset;
	}else if(document.all && document.getElementById && (document.compatMode == 'CSS1Compat')){
		returnVal = document.documentElement.scrollTop;
	}else if(document.all){
		returnVal = document.body.scrollTop;
	}else if(!document.all && (document.layers || document.getElementById)){
		returnVal = window.pageYOffset;
	}
	return returnVal;
}

bp_danny_Object.getWidth = function(){
	var returnVal;
	if(this.bOpera){
		returnVal = document.body.clientWidth;
	}else if(bp_danny_Object.bSafari){
		returnVal = document.body.clientWidth;
	}else if(document.all && document.getElementById && (document.compatMode == 'CSS1Compat')){
		returnVal = document.documentElement.clientWidth;
	}else if(document.all){
		returnVal = document.body.clientWidth;
	}else if(!document.all && (document.layers || document.getElementById)){
		returnVal = window.bp_danny_Object.body.clientWidth;
		//returnVal = window.innerHeight;
	}
	return returnVal;
}


bp_danny_Object.getHeight = function(){
	var returnVal;
	if(this.bOpera){
		returnVal = document.body.clientHeight;
	}else if(document.all && document.getElementById && (document.compatMode == 'CSS1Compat')){
		returnVal = document.documentElement.clientHeight;
	}else if(document.all){
		returnVal = document.body.clientHeight;
	}else if(!document.all && (document.layers || document.getElementById)){
		returnVal = window.innerHeight;
	}
	//return returnVal-1;
	return returnVal;
}

//----------------------------------------------------------------------------------------------------------------------------------------------------------------//
//		set Replace / Resize
//----------------------------------------------------------------------------------------------------------------------------------------------------------------//
bp_danny_Object.replaceResize = function(){
	var mainContainer = document.getElementById("bp_danny_main");
	if(mainContainer && !this.bNotResize){	
		mainContainer.style.top = this.getScrollY()+"px";
		mainContainer.style.left = this.getScrollX()+"px";
		mainContainer.style.width = this.getWidth()+"px";
		mainContainer.style.height = this.getHeight()+"px";
	}
}
	//	-----------------------------------------------------------------------------------------------------------------------------------------------------------//
	//		WINDOW EVENTS
	//	-----------------------------------------------------------------------------------------------------------------------------------------------------------//
		if (window.addEventListener) window.addEventListener("resize",bp_dannyResize,false);
		if (window.attachEvent) window.attachEvent("onresize",bp_dannyResize); 
		if (window.addEventListener) window.addEventListener("scroll",bp_dannyResize,false);
		if (window.attachEvent) window.attachEvent("onscroll",bp_dannyResize); 

	//	-----------------------------------------------------------------------------------------------------------------------------------------------------------//
	//		START
	//	-----------------------------------------------------------------------------------------------------------------------------------------------------------//
	bp_danny_Object.attachBlogParts();
}
function bp_dannyResize(){
	bp_danny_Object.replaceResize();
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
//			
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
function bp_danny_open(){
	bp_danny_Object.hideOther();
	bp_danny_Object.attachMain();
}

function bp_danny_close(){
	bp_danny_Object.removeMain();
	bp_danny_Object.respawnOtherObject();
	getMovieName("bp_danny_float").bp_danny();
}

function getMovieName(movieName) {
		if (navigator.appName.indexOf("Microsoft") != -1) {
				return window[movieName]
		}
			else {
				return document[movieName]
		}
}

function Carsearch(zip1,zip2){
		sendParam = "http://map.nissan.co.jp/c/f?grp=nissanp3&uc=11&BT1=3&BT2=EA&BT3=&BT4=&BT8=%83m%81%5b%83g&zip="+zip1+"&zip="+zip2+"&search2.x=11&search2.y=12&";
		window.open(sendParam, 'myWindow');
		bp_danny_close();
}