/* SWFObject v1.5 */
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;

function changeInfo(text){
	document.getElementById("info").innerHTML=text;
}

//This is for the details page
	function preload_images(folder, myString){
	var string_split = myString.split(", ");
	if (document.images){
	var images = new Array(string_split.length);
	}
	
	if (string_split.length>1){
	document.getElementById("small_images").innerHTML += "<p class=\"grey_small\">+images</p>";
	}
	for (var i = 0; i<string_split.length; i++){
		images[i] = new Image(400, 600);
		images[i].src=folder+"/"+string_split[i];
			if (string_split.length>1){
			document.getElementById("small_images").innerHTML += ("<div class=\"cover\" id=\""+i+"\" onmouseover=\"swapImage('"+images[i].src+", "+i+", "+string_split.length+"'); \"/>")	
			}
	}
	if (string_split.length>1){
	document.getElementById("0").style.backgroundColor = "#333";
	}
	document.getElementById("main_image").src=images[0].src;
	}

		if (document.images) {
	var preImages = new Array()
	var currCount
	var loaded = new Array(),i,timerID
	var grid ="";
	
	}
	
	function swf_load(folder, swf_name){
		var text = "";
		var swf_path = folder+'/'+swf_name;
		text+= '<param name="movie" value="'+swf_path+'" />\n'
		text+= '<param name="quality" value="high" />\n'
		text+= '<param name="wmode" value="opaque" />\n'
		text+= '<param name="scale" value="default" />\n'
		text+= '<param name="salign" value="lt" /> \n'
		text+= '<param name="swfversion" value="8,0,0,0" /> \n'
		text+= '<!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. --> \n'
		text+= '<param name="expressinstall" value="Scripts/expressInstall.swf" /> \n'
		text+= '<!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. --> \n'
		text+= '<!--[if !IE]>--> \n'
		text+= '<object type="application/x-shockwave-flash" data="'+swf_path+'" width="400" height="400"> \n'
		text+= '<!--<![endif]--> \n'
		text+= '<param name="quality" value="high" /> \n'
		text+= '<param name="wmode" value="opaque" /> \n'
		text+= '<param name="scale" value="default" /> \n'
		text+= '<param name="salign" value="lt" /> \n'
		text+= '<param name="swfversion" value="8,0,0,0" /> \n'
		text+= '<param name="expressinstall" value="Scripts/expressInstall.swf" /> \n'
		text+= '<!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. --> \n'
		text+= '<div> \n'
		text+= '<h4>Content on this page requires a newer version of Adobe Flash Player.</h4> \n'
		text+= '<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p> \n'
		text+= '</div> \n'
		text+= '<!--[if !IE]>-->\n'
		text+= '</object>\n'
		text+= '<!--<![endif]-->\n'
		text+= '</object>\n'
		
		document.getElementById('flash').innerHTML = text
		
		}
	
	function grid_preload(folder, images_string, info_string){
	var image_split = images_string.split(", ");
	var info_split= info_string.split("; ");
	var file_name;
	currCount = 0;
	for (i = 0; i < image_split.length; i++) {
	preImages[i] = new Image(70,70)
	preImages[i].src = folder+"/"+image_split[i];
	file_name = basename(preImages[i].src, ".jpg");
	grid += ("<a href=\""+file_name+".html\"><span id=\"grid\"><img class=\"grid\" onmouseover=\"changeInfo(this.alt)\" onmouseout=\"changeInfo('&nbsp;')\" src=\""+preImages[i].src+"\" alt=\""+info_split[i]+"\"/></span></a>");
	}
	
	for (i = 0; i < preImages.length; i++) {
	loaded[i] = false
	}
	
	checkLoad()
	}
	
	function basename (path, suffix) {
    var b = path.replace(/^.*[\/\\]/g, '');
        if (typeof(suffix) == 'string' && b.substr(b.length-suffix.length) == suffix) {
        b = b.substr(0, b.length-suffix.length);
    }
    
    return b;}
		
	function checkLoad() {
		
		//document.getElementById("info").innerHTML+=currCount;
		if (currCount == preImages.length) {
			display_grid(grid)
			return
		}
		
		for (i = 0; i <= preImages.length; i++) {
			if (loaded[i] == false && IsImageOk(preImages[i])) {
				loaded[i] = true
				//eval("document.img" + currCount + ".src=dots[1].src")
				currCount++
				//document.getElementById("info").innerHTML=currCount
			
			}
			/*currCount = IsImageOk(preImages[i])
			document.getElementById('info').innerHTML = (preImages[i].src+" "+currCount)
			timerID = setTimeout("", 10)*/
		}

		
	timerID = setTimeout("checkLoad()",10)
	}
	
	function IsImageOk(img) {
    // During the onload event, IE correctly identifies any images that
    // weren't downloaded as not complete. Others should too. Gecko-based
    // browsers act like NS4 in that they report this incorrectly.
    if (!img.complete) {
        return false;
    }

    // However, they do have two very useful properties: naturalWidth and
    // naturalHeight. These give the true size of the image. If it failed
    // to load, either of these should be zero.
    if (typeof img.naturalWidth != "undefined" && img.naturalWidth == 0) {
        return false;
    }

    // No other way of checking: assume it's ok.
    return true;
}

	
/*Pre loads the grid so to avoid the waterfall.  send it the folder, images and info to load*/
/*
function grid_preload(folder, images_string, info_string){
	var image_split = images_string.split(", ");
	var info_split= info_string.split("; ");
	if (document.images){
		if (!document.image_array){		
			document.image_array = new Array(); 
			loaded = false;
			}
		
	var grid = "";	
	for (var i = 0; i<image_split.length; i++){
		document.image_array[i] = new Image(70, 70);
		document.image_array[i].src=folder+"/"+image_split[i];
		grid += ("<a href=\"detail.html\"><img class=\"grid\" onmouseover=\"changeInfo(this.alt)\" onmouseout=\"changeInfo('&nbsp;')\" src=\""+document.image_array[i].src+"\" alt=\""+info_split[i]+"\"/></a>");
		}
		
		
		for (i=0; i<document.image_array.length; i++){
			if (document.image_array[i].complete){
				alert (document.image_array[i]+"is loaded")
			}
		
		timerID = setTimeout("", 10)
	}
		
		display_grid(grid);
	}
	}

function checkLoad(){
	for (i = 0; i<=document.image_array.length; i++){
		 if (document.loaded == false && document.image_array.complete){
			 document.loaded = true;
		 }
	}
	
	return document.loaded;
}
*/

//May not need this	
function display_grid(html_grid){
	document.getElementById('info').innerHTML = "&nbsp;";
	//document.getElementById('info').style.fontSize="1.5em";
	obj = document.getElementById('main');
	setOpacity(obj, 0);
	obj.innerHTML = html_grid;
	fadeIn('main', 0);
}

function fadeIn(objId,opacity) {
  if (document.getElementById) {
    obj = document.getElementById(objId);
    if (opacity <= 100) {
      setOpacity(obj, opacity);
      opacity += 10;
      window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 10);
    }
  }
}

function setOpacity(obj, opacity) {
  opacity = (opacity == 100)?99.999:opacity;
  
  // IE/Win
  obj.style.filter = "alpha(opacity:"+opacity+")";
  
  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;
  
  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/100;
  
  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/100;
}


function swapImage(image_file){
	var string_split = image_file.split(", ");
	var img = string_split[0]
	var box_id = string_split[1]
	var box_count = string_split[2]
	document.getElementById("main_image").src = img
	
	for (var i = 0; i < box_count; i++){
		if (i == box_id){
			document.getElementById(box_id).style.backgroundColor="#333"
		} else { document.getElementById(i).style.backgroundColor="#CCC"
		}
	}
	
}

// Footer
function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	} else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		} else {
		if (document.body && document.body.clientHeight) {
			windowHeight = document.body.clientHeight;
				}
			}
		}
	return windowHeight;
	}
	
function setFooter() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {
			var contentHeight = document.getElementById('page').offsetHeight;
			var footerElement = document.getElementById('footer');
			var footerHeight  = footerElement.offsetHeight;
			if (windowHeight - (contentHeight + footerHeight) >= 0) {
				footerElement.style.position = 'relative';
				footerElement.style.top = (windowHeight - (contentHeight + footerHeight)) + 'px';
			} else {
				footerElement.style.position = 'static';
				}
			}
		}
	}
	
	window.onload = function() {setFooter();}
	
	window.onresize = function() {setFooter();}

//scroll
function initScrollLayer() {
	var wndo = new dw_scrollObj('wn', 'lyr1');
	wndo.bSizeDragBar = false;
	wndo.setUpScrollbar("dragBar", "track", "v", 0, 0);
	dw_scrollObj.GeckoTableBugFix('wn'); 
}

//open in tab
function openURL(sURL)
{
	if( opener != null ) {
		opener.location.href = sURL;
		opener.focus();
	} else {
		window.open( sURL, '_blank' );
	}
}

/*
//toys pop-up
function toys(url,name) {
	new_window = window.open('_assets/_swf/_issues/44/toys.php','Visionaire Toys','menubar,resizable=no,dependent,status=no,scrollbars=no,width=320,height=209,left=0,top=0')
}

//private pop-up
function privatepop(url,name) {
	new_window = window.open('_assets/_feature/private/private.php','Visionaire Private','menubar,resizable=no,dependent,status=no,scrollbars=no,width=800,height=335,left=0,top=0')
}
function soundpop(url,name) {
	new_window = window.open('sound.htm','Visionaire Sound','menubar,resizable=no,dependent,status=no,scrollbars=no,width=720,height=468,left=0,top=0')
}
*/

// trunk pop-up
//prob don't need this MSS Jan 30, 2010
function pop_up() {
	new_window = window.open('_assets/_feature/trunk/trunk.php','Visionaire Goyard Trunk','menubar,resizable=no,dependent,status=no,scrollbars=no,width=700,height=439,left=0,top=0');
	
	new_window2 = window.open('_assets/_feature/art_basel/art_basel.html','Visionaire And Land at Art Basel Miami Beach','menubar,resizable=no,dependent,status=no,scrollbars=no,width=700,height=440,left=20,top=50');
}


//or this MSS Jan 30, 2010
function eabpop(url,name) {
	new_window = window.open('/eab/eab.html','Visionaire Private','menubar,resizable=no,dependent,status=no,scrollbars=no,width=500,height=360,left=0,top=0');
}

// Change Body Background Color
function changeBgColor(newBgColor)
{
	document.body.style.background = newBgColor;
	document.getElementById('header').style.background = newBgColor;
	document.getElementById('page').style.background = newBgColor;
	document.getElementById('alt').style.bgColor = newBgColor;
}



// Issue 57
function changeHeight(newHeight) {
	e = document.getElementById("alt");
	e.style.height = newHeight + 'px';
}
