/*DW NewsV2 workaround START*/
var url = location.href;
if (url.indexOf("&M=NewsV2") > -1) location.replace(url.replace("&M=NewsV2", ""));
/*DW NewsV2 SLUT*/

var shareNmore, swfPictureContainer, swfPicture, externalLinks;
jQuery(document).ready(function () {
  if (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 6.0") != -1) {
    //F?lgende b?r optimeres
    jQuery("#shareNmore").find("img").css("visibility", "visible");
    jQuery("#shareNmore").css("background", "#dc707a").find("ul ul li").css("width", "10px").find("a").css("background", "none").pngFix()
    jQuery("#logo").pngFix();
    jQuery("#shareNmore ul li").not("#shareNmore ul ul li").css("height", "10px");
    jQuery("#shareNmore ul li.share").css("left", "120px");
  }
  externalLinks = jQuery("a[href^=http]").click(function () {
    //	externalLinks=jQuery("#shareNmore ul li.share a,#shareNmore ul li a[title^=BTX],#shareNmore ul li a[title^=Fransa]").click( function(){  	
    window.open(this.href, '', '');
    return false;
  });
  if (screen.height > 1050 && screen.width > 1680) {
    //jQuery("#wrapper").css("height","900px").css("width","1680px").css("margin-left","-840px").css("left","50%").css("top","0");
  }
});
jQuery(window).load(function () {
  setTimeout(function () { intiShareNmore(); }, 750);
});
function intiShareNmore() {
  var ie6 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 6.0") != -1);
  if (document.referrer.indexOf(location.host) > -1) {
    shareNmore = jQuery("#shareNmore").animate({ right: "-123px" }, 100).animate({ right: "-160px" }, 200).animate({ right: "-155px" }, 100);
  }
  else {
    shareNmore = jQuery("#shareNmore").css("right", "0").animate({ right: "15px" }, 200).animate({ right: "-165px" }, 300).animate({ right: "-155px" }, 200);
  }
  shareNmore.find("h4").click(function () {
    if (shareNmore.css("right") == "-155px") { shareNmore.animate({ right: "-160px" }, 100).animate({ right: "-15px" }, 400).animate({ right: "-30px" }, 100); }
    else { shareNmore.animate({ right: "-5px" }, 100).animate({ right: "-160px" }, 400).animate({ right: "-155px" }, 100); }
  });
}
function showPictureContainer(urlPicture) {
  swfPictureContainer = jQuery("#swfPictureContainer").css("top", "0").css("opacity", "0").animate({ opacity: "1" }, 900);
  swfPicture = swfobject.getObjectById("swfPicture");
  swfPicture.catchThisPicture(urlPicture);
}
function hidePictureContainer() {
  swfPictureContainer.animate({ opacity: "0" }, 300).animate({ top: "999em" }, 100);
}
function onPaperLoad() { return; }
function getURLParam(strParamName) {
  return getParameterFromLink(strParamName, window.location.href);
}
function getParameterFromLink(strParamName, link) {
  var strReturn = "";
  var strHref = link;
  if (strHref.indexOf("?") > -1) {
    var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
    var aQueryString = strQueryString.split("&");
    for (var iParam = 0; iParam < aQueryString.length; iParam++) {
      if (aQueryString[iParam].indexOf(strParamName.toLowerCase() + "=") > -1) {
        var aParam = aQueryString[iParam].split("=");
        strReturn = aParam[1];
        break;
      }
    }
  }
  return unescape(strReturn);
}


function writeFransaClubIframe() {
  var iframeSrc, iframeaction = getURLParam("iframeaction");
  if (iframeaction == "login") { iframeSrc = "http://www.look4fashion.dk/mails/kundeklub/fransa/login.php"; }
  else if (iframeaction == "afmeld") { iframeSrc = "http://www.look4fashion.dk/mails/kundeklub/fransa/afmeld.php"; }
  else if (iframeaction == "login-no") { iframeSrc = "http://www.look4fashion.dk/mails/kundeklub/fransa/no_modul/login.php"; }
  else if (iframeaction == "afmeld-no") { iframeSrc = "http://www.look4fashion.dk/mails/kundeklub/fransa/no_modul/afmeld.php"; }
  else { iframeSrc = "http://www.look4fashion.dk/mails/kundeklub/fransa/index.php"; }
  document.write('<iframe border="0" frameborder="0" scrolling="no" allowtransparency="true" src="' + iframeSrc + '"></iframe>');
}
