  var windowXSize = 0;
  var windowYSize = 0;
  var maxWindowXSize = 90;
  var maxWindowYSize = 90;
  var openingSpeed = 2;

  function openWindow(){
    var divForIframe = document.getElementById("divForIframe");

	  if ( (windowXSize < maxWindowXSize) || (windowYSize < maxWindowYSize)){
	      if ((windowYSize < maxWindowYSize)){
	      	windowYSize = windowYSize + openingSpeed;
	      }else{
	        windowXSize = windowXSize + openingSpeed;
	      }
		  window.setTimeout(openWindow, 5);

		divForIframe.style.width= windowXSize + "%";
		divForIframe.style.height= windowYSize + "%";
		divForIframe.style.left = document.body.clientWidth/2 - (windowXSize/2 * document.body.clientWidth /100);
	  }else{
	    var iFrameForBrands = document.getElementById("iFrameForBrands");
	    var bigDivForIframe = document.getElementById("divForIframe");
	    var iFrameForBrandsDiv = document.getElementById("iframeForBrandsContainer");
	    var linkPopWindowDiv = document.getElementById("linkPopWindow");
	    //alert(iFrameForBrands.clientWidth + " * " + iFrameForBrands.clientHeight + " / " + iFrameForBrands.parentNode.clientHeight );
	    iFrameForBrands.style.width = (iFrameForBrands.clientWidth - 2) + "px";
	    iFrameForBrandsDiv.style.height = (iFrameForBrands.clientHeight - 21) + "px";
	    iFrameForBrandsDiv.style.width = (iFrameForBrands.clientWidth) + "px";

	    bigDivForIframe.style.height = (iFrameForBrandsDiv.clientHeight + linkPopWindowDiv.clientHeight + 4) + "px";
	    bigDivForIframe.style.width = (iFrameForBrandsDiv.clientWidth + 4) + "px";
	  }
  }

  function openLink(url ,sender){
    var divForIframe = document.getElementById("divForIframe");
    var iFrameForBrands = document.getElementById("iFrameForBrands");
    //alert(url + divForIframe + iFrameForBrands + " " + sender.parentNode.clientLeft + " " + document.body.clientWidth);
    iFrameForBrands.src = url;
    //divForIframe.style.width="90%";
    //divForIframe.style.height="90%";
    divForIframe.style.top="10px";
    divForIframe.style.left="10px";
    divForIframe.style.visibility = "visible";
    iFrameForBrands.style.width="100%";
    iFrameForBrands.style.height="100%";
    iFrameForBrands.style.top="0px";
    iFrameForBrands.style.left="0px";
    openWindow();

  }

  function hideFrame(){
    var divForIframe = document.getElementById("divForIframe");
    divForIframe.style.width="0px";
    divForIframe.style.height="0px";
    divForIframe.style.top="0px";
    divForIframe.style.left="0px";
  	divForIframe.style.visibility = "hidden";
	windowXSize = 0;
	windowYSize = 0;
	maxWindowXSize = 90;
	maxWindowYSize = 90;

  }

  function popInWindow(sender){
    var iFrameForBrands = document.getElementById("iFrameForBrands");
    sender.href = iFrameForBrands.src;

  }
