function AttributeOptionsValidate(AElement, AProductInventoryLayoutType)
{
  var LProductInventory;
  if (AProductInventoryLayoutType == 'Horizontal')
    LProductInventory = AElement.parentNode.parentNode;
  else
    LProductInventory = AElement.parentNode.parentNode.parentNode.parentNode;
  var LAttributeOptions = LProductInventory.getElementsByTagName('select');
  for (var j = 0; j < LAttributeOptions.length; j++)
    if (LAttributeOptions[j].value == '')
      return false;

  return true;
}

function ProductToShoppingCartAdd_Validate()
{
  var LProductInventories = document.getElementById('tblProductInventories');

  if (LProductInventories)
  {
    var LInputs = LProductInventories.getElementsByTagName('input');
    for (var i = 0; i < LInputs.length; i++)
      if ((LInputs[i].type != 'hidden') && (LInputs[i].name.indexOf('FInvQty') != -1))
        if (isNaN(LInputs[i].value) || (LInputs[i].value <= 0)
          || !(AttributeOptionsValidate(LInputs[i], document.frmProductEdit.AttributesLayout.value)))
        {
          if (LInputs[i].value == 'out-of-stock')
            alert('A product with current set of attributes is out-of-stock!');
          else
            alert('Please, enter correct values of product attributes and quantity!');
          return false;
        }
    return true;
  }
  else
    return true;
}

function SC_TableAdjust()
{
  var LAdjustableElements = document.getElementsByName('tdAdjustable');
  for (var i = 0; i < LAdjustableElements.length; i++)
    LAdjustableElements[i].colSpan = LAdjustableElements[i].colSpan + 1;
}

function SC_Update(ASection, AAction)
{
  var LForm = ElementGet('frmShoppingCart');
  if (
    LForm.elements['F5ZIP'] && !FieldValidate(LForm.elements['F5ZIP'], fvtZIP, 'ZIP', '', false) ||
    !SC_QuantityValidate(LForm)
  )
    return;
  if (SC_SkipAttributesValidation() || SC_Validate())
  {
    LForm.S.value = ASection;
    if (typeof(AAction) != 'undefined')
      LForm.A.value = AAction;
    if (frmCanSubmit(LForm))
      LForm.submit();
  }
}

function SC_IsDirtyCheck()
{
  if (document.getElementsByName('IsDirty')[0].value == 'true')
  {
    if (confirm('Some of product items have been changed.\nUpdate cart to check products availability now?'))
      SC_Update(SPMSC_Show, 'S');
    return false;
  }
  else
    return true;
}

function SC_ProceedToCheckout()
{
  if (SC_Validate() && SC_IsDirtyCheck())
    SC_Confirm(ElementGet('frmShoppingCart'));
}

function SC_ItemValidate(AForm, APKV)
{
  var LPrefix = 'F' + APKV;
  with (AForm)
    return (
      (
        !elements[LPrefix + 'Colors']
        ||
        FieldValidateEx(elements[LPrefix + 'Colors'], elements[LPrefix + 'Colors'].value != '', 'Please select the color for each product where it is available and then click on the "Update Cart" button')
      )
      &&
      (
        !elements[LPrefix + 'Sizes']
        ||
        FieldValidateEx(elements[LPrefix + 'Sizes'], elements[LPrefix + 'Sizes'].value != '', 'Please select the size for each product where it is available and then click on the "Update Cart" button')
      )
    );
}

function SC_Confirm(AForm)
{
  for (var i = 0; i < AForm.elements.length; i++)
    if ((AForm.elements[i].type == "text")
      &&
      AForm.elements[i].name.indexOf('PrQty') != -1
    )
      if (!SC_ItemValidate(AForm, AForm.elements[i].name.substring('PrQty'.length, AForm.elements[i].name.length)))
        return;
  with (AForm)
  {
    S.value = SPMSC_Validate;
    submit();
  }
}

function SC_ProductAdd(APKV)
{
  var LCtrlQty = eval('frmProducts.PrQty' + APKV);
  var LQty = 1;
  if (LCtrlQty && LCtrlQty.value)
    LQty = LCtrlQty.value;
  document.location = WSA_URLGet(SPMSC_Show, 'S',
  [
    'Add', 1,
    'PrQty' + APKV, LQty,
    'UseID', 0
  ]);
}

function SC_ProductDelete(APKV)
{
  if (document.getElementsByName('IsDirty')[0].value == 'true')
  {
    alert('Some of product items have been changed.\nYou should update cart to save current settings.');
    return;
  }

  if (confirm('Are you sure you want to delete this item from your shopping cart?'))
    document.location = WSA_URLGet(SPMSC_Show, 'S', ['PrQty' + APKV, 0]);
}

function PR_Save()
{
  with (ElementGet('frmProductReview'))
    if (
      FieldValidateEx(FReviewRating[0], CB_CheckedCountGet(FReviewRating) != 0, 'Rating is required; please specify it')
      &&
      FieldValidate(FReviewTitle, fvtNotEmpty, 'Title', '', true)
      &&
      FieldValidate(FReviewDescription, fvtNotEmpty, 'Description', '', true)
    )
      submit();
}

function ProductImageInit()
{
  var LDisplayImage;
  var LdivP_ImageContainer = ElementGet('divP_ImageContainer');
  if (!LdivP_ImageContainer)
    return;

  var LtdCurrentImage = ElementGet('tdCurrentImage');
  if ((LtdCurrentImage) && (LtdCurrentImage.style.display != 'none'))
    var LDisplayImage = ElementGet('DisplayImage');
  else
  {
    LtdCurrentImage = ElementGet('tdCurrentImageLink');
    if ((LtdCurrentImage) && (LtdCurrentImage.style.display != 'none'))
      LDisplayImage = ElementGet('DisplayImageLink');
    else
      return;
  }

  var LImageWidth = LDisplayImage.clientWidth;
  var LImageHeight = LDisplayImage.clientHeight;
  var LContainerWidth = LdivP_ImageContainer.clientWidth - 2;
  var LContainerHeight = LdivP_ImageContainer.offsetParent.clientHeight - 2;
  var LRatio = Math.max(LImageWidth/LContainerWidth, LImageHeight/LContainerHeight);
  if (LRatio > 1)
  {
    LImageWidth = LImageWidth / LRatio;
    LImageHeight = LImageHeight / LRatio;
    LDisplayImage.style.width = LImageWidth;
    LDisplayImage.style.height = LImageHeight;
  }
}

function ProductImageSelect(ADisplayImage_BrowseURL, APopupImage_BrowseURL, ADisplayImageWidth, ADisplayImageHeight, ADisplayImageResized, ADisplayImageCopyright, APKV)
{
  var LDisplayImage = ElementGet('DisplayImage');
  var LDisplayImageLink = ElementGet('DisplayImageLink');

  LDisplayImage.onerror = handleDisplayImageError;
  LDisplayImageLink.onerror = handleDisplayImageError;

  LDisplayImage.src = ADisplayImage_BrowseURL;
  LDisplayImageLink.src = ADisplayImage_BrowseURL;

  LDisplayImage.width = ADisplayImageWidth;
  LDisplayImageLink.width = ADisplayImageWidth;
  LDisplayImage.height = ADisplayImageHeight;
  LDisplayImageLink.height = ADisplayImageHeight;

  var LPopupImage = ElementGet('PopupImage');
  LPopupImage.href = APopupImage_BrowseURL;
  var LZoomIn = ElementGet('ZoomInLink');
  LZoomIn.href = APopupImage_BrowseURL;

  var LtdCurrentImage = ElementGet('tdCurrentImage');

  var LCurrentImageCopyright = ElementGet('CurrentImageCopyright');
  if (ADisplayImageCopyright)
    LCurrentImageCopyright.style.display = '';
  else
    LCurrentImageCopyright.style.display = 'none';
  LCurrentImageCopyright.innerHTML = ADisplayImageCopyright;

  var LtdCurrentImageLink = ElementGet('tdCurrentImageLink');

  if ((APopupImage_BrowseURL == '') || ((ADisplayImage_BrowseURL == APopupImage_BrowseURL) && !ADisplayImageResized))
  {
    LtdCurrentImage.style.display = '';
    LtdCurrentImageLink.style.display = 'none';
    LZoomIn.style.display = 'none';
  }
  else
  {
    LtdCurrentImage.style.display = 'none';
    LtdCurrentImageLink.style.display = '';
    LZoomIn.style.display = '';
  }

  var LSelectedThumbnail = ElementGet('Thumbnail' + APKV);
  var LSelectedThumbnail_Old = ElementGet('Thumbnail' + PM_SelectedPicturePKV);
  if (LSelectedThumbnail_Old)
    LSelectedThumbnail_Old.className = 'P_Thumbnail0';
  LSelectedThumbnail.className = 'P_Thumbnail1';
  PM_SelectedPicturePKV = APKV;
}
/*
function ProductDetailLoad(ACell, AURL)
{
  ajaxElementLoad('dvProductDetail', AURL, [window, 'ProductDetailLoadComplete', ACell]);
}
*/

function ProductDetailLoad(ACell, AURL, ARecNo)
{
  ajaxProductDetailLoad('dvProductDetail', ACell, AURL, ARecNo);
}

function ajaxProductDetailLoad(AElementIDorName, ACell, AURL, ARecNo)
{
  var LAJAXLoader = new cAJAX_Loader();
  LAJAXLoader.onError = [window, 'ajaxProductDetailLoadFailed'];
  LAJAXLoader.get(AURL,
    [window, 'ajaxProductDetailLoadComplete'],
    {idOrName: AElementIDorName, cell: ACell, recNo: ARecNo});
}

window.ajaxProductDetailLoadFailed = function(AErrorMsg)
{
//!! think of proper error handling
  return true;
}

window.ajaxProductDetailLoadComplete = function(AResponse, AContext)
{
  if (AContext.idOrName)
    ElementGet(AContext.idOrName).innerHTML = AResponse.contentHTML;

  window.ProductDetailLoadComplete(AContext.cell, AContext.recNo);
}

window.ProductDetailLoadComplete = function(ACell, ARecNo)
{
  var LTR = PE(ACell);
  var LCurrentProductRecNo = ProductsScroller.recordNoCurrent;
  if (ARecNo != LCurrentProductRecNo)
  {
    if ((LCurrentProductRecNo) && (ProductsScroller.recordInfoList[LCurrentProductRecNo].isCurrent))
      ProductsScroller.recordInfoList[LCurrentProductRecNo].isCurrent = 'Ps_NotCurrent';
    if ((LCurrentProductRecNo >= ProductsScroller.recordNoFrom)
      && (LCurrentProductRecNo < (ProductsScroller.recordNoFrom + LTR.cells.length - 1))
    )
      LTR.cells[LCurrentProductRecNo - ProductsScroller.recordNoFrom].className = 'Ps_NotCurrent';
    ProductsScroller.recordNoCurrent = ARecNo;
    if (ProductsScroller.recordInfoList[ARecNo])
    {
      ProductsScroller.recordInfoList[ARecNo].isCurrent = 'Ps_Hlc_' + ProductsScroller.recordInfoList[ARecNo].rootCategory;
      ACell.className = ProductsScroller.recordInfoList[ARecNo].isCurrent;
    }
    ProductsScroller.areaScroll(0);
  }

  var LProductDetailHTMLTitle = ElementGet('ProductDetailHTMLTitle');
  if (LProductDetailHTMLTitle && LProductDetailHTMLTitle.value)
    document.title = LProductDetailHTMLTitle.value;

  try{
    if (_gat) {
      var LHtml = window.document.getElementsByTagName('HTML')[0].innerHTML;
      var tracker = _gat._getTracker(LHtml.substr(LHtml.indexOf('_gat._getTracker(\''), 20).split('\'')[1]);
      tracker._trackPageview();
    }  
  }
  catch(e) {}  

  try {
    if (urchinTracker) {
     _uff=0;
     urchinTracker();
    }
  }
  catch(e) {}

  var LScripts = document.getElementsByTagName('SCRIPT');
  for (var i = 0; i < LScripts.length; i++)
    if (LScripts[i].src.indexOf('maq.js') != -1)
    {
      var LSrc = LScripts[i].src;
      LScripts[i].src = LSrc;
      return;
    }
}

function ProductDetailShow(APKV, ACampaignID, ASiteURL, AOfflineModeIgnore)
{
  var LParams = ['PKV', APKV];
  if (AOfflineModeIgnore)
    LParams.append([Ignore, AOfflineModeIgnore]);
  if ((!ASiteURL) || (ASiteURL == ''))
    document.location = WSA_URLGet(SPMPB_Product, '', LParams);
  else
  {
    document.getElementById("WdID").value = APKV;
    document.getElementById("SiteName").value = ASiteURL.replace('http://', '').replace('/', '');
    document.getElementById("SiteUrl").value = ASiteURL;
    document.getElementById("CampaignID").value = ACampaignID;
    window.open('go.htm?TS');
  /*!!IC
    //!NB: to avoid double HTTPEncoding
    var LProductDetailURL = WSA_URLGet(SPMPB_Product, '');
    for(var i = 0; i < LParams.length; i += 2)
    {
      if (LParams[i] && LParams[i+1] != null)
        LProductDetailURL += LParams[i] + '=' + LParams[i+1].toString();
    }
    Popup(WSA_URLGet(SRB_CampaignVisit, '', [
      'URL',      ASiteURL + LProductDetailURL,
      'Ref',      'iMall',
      'Campaign', ACampaignID
    ]));
  */
  }
}

function ProductDetailShow2(APKV, ACampaignID, AOfflineModeIgnore)
{
  var LSiteURL = ElementGet('F' + APKV + 'SiteURL');
  ProductDetailShow(APKV, ACampaignID, (LSiteURL ? LSiteURL.value : ''), AOfflineModeIgnore);
}

/* cSubMenuItem */

function cSubMenuItem(ASubMenu, ATagValues)
{
  this.owner = ASubMenu;
  this.tagValues = ATagValues;

  this.toHTML = cSubMenuItem__ToHTML;
}

function cSubMenuItem__ToHTML()
{
  var LResult = this.owner.subMenuInfo.itemTemplate;
  var LTags = this.owner.subMenuInfo.itemTemplateTags;

  for (var i = 0; i < LTags.length; i++)
    LResult = LResult.strReplace(LTags[i], this.tagValues[i]);

  return LResult;
}

function TagNamesToTags(ATabs)
{
  var LLen = ATabs.length;
  var LResult = new Array(LLen);
  for (var i = 0; i < LLen; i++)
    LResult[i] = ATabs[i].toTag();

  return LResult;
}

/* cSubMenuInfo */

function cSubMenuInfo(AItemTemplate, ABodyTemplate, AItemTemplateTagNames)
{
  this.bodyTemplate = ABodyTemplate;
  this.itemTemplate = AItemTemplate;
  this.itemTemplateTags = TagNamesToTags(AItemTemplateTagNames);

  this.scroller_areaID = null;
  this.scroller_barID = null;
  this.scroller_btnLowID = null;
  this.scroller_btnHighID = null;
  this.scroller_sliderID = null;
  this.scroller_classNameActive = null;
  this.scroller_classNameDisabled = null;
  this.scroller_classNameInactive = null;
}

/* cSubMenuItems */

function cSubMenuItems(ASubMenuInfo)
{
  this.items = new Array();
  this.itemCount = 0;
  this.scroller = null;
  this.subMenuInfo = ASubMenuInfo;

  this.itemsToHTMLs = cSubMenuItems__itemsToHTMLs;
  this.scrollerInit = cSubMenuItems__scrollerInit;
  this.toHTML = cSubMenuItems__toHTML;
  this.useCustomScrollerCheck = cSubMenuItems__useCustomScrollerCheck;

  this.add = cSubMenuItems__add;
  this.show = cSubMenuItems__show;
}

function cSubMenuItems__add(ATagValues)
{
  if (ATagValues.length != ATagValues.length)
    alert('cSubMenuItems__add: invalid ATagValues, please specify:' + this.itemTemplateTags.join(','));

  this.items[this.itemCount] = new cSubMenuItem(this, ATagValues);

  this.itemCount++;
}

function cSubMenuItems__itemsToHTMLs()
{
  var LResult = new Array();
  for (var i = 0; i < this.itemCount; i++)
    LResult[i] = this.items[i].toHTML();

  return LResult;
}

function cSubMenuItems__toHTML()
{
  return this.subMenuInfo.bodyTemplate.replace('<~items~>', this.itemsToHTMLs().join(''));
}

function cSubMenuItems__show(AContainer, APopup, ADisplayStyle)
{
  AContainer.innerHTML = this.toHTML();
  if (APopup)
    APopup.style.display = (ADisplayStyle) ? ADisplayStyle : '';
  if (this.useCustomScrollerCheck())
    this.scrollerInit();
}

function cSubMenuItems__scrollerInit()
{
  if (this.scroller)
    this.scroller.finalize();

  this.scroller = new cScroller(
    this.subMenuInfo.scroller_areaID,
    csdVertical,
    this.subMenuInfo.scroller_btnLowID,
    this.subMenuInfo.scroller_btnHighID,
    this.subMenuInfo.scroller_barID,
    this.subMenuInfo.scroller_sliderID,
    this.subMenuInfo.scroller_classNameActive,
    this.subMenuInfo.scroller_classNameInactive,
    this.subMenuInfo.scroller_classNameDisabled
  );
  setTimeout('cScrollers[' + this.scroller.id + '].init()', 5);
}

function cSubMenuItems__useCustomScrollerCheck()
{
  return (
    (this.subMenuInfo.scroller_areaID)
    &&
    (
      (this.subMenuInfo.scroller_btnLowID) && (this.subMenuInfo.scroller_btnHighID)
      ||
      (this.subMenuInfo.scroller_barID) && (this.subMenuInfo.scroller_sliderID)
    )
  );
}

/* cIMall2_SubCategories_SubMenuInfo */

function cIMall2_SubCategories_SubMenuInfo()
{
  var self = new cSubMenuInfo(
    iMall2_SubCategories_ItemTemplate,
    iMall2_SubCategories_BodyTemplate,
    ['CategoryID', 'MerchantID', 'MerchantName']
  );

  return self;
}

/* cIMall2_SubCategories */

function cIMall2_SubCategories()
{
  this.categoryIDs = new Array();
  this.subMenuItems = new Array();
  this.subMenuInfo = new cIMall2_SubCategories_SubMenuInfo();

  this.add = cIMall2_SubCategories__add;
  this.byID = cIMall2_SubCategories__byIDGet;
}

function cIMall2_SubCategories__add(ACategoryID, AMerchantID, AMerchantName)
{
  var LSubMenuItems = this.byID(ACategoryID);
  if (!LSubMenuItems)
  {
    LSubMenuItems = new cSubMenuItems(this.subMenuInfo);
    var LIndex = this.categoryIDs.length;
    this.categoryIDs[LIndex] = ACategoryID;
    this.subMenuItems[LIndex] = LSubMenuItems;
  }

  LSubMenuItems.add([ACategoryID, AMerchantID, AMerchantName]);
}

function cIMall2_SubCategories__byIDGet(AID)
{
  var LIndex = this.categoryIDs.indexOf(AID);
  return ((LIndex == -1) ? null : this.subMenuItems[LIndex]);
}

/* cSortOptionsHelper */

function cSortOptionsHelper(AForm, ACaptionOptions, ASortByOptions, ASortOrderOptions, AUseLinks, ACaptionPrefix)
{
  this.form = AForm;

  this.captionPrefix = ACaptionPrefix;
  this.infoCaptions = ACaptionOptions;
  this.infoSortBy = ASortByOptions;
  this.infoSortOrder = ASortOrderOptions;
  this.useLinks = ((AUseLinks != null) && (AUseLinks == true));

  this.recordDelimiter = ' | ';

  this.generate = cSortOptionsHelper__Generate;
  this.linksGenerate = cSortOptionsHelper__linksGenerate;
  this.optionsGenerate = cSortOptionsHelper__optionsGenerate;
  this.valuesCollect = cSortOptionsHelper__valuesCollect;
}

function cSortOptionsHelper__Generate(ASortBy, ASortOrder)
{
  if (this.useLinks)
    this.linksGenerate(ASortBy, ASortOrder);
  else
    this.optionsGenerate(ASortBy, ASortOrder);
}

function cSortOptionsHelper__linkOnClick(ALink, AIndex)
{
  if ((!ALink) || (typeof(ALink.tagName) == 'undefined') || (ALink.tagName != 'A')
    || (typeof(ALink.parentNode.sortOptionsHelper) == 'undefined')
  )
    return;

  var LSortOptionsHelper = ALink.parentNode.sortOptionsHelper;

  if ((AIndex < 0) || (AIndex >= LSortOptionsHelper.infoCaptions.length))
    return;

  var LForm = LSortOptionsHelper.form;
  LForm.SortBy.value = LSortOptionsHelper.infoSortBy[AIndex];
  LForm.SortOrder.value = LSortOptionsHelper.infoSortOrder[AIndex];
  LForm.submit();
}

function cSortOptionsHelper__linksGenerate(ASortBy, ASortOrder)
{
  this.form.SortBy.value = ASortBy;
  this.form.SortOrder.value = ASortOrder;

  var LSortByContainer = ElementGet('dvPMSortBy');
  if (!LSortByContainer)
    return;

  LSortByContainer.sortOptionsHelper = this;

  var LLen = this.infoCaptions.length;
  var LLinks = new Array(LLen);

  for (var i = 0; i < LLen; i++)
  {
    var LIsCurrent = ((ASortBy) && (ASortOrder)
      && (ASortBy.toLowerCase() == this.infoSortBy[i].toLowerCase())
      && (ASortOrder.toLowerCase() == this.infoSortOrder[i].toLowerCase())
    );
    LLinks[i] = '<a href="javascript: ' + this.form.name + '.submit();"; onclick="cSortOptionsHelper__linkOnClick(this, '+ i.toString() + ');" ' + ((LIsCurrent) ? ' class=current' : '')  + '>' + this.infoCaptions[i] + '</a>';
  }

  LSortByContainer.innerHTML = LLinks.join(this.recordDelimiter);
}

function cSortOptionsHelper__optionsGenerate(ASortBy, ASortOrder)
{
  var LSortBySelect = this.form.SortBySelect;
  if (!LSortBySelect)
    return;

  var LSortBySelect_OptionsInitLen = LSortBySelect.options.length;
  var LPrefix = (this.captionPrefix) ? this.captionPrefix : '';

  for (var i = 0; i < this.infoCaptions.length; i++)
  {
    var LOption = document.createElement("OPTION");
    LOption.value = this.infoCaptions[i];
    LOption.text = LPrefix + PMSortOptions_Captions[i];
    LSortBySelect.options.add(LOption);
    LSortBySelect.options[LSortBySelect_OptionsInitLen + i].selected = (
      (ASortBy) && (ASortOrder)
      && (ASortBy.toLowerCase() == this.infoSortBy[i].toLowerCase())
      && (ASortOrder.toLowerCase() == this.infoSortOrder[i].toLowerCase())
    );
  }

  var LSortOptionsHelper = this;
  function LFormOnSubmit(AEvent)
  {
    return LSortOptionsHelper.valuesCollect();
  };

  objectAttachEvent(this.form, 'submit', LFormOnSubmit);
}

function cSortOptionsHelper__valuesCollect(ARequired)
{
  var LSortBySelect = this.form.SortBySelect;
  if (!LSortBySelect)
    return false;

  if (LSortBySelect.length > 1)
    LSortBySelect = LSortBySelect[0];

  var LSortOptionsIndex = this.infoCaptions.indexOf(LSortBySelect.value);
  if (LSortOptionsIndex == -1)
    if ((ARequired) && (ARequired == true))
      return false;
    else
      LSortOptionsIndex = 0;

  this.form.SortBy.value = this.infoSortBy[LSortOptionsIndex];
  this.form.SortOrder.value = this.infoSortOrder[LSortOptionsIndex];

  return true;
}

var PMSortOptionsHelper;
function PMSortOptionsHelperCreate(AFormName, AUseLinks, ACaptionPrefix)
{
  if ((typeof(PMSortOptions_Captions) != 'undefined')
    || (typeof(PMSortOptions_SortBy) != 'undefined')
    || (typeof(PMSortOptions_SortBy) != 'undefined')
  )

  PMSortOptionsHelper = new cSortOptionsHelper(
    ElementGet(AFormName),
    PMSortOptions_Captions,
    PMSortOptions_SortBy,
    PMSortOptions_SortOrder,
    AUseLinks,
    ACaptionPrefix
  );
}

function PMSortOptionsGenerate(ASortBy, ASortOrder)
{
  if (PMSortOptionsHelper)
    PMSortOptionsHelper.generate(ASortBy, ASortOrder);
}

function FilterFormSubmit(AForm)
{
  if ((PMSortOptionsHelper) || (PMSortOptionsHelper.form == AForm)
    || PMSortOptionsHelper.valuesCollect(true)
  )
    AForm.submit();

}
var DoDropDownsInit = false;
function DropDownsInit()
{
  if (DoDropDownsInit)
    SCDropDown.init();
}

function  AdvertizedSitePopupOpen(ACampaignID, AMerchantSiteURL)
{
  window.open('default.asp?' + SIDQ + ParamsToQueryString(
  [
    'S', SRB_CampaignVisit,
    'Campaign', ACampaignID,
    'URL', AMerchantSiteURL + 'default.asp?Ref=iMall'
  ]));
}

