﻿/**
 * FlashObject v1.3d: Flash detection and embed - http://blog.deconcept.com/flashobject/
 *
 * FlashObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof com=="undefined"){var com=new Object();}
if(typeof com.deconcept=="undefined"){com.deconcept=new Object();}
if(typeof com.deconcept.util=="undefined"){com.deconcept.util=new Object();}
if(typeof com.deconcept.FlashObjectUtil=="undefined"){com.deconcept.FlashObjectUtil=new Object();}
com.deconcept.FlashObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){
if(!document.createElement||!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=com.deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
this.useExpressInstall=_7;
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 com.deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=com.deconcept.FlashObjectUtil.getPlayerVersion(this.getAttribute("version"),_7);
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}
};
com.deconcept.FlashObject.prototype={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;
},createParamTag:function(n,v){
var p=document.createElement("param");
p.setAttribute("name",n);
p.setAttribute("value",v);
return p;
},getVariablePairs:function(){
var _19=new Array();
var key;
var _1b=this.getVariables();
for(key in _1b){_19.push(key+"="+_1b[key]);}
return _19;
},getFlashHTML:function(){
var _1c="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","PlugIn");
}
_1c="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_1c+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1d=this.getParams();
for(var key in _1d){_1c+=[key]+"=\""+_1d[key]+"\" ";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_1c+="flashvars=\""+_1f+"\"";}
_1c+="/>";
}else{
if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_1c="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_1c+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _20=this.getParams();
for(var key in _20){_1c+="<param name=\""+key+"\" value=\""+_20[key]+"\" />";}
var _22=this.getVariablePairs().join("&");
if(_22.length>0){_1c+="<param name=\"flashvars\" value=\""+_22+"\" />";
}_1c+="</object>";}
return _1c;
},write:function(_23){
if(this.useExpressInstall){
var _24=new com.deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_24)&&!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);}
}else{this.setAttribute("doExpressInstall",false);}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _23=="string")?document.getElementById(_23):_23;
n.innerHTML=this.getFlashHTML();
}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}}};
com.deconcept.FlashObjectUtil.getPlayerVersion=function(_26,_27){
var _28=new com.deconcept.PlayerVersion(0,0,0);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_28=new com.deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{
try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
for(var i=3;axo!=null;i++){
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
_28=new com.deconcept.PlayerVersion([i,0,0]);}}
catch(e){}
if(_26&&_28.major>_26.major){return _28;}
if(!_26||((_26.minor!=0||_26.rev!=0)&&_28.major==_26.major)||_28.major!=6||_27){
try{
_28=new com.deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
}catch(e){}}}
return _28;
};
com.deconcept.PlayerVersion=function(_2c){
this.major=parseInt(_2c[0])||0;
this.minor=parseInt(_2c[1])||0;
this.rev=parseInt(_2c[2])||0;
};
com.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;
};
com.deconcept.util={getRequestParameter:function(_2e){
var q=document.location.search||document.location.hash;
if(q){var _30=q.indexOf(_2e+"=");
var _31=(q.indexOf("&",_30)>-1)?q.indexOf("&",_30):q.length;
if(q.length>1&&_30>-1){
return q.substring(q.indexOf("=",_30)+1,_31);}}return "";
},removeChildren:function(n){
while(n.hasChildNodes()){
n.removeChild(n.firstChild);}}};
if(Array.prototype.push==null){
Array.prototype.push=function(_33){
this[this.length]=_33;
return this.length;};}
var getQueryParamValue=com.deconcept.util.getRequestParameter;
var FlashObject=com.deconcept.FlashObject;

/* 
============================================
DHTML Support
============================================
*/

// Detect Client Browser type
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
jsVersion = 1.1;

// Detect DOM
var isDHTML = 0;
var isAll = 0;
var isID = 0;

if (document.getElementById) {isID = 1; isDHTML = 1;}
else
{
	if (document.all) {isAll = 1; isDHTML = 1;}
}

function findDOM(objectID, withStyle) {
	if (withStyle == 1) 
	{
		if (isID) { return (document.getElementById(objectID).style); }
		else 
		{
			if (isAll) { return (document.all[objectID].style); }
		}
	}
	else
	{
		if (isID) { return (document.getElementById(objectID)); }
		else 
		{
			if (isAll) { return (document.all[objectID]); }
		}
	}
}

/*
===========================================
Event Handlers and Functions
===========================================
*/

function doStart()
{
	doSIFR();
	doSitecore();
        if (document.getElementsByTagName('title')[0].innerHTML == 'NETGEAR Management') {
        	loadImages();
        }
}

function getElementsByClassName(clsName) 
{ 
	var arr = new Array(); 
	var elems = document.getElementsByTagName("*");
	for ( var cls, i = 0; ( elem = elems[i] ); i++ )
	{
		if ( elem.className == clsName )
		{
			arr[arr.length] = elem;
		}
	}
	return arr;
}
function loadImages() {
	//pre-load images
		path = "/Upload/About/Management/";
		var lo_casual = new Image();
		lo_casual.src = path + "lo_casual.jpg";
		var falcon_casual = new Image();
		falcon_casual.src = path + "falcon_casual.jpg";
		var gorjanc_casual = new Image();
		gorjanc_casual.src = path + "gorjanc_casual.jpg";
		var liu_casual = new Image();
		liu_casual.src = path + "liu_casual.jpg";
		var merrill_casual = new Image();
		merrill_casual.src = path + "merrill_casual.jpg";
		var olson_casual = new Image();
		olson_casual.src = path + "olson_casual.jpg";
		var soares_casual = new Image();
		soares_casual.src = path + "soares_casual.jpg";
		var werdann_casual = new Image();
		werdann_casual.src = path + "werdann_casual.jpg";
		var williams_casual = new Image();
		williams_casual.src = path + "williams_casual.jpg";
	//end pre-load
	for (i = 0; i < document.images.length; i++) {	
		document.images[i].onmouseover = function() {
			if (this.id == "") {
				var name = this.name;
                        	if (this.src.indexOf('business') > -1 && name != "") {
					document.getElementById(name).src = '/upload/about/management/' + name + "_business.jpg";
				} else if (this.src.indexOf('casual') > -1 && name != "") {
					document.getElementById(name).src = eval(name + '_casual' + '.src');
				}   
			}
		}
	}
	for (i = 0; i < getElementsByClassName('up-a').length; i++) {
		getElementsByClassName('up-a')[i].onmouseover = function() {
			if (this.id == "") {
				var name = this.name;
				if (this.href.indexOf('business') > -1 && name != "") {
					document.getElementById(name).src = '/upload/about/management/' + name + "_business.jpg";
				} else if (this.href.indexOf('casual') > -1 && name != "") {
                                        document.getElementById(name).src = eval(name + '_casual' + '.src');
				}
			}
		}
	}
}
function doSIFR()
{
	sIFR.replaceElement(named({sSelector:".sIFR-Me", sFlashSrc:"/futuraMdBT.swf", sColor:"#333333", sLinkColor:"#333333", sBgColor:"#ffffff", sWmode:"transparent", sHoverColor:"#000080"}));	
	sIFR.replaceElement(named({sSelector:".sIFR-h1", sFlashSrc:"/futuraMdBT.swf", sColor:"#333333", sLinkColor:"#333333", sBgColor:"#ffffff", sWmode:"transparent", sHoverColor:"#000080"}));	
	sIFR.replaceElement(named({sSelector:".sIFR-ModelName", sFlashSrc:"/futuraBdBT.swf", sColor:"#333333", sLinkColor:"#333333", sBgColor:"#ffffff", sWmode:"transparent", sHoverColor:"#000080"}));	
	sIFR.replaceElement(named({sSelector:".sIFR-Yellow", sFlashSrc:"/futuraBdBT.swf", sColor:"#FDAD33", sLinkColor:"#FDAD33", sBgColor:"#ffffff", sWmode:"transparent", sHoverColor:"#FDAD33"}));
}

function doSitecore()
{
	if (findDOM("__PreviewMenu"))
	{
		objMenu = findDOM("__PreviewMenu", 1)
		
		objMenu.height = 1440;
		// next line for debugging Sitecore Client only Remove before flight
		objMenu.width = 700;
		objMenu.zIndex = 500;
	}
	else if (findDOM("__Debugger"))
	{
		objMenu = findDOM("__Debugger", 1)
		
		objMenu.height = 1440;
		// next line for debugging Sitecore Client only Remove before flight
		objMenu.width = 700;
		objMenu.zIndex = 500;
	}
}

function searchRedirect(Text, Href, Target)
{
	if (Text.length > 0)
	{
		Text = Text.replace(/ /gi, "+");
		Text = escape(Text);
		
		//alert("IndexOf $search$: " + Href.indexOf("$search$"));
		if (Href.indexOf("$search$") > -1)
		{
			Href = Href.replace("$search$", Text);
			//alert("Href after replacement: " + Href);
		}
		else
		{
			Href = Href + "?text=" + Text;
		}
		
		if (Target != "")
		{
			// We have to make a new window
			window.open(Href, Target);
		}
		else
		{
			location.href = Href;
		}
	}
}

function openPriceGrabber(url)
{
		openPopUp(url, 'winPriceGrabber', 'width=840,height=500,toolbar=0,location=1,directories=0,status=1,menuBar=0,scrollBars=1,resizable=1');
}

function open360(url)
{
		openPopUp(url, 'win360', 'resizable=0,width=650,height=450,left=400,top=300,toolbar=0,location=0,directories=0,status=1,menuBar=0,scrollBars=0');
}

function openDemo(url)
{
		openPopUp(url, 'winDemo', 'resizable=0,width=450,height=350,left=400,top=300,toolbar=0,location=0,directories=0,status=1,menuBar=0,scrollBars=0');
}

function openMorePhotos(url)
{
		openPopUp(url, 'winMorePhotos', 'width=300,height=400,left=400,top=300,toolbar=0,location=0,directories=0,status=1,menuBar=0,scrollBars=0,resizable=1');
}

function openCompare(url)
{
		openPopUp(url, 'winCompare', 'width=650,height=450,toolbar=0,location=0,directories=0,status=1,menuBar=0,scrollBars=0,resizable=0');
}

// For a custom pop-up, use this function
function openPopUp(url, name, options)
{
	newWindow = window.open(url, name, options);
	if (newWindow) 
	{
		newWindow.focus();
	}
}