function openFashionSlideshow(url) {
    
    if (BrowserDetect.browser == "Explorer" && BrowserDetect.version == "6")
    {
        var slideShowWindow = window.open(url,'fashionShowSlideshow','menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,width=931,height=650'); 
	}
    else if (BrowserDetect.browser == "Firefox")
    {
        var slideShowWindow = window.open(url,'fashionShowSlideshow','menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,width=915,height=650');
    }
    else if (BrowserDetect.browser == "Safari")
    {
        var slideShowWindow = window.open(url,'fashionShowSlideshow','menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,width=930,height=650');
    }
    else 
    {
        var slideShowWindow = window.open(url,'fashionShowSlideshow','menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,width=920,height=650');
    } 
}

function openDetailSlideshow(url) {

    if (BrowserDetect.browser == "Explorer" && BrowserDetect.version == "6")
    {
        var slideShowDetailWindow = window.open(url,'detailSlideshow','menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,width=931,height=650'); 
    }
    else if (BrowserDetect.browser == "Firefox")
    {
        var slideShowDetailWindow = window.open(url,'detailSlideshow','menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,width=915,height=650');
    }
    else if (BrowserDetect.browser == "Safari")
    {
        var slideShowDetailWindow = window.open(url,'detailSlideshow','menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,width=930,height=650');
    }
    else 
    {
        var slideShowDetailWindow = window.open(url,'detailSlideshow','menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,width=920,height=650'); 
    } 
    
}

var SeeAllDesignersFlyout = { };

SeeAllDesignersFlyout.toggle = function() {
	var flyoutNode = document.getElementById("designer_flyout");

	if (flyoutNode.enabled) /* flyout showing; disable it */ {
		flyoutNode.enabled = false;
		var containerNode = document.getElementById("sidebar_hed");
		
		flyoutNode.style.position = flyoutNode.style.top = flyoutNode.style.left = flyoutNode.style.zIndex = "";
		flyoutNode.style.display = "none";
		
		containerNode.appendChild(flyoutNode);
	}
	else /* flyout not showing; enable it */ {
		flyoutNode.enabled = true;
		var containerNode = document.getElementById("container");
		
		flyoutNode.style.position = "absolute";
		flyoutNode.style.top = "41px";
		flyoutNode.style.left = "75px";
		flyoutNode.style.zIndex = "10000";
		
		containerNode.appendChild(flyoutNode);
		
		flyoutNode.style.display = "block";
	}
};

SeeAllDesignersFlyout.onload = function() 	{

	Handler.add(document.getElementById("see_all_designers_link"), "click", SeeAllDesignersFlyout.toggle);
	Handler.add(getElements("close_button", "div", document.getElementById("flyout_hed"))[0], "click", SeeAllDesignersFlyout.toggle);

	var nav_links = getElements("nav_link", "div", document.getElementById("alphabetical_nav"));
	for (var i = 0; i < nav_links.length; ++i) {
		Handler.add(nav_links[i], "click", function() {
			var targets = getElements("nav_target", "h5", document.getElementById("alphabetical_list"));
			for (var i = 0; i < targets.length; ++i) {
				if (targets[i].innerHTML == this.innerHTML) {
					document.getElementById("alphabetical_list").scrollTop = targets[i].offsetTop;
				}
			}
		});
	}

};
runOnLoad(SeeAllDesignersFlyout.onload);

runOnLoad(function() {
	var content_well = document.getElementById("content_well");
	var sidebar_col = document.getElementById("sidebar_col");
	if (content_well.scrollHeight > sidebar_col.scrollHeight)
		sidebar_col.style.height = content_well.scrollHeight + "px";
	else
		content_well.style.height = sidebar_col.scrollHeight + "px";
});

/*from fullscreen.js*/
var FLASH_CONTENT_VERSION = 9;
var FLASH_CLASS_ID = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000';
var FLASH_CODEBASE = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0';
var FLASH_PLUGINTYPE = 'application/x-shockwave-flash';
var FLASH_PLUGINSPAGE = 'http://www.macromedia.com/go/getflashplayer';
var FLASH_ALLOWSCRIPTACCESS = 'sameDomain';
var FLASH_AUTOPLAY = 'true';
var FLASH_LOOP = 'false';
var FLASH_MENU = 'false';
var FLASH_LIVECONNECT = 'false';
var FLASH_QUALITY = 'high';
var FLASH_DEFAULT_BGCOLOR = '#ffffff';
var FLASH_DEFAULT_ALIGN = 'middle';
var FLASH_DEFAULT_ID = 'styleFlash';

var windowWidth =  screen.availWidth;
var windowHeight = screen.availHeight;

var Navigator = {
  _getVersion: function (a, b) {
    var t = navigator.userAgent.split(a)[1];
    return (t) ? t.split(b)[0] : false;
  },
  isOpera: function () {
    return (
      (window.opera) ?
        (document.createElementNS) ?
          (document.createCDATASection) ?
            (document.styleSheets) ? 9 : 8
          : 7
        : 6
      : false
    );
  },
  isSafari2: function () {
    return (document.createCDATASection && document.createElementNS) ? Navigator._getVersion('AppleWebKit/', '(') : false;
  },
  isKDE: function () {
    return (document.createCDATASection && document.createElementNS) ? Navigator._getVersion('Konqueror/', ';') : false;
  },
  isGecko: function () {
    return (document.createCDATASection && document.createElementNS) ? Navigator._getVersion('Gecko/', ' ') : false;
  },
  isNN4: function () {
    return (document.layers && typeof document.layers == 'object') ? true : false;
  },
  isWinIE: function () {
    return (
      /*@cc_on @if (@_win64 || @_win32 || @_win16)
      (document.getElementsByTagName) ?
        (@_jscript_version > 5.6) ? 7 :
        (@_jscript_version == 5.6) ? 6 :
        (@_jscript_version == 5.5) ? 5.5 :
        5
      : 4
      @else@*/false/*@end @*/
    );
  },
  isMac: function () {
    var av = navigator.appVersion.toLowerCase();
    return ( av.indexOf( 'mac' ) != -1 );
  }
};
var isOpera = Navigator.isOpera();
var isSafari2 = Navigator.isSafari2();
var isKDE = Navigator.isKDE();
var isGecko = Navigator.isGecko();
var isNN4 = Navigator.isNN4();
var isWinIE = Navigator.isWinIE();
var isMac = Navigator.isMac();

function openFullScreen(url) {
  var screenWidth = screen.width;
  var screenHeight = screen.height;
  if (screenHeight <= 600) {
    url = url.replace(/\.html/i,"_small.html");
    return false;
  }
  var winSlideshow = "winSlideshow";
  var features = "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=" + windowWidth + ",height=" + ((isSafari2) ? windowHeight-24 : windowHeight);
  window.open(url,winSlideshow,features);
}

function resizeThis() {
  if (isSafari2) {
    window.moveTo(36,0);
  }
  else {
    window.moveTo(0,0);
  }
  if (document.all) {
    top.window.resizeTo(screen.availWidth,screen.availHeight);
  }
  else if (document.layers || document.getElementById) {
    if (top.window.outerHeight < screen.availHeight || top.window.outerWidth < screen.availWidth) {
      top.window.outerHeight = screen.availHeight;
      top.window.outerWidth = screen.availWidth;
    }
  }
}

function getQueryParam(param) {
  var q = document.location.search || document.location.hash;
  if(q) {
    var pairs = q.substring(1).split("&");
    for (var i=0; i < pairs.length; i++) {
      if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
        return pairs[i].substring((pairs[i].indexOf("=")+1));
      }
    }
  }
}

function ControlVersion() {
  var version;
  var axo;
  var e;
    // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
  try {
      // version will be set for 7.X or greater players
    axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
    version = axo.GetVariable("$version");
  }
  catch (e) {
  }
  if (!version) {
    try {
        // version will be set for 6.X players only
      axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
        // installed player is some revision of 6.0
        // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
        // so we have to be careful. 
        // default to the first public version
      version = "WIN 6,0,21,0";
        // throws if AllowScripAccess does not exist (introduced in 6.0r47)   
      axo.AllowScriptAccess = "always";
        // safe to call for 6.0r47 or greater
      version = axo.GetVariable("$version");
    }
    catch (e) {
    }
  }
  if (!version) {
    try {
        // version will be set for 4.X or 5.X player
      axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
      version = axo.GetVariable("$version");
    } catch (e) {
    }
  }
  if (!version) {
    try {
        // version will be set for 3.X player
      axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
      version = "WIN 3,0,18,0";
    }
    catch (e) {
    }
  }
  if (!version) {
    try {
        // version will be set for 2.X player
      axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
      version = "WIN 2,0,0,11";
    }
    catch (e) {
      version = -1;
    }
  }
  return version;
}

function flashWrite(strMovie, divName, divLayer, intWidth, intHeight, hexBgcolor, strId, strAlign, intFlashVersion, strPlay, strLoop, strMenu, auxVars) {
  var blnPluginPresent = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
  if ( blnPluginPresent ) {
    var words = navigator.plugins["Shockwave Flash"].description.split(" ");
      for (var i = 0; i < words.length; ++i) {
        if (isNaN(parseInt(words[i])))
          continue;
        var intPluginVersion = words[i]; 
      }
    blnFlashCanPlay = intPluginVersion >= FLASH_CONTENT_VERSION;
  }
  else if (isWinIE) {
    document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
    document.write('on error resume next \n');
    document.write('blnFlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & FLASH_CONTENT_VERSION)))\n');
    document.write('</SCR' + 'IPT\> \n');
  }
  if ( blnFlashCanPlay ) {
    hexBgcolor = (hexBgcolor) ? hexBgcolor : FLASH_DEFAULT_BGCOLOR;
    strId = (strId) ? strId : FLASH_DEFAULT_ID;
    strAlign = (strAlign) ? strAlign : FLASH_DEFAULT_ALIGN;
    intFlashVersion = (intFlashVersion) ? intFlashVersion : FLASH_CONTENT_VERSION;
    strPlay = (strPlay) ? strPlay : FLASH_AUTOPLAY;
    strLoop = (strLoop) ? strLoop : FLASH_LOOP;
    strMenu = (strMenu) ? strMenu : FLASH_MENU;
    divLayer = (divLayer) ? divLayer : divLayer;
    document.write('<OBJECT classid="' + FLASH_CLASS_ID + '"');
    document.write(' codebase="' + FLASH_CODEBASE + '" ');
    document.write(' ID="' + strId + '" WIDTH="' + intWidth + '" HEIGHT="' + intHeight + '" ALIGN="' + strAlign + '">');
    document.write(' <PARAM NAME="movie" VALUE="' + strMovie + '"?dartSZ=' + dart["sz"] + '&dart_site=' + dart["site"] + '&dart_zone=' + dart["zone"] + '&dart_target=' + dart["target"] + '&dart_dcopt=' + dart["dcopt"] + '&dart_url=' + escape(dart["url"]) + '"> ');
    document.write(' <PARAM NAME="quality" VALUE="' + FLASH_QUALITY + '"><PARAM NAME="wmode" VALUE="transparent"><PARAM NAME="MENU" VALUE="' + strMenu + '"><PARAM NAME="LOOP" VALUE="' + strLoop + '"><PARAM NAME="PLAY" VALUE="' + strPlay + '"><PARAM NAME="bgcolor" VALUE="' + hexBgcolor + '"> '); 
    document.write(' <PARAM NAME="FlashVars" VALUE="'+auxVars+'&trend_id='+getQueryParam("t_id")+'&dartSZ=' + dart["sz"] + '&dart_site=' + dart["site"] + '&dart_zone=' + dart["zone"] + '&dart_target=' + dart["target"] + '&dart_dcopt=' + dart["dcopt"] + '&dart_url=' + escape(dart["url"]) + '"> ');
    document.write(' <EMBED src= "' + strMovie + '?dartSZ=' + dart["sz"] + '&dart_site=' + dart["site"] + '&dart_zone=' + dart["zone"] + '&dart_target=' + dart["target"] + '&dart_dcopt=' + dart["dcopt"] + '&dart_url=' + escape(dart["url"]) + '" ');
    document.write(' flashvars="'+auxVars+'&trend_id='+getQueryParam("t_id")+'" quality="' + FLASH_QUALITY + '" play="' + strPlay + '" loop="' + strLoop + '" menu="' + strMenu + '" bgcolor="' + hexBgcolor + '"  wmode="transparent" ');
    document.write(' swLiveConnect="' + FLASH_LIVECONNECT + '" WIDTH="' + intWidth + '" HEIGHT="' + intHeight + '" NAME="' + strId + '" ALIGN="' + strAlign + '"');
    document.write(' TYPE="' + FLASH_PLUGINTYPE + '" PLUGINSPAGE="' + FLASH_PLUGINSPAGE + '">');
    document.write(' </EMBED>');
    document.write(' </OBJECT>');
  }
  else {
    document.getElementById(divName).style.display="block";
  }
}

function flashWrite2(strMovie, divName, divLayer, intWidth, intHeight, hexBgcolor, strId, strAlign, intFlashVersion, strPlay, strLoop, strMenu, auxVars) {
  intFlashVersion = (intFlashVersion) ? intFlashVersion : FLASH_CONTENT_VERSION;
  var blnPluginPresent = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
  if ( blnPluginPresent != 0 ) { 
    var words = navigator.plugins["Shockwave Flash"].description.split(" ");
    for (var i = 0; i < words.length; ++i) {
      if (isNaN(parseInt(words[i]))) {
        continue;
      }
      var intPluginVersion = words[i]; 
    }
    intPluginVersion = parseInt(intPluginVersion);  
  }
    // Internet Explorer does not properly support navigator object
  if ( blnPluginPresent == 0 && document.all ) {
    intPluginVersion = ControlVersion();            
    if ( intPluginVersion != -1 ) {    
      // Given "WIN 2,0,0,11"
      tempArray        = intPluginVersion.split(" ");  // ["WIN", "2,0,0,11"]
      tempString       = tempArray[1];     // "2,0,0,11"
      versionArray     = tempString.split(",");  // ['2', '0', '0', '11']      
      intPluginVersion = versionArray[0];    
    }
  }
  if (intPluginVersion >= intFlashVersion) {
    blnFlashCanPlay = true;
  }
  if ( blnFlashCanPlay ) {
    hexBgcolor = (hexBgcolor) ? hexBgcolor : FLASH_DEFAULT_BGCOLOR;
    strId = (strId) ? strId : FLASH_DEFAULT_ID;
    strAlign = (strAlign) ? strAlign : FLASH_DEFAULT_ALIGN;
    strPlay = (strPlay) ? strPlay : FLASH_AUTOPLAY;
    strLoop = (strLoop) ? strLoop : FLASH_LOOP;
    strMenu = (strMenu) ? strMenu : FLASH_MENU;
    divLayer = (divLayer) ? divLayer : divLayer;
    intWidth = (intWidth) ? intWidth : windowWidth-300;
    intHeight = (intHeight) ? intHeight : windowHeight - 44;
    if (isGecko && isMac) intHeight = windowHeight - 40;
    if (isWinIE) intHeight = windowHeight - 25;
    if (isSafari2) {
     intHeight = windowHeight - 23;
    }
    document.write('<OBJECT classid="' + FLASH_CLASS_ID + '"');
    document.write(' codebase="' + FLASH_CODEBASE + '" ');
    document.write(' ID="' + strId + '" WIDTH="' + intWidth + '" HEIGHT="100%" ALIGN="' + strAlign + '">');
    document.write(' <PARAM NAME="movie" VALUE="' + strMovie + '"?dartSZ=' + dart["sz"] + '&dart_site=' + dart["site"] + '&dart_zone=' + dart["zone"] + '&dart_target=' + dart["target"] + '&dart_dcopt=' + dart["dcopt"] + '&dart_url=' + escape(dart["url"]) + '"> ');
    document.write(' <PARAM NAME="quality" VALUE="' + FLASH_QUALITY + '"><PARAM NAME="wmode" VALUE="transparent"><PARAM NAME="MENU" VALUE="' + strMenu + '"><PARAM NAME="LOOP" VALUE="' + strLoop + '"><PARAM NAME="PLAY" VALUE="' + strPlay + '"><PARAM NAME="bgcolor" VALUE="' + hexBgcolor + '"> '); 
    document.write(' <PARAM NAME="FlashVars" VALUE="'+auxVars+'&flashWidth='+intWidth+'&flashHeight=' + intHeight + '&trend_id='+getQueryParam("t_id")+'&dartSZ=' + dart["sz"] + '&dart_site=' + dart["site"] + '&dart_zone=' + dart["zone"] + '&dart_target=' + dart["target"] + '&dart_dcopt=' + dart["dcopt"] + '&dart_url=' + escape(dart["url"]) + '"> ');
    document.write(' <EMBED src= "' + strMovie + '?flashWidth=' + intWidth + '&flashHeight='+intHeight+'&dartSZ=' + dart["sz"] + '&dart_site=' + dart["site"] + '&dart_zone=' + dart["zone"] + '&dart_target=' + dart["target"] + '&dart_dcopt=' + dart["dcopt"] + '&dart_url=' + escape(dart["url"]) + '" ');
    document.write(' flashvars="'+auxVars+'&flashWidth='+intWidth+'&flashHeight='+intHeight+'&trend_id='+getQueryParam("t_id")+'" quality="' + FLASH_QUALITY + '" play="' + strPlay + '" loop="' + strLoop + '" menu="' + strMenu + '" bgcolor="' + hexBgcolor + '"  wmode="transparent" ');
    document.write(' swLiveConnect="' + FLASH_LIVECONNECT + '" WIDTH="' + intWidth + '" HEIGHT=' + intHeight + ' NAME="' + strId + '" ALIGN="' + strAlign + '"');
    document.write(' TYPE="' + FLASH_PLUGINTYPE + '" PLUGINSPAGE="' + FLASH_PLUGINSPAGE + '">');
    document.write(' </EMBED>');
    document.write(' </OBJECT>');
  }
  else {
    document.getElementById(divName).style.display="block";
  }
}

function addLoadEvent(func) {
  var oldOnload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  }
  else {
    window.onload = function() {
      oldOnload();
      func();
    }
  }
}

function alertTest(args) {
  alert("alertTest: " + args);
}

function gotoParent(plink) {
    opener.location = plink;
    window.close();
}








CNP.fashionshow = CNP.fashionshow || {}

CNP.fashionshow.designerAd = (function(){
	
	init = function(){
		//var designers = ["F2009RTW-PLIM", "F2009RTW-BALENCIA"],
		var designers = ["S2010RTW-ANNASUI", "S2010RTW-VTAM"],
			ad_pos,
			ad_designer;
		
		jQuery.each(designers, function(i, val){
			ad_designer = val.replace("-", "_");
			ad_pos = jQuery("body[id$='"+ad_designer+"']");
			if(ad_pos.length > 0){
				createAd();
			}
		})
				
	}
	
	createAd = function(){
		var ad = jQuery(document.createElement('A')),
			ad_pos = jQuery("h2.designer_name");
		
		ad_pos.css({
			"position" :"relative"
		})
		
		ad.attr({
			href : 'http://ad.doubleclick.net/clk;217822095;40265048;e',
			target : "_blank"
		}).css({
			"background" : "url(/promo/hp/091109_promo.JPG)",
			"display" : "block",
			"height" : "33px",
			"position" : 'absolute',
			"right" : "5px",
			"top" : "5px",
			"width" : "245px"
		})
		
		jQuery(ad).appendTo(ad_pos);
		
	}
	
	jQuery(document).ready(function(){
		init();
	});
	
	return {}
	
	
})();
