var autoDisplayOnPage = 2;
var dHeight=50;
var dWidth = 88;
var dLeft = 276;
var dTop =  160;
var cHeight=180;
var cWidth = 350;

var cTop =  160;
var	screenwidth = screen.width;
var halfscreen = screenwidth/2;
var cLeft = halfscreen - (cWidth/2);
dLeft = cLeft;
//alert(cWidth + " : " + halfscreen + " : " + cLeft);
var growBox;
var dhtml_Email_Container;
dhtml_Email_Container = document.getElementById("dhtml_Email_Container");
growBox = document.getElementById("dhtml_grow");
function open_dhtml_module()
{
 
  growBox = document.getElementById("dhtml_grow");
  dhtml_Email_Container = document.getElementById("dhtml_Email_Container");
  if (growBox != null)
  {
    if (dhtml_Email_Container.style.visibility!='visible')
    {
      
      //fix ie bug that shows gallery drop down menus above the layer
      dd_gallery1 = document.getElementById("Itview")
      dd_gallery2 = document.getElementById("sortSelect")
      //if document.all then the user's browser is IE 
      if (dd_gallery1 != null && document.all)
      {
        var a = findFormPos(dd_gallery1)
        if (a[1] < 270)
        dd_gallery1.style.visibility='hidden';
      }
      if (dd_gallery2 != null  && document.all)
      {
        a = findFormPos(dd_gallery2)
        if (a[1] < 270)
        dd_gallery2.style.visibility='hidden';
      }
      
      growBox.style.zIndex=1000;
      growBox.style.visibility='visible';
      growBox.style.width=dWidth+'px';
      growBox.style.height=dHeight+'px';
	//  alert(cLeft);
      growBox.style.left=cLeft+'px';
      growBox.style.top=dTop+'px';
      if(dWidth>350) 
      { 
        clearTimeout(t);
		 
	  
        dhtml_Email_Container.style.top='180px';
      //  alert(dhtml_Email_Container.style.left + "==" +cLeft);
		dhtml_Email_Container.style.left=cLeft+'px';
       //  alert(dhtml_Email_Container.style.left);
		
		dhtml_Email_Container.style.visibility='visible';
        dhtml_Email_Container.style.display='block';
        dhtml_Email_Container.style.zIndex=1000;
		growBox.style.visibility='hidden';
		   
		               
       // changed as a part of cookie cleanup
     
      //  SetCookieDictionary('arts','dhtmlEmailPromo','seen','','/',GetCookieDomain()); 
       //end 
    
        dHeight=50;
        dWidth = 88;
        dLeft = 276;
        dTop =  32;
        return;
      }
      dWidth=dWidth+44;
      dHeight=dHeight+25;
      dLeft=dLeft-10;
      dTop=dTop+9;
      t=setTimeout('open_dhtml_module()',60);
    }
  }
} 

function close_dhtml_module()
{
  shrinkBox = document.getElementById("dhtml_shrink");
  if (shrinkBox != null)
  {
    dhtml_Email_Container = document.getElementById("dhtml_Email_Container");
    dhtml_Email_Container.style.visibility='hidden';
    dhtml_Email_Container.style.display='none';
    document.getElementById("dhtml_Email_Input").style.display  = 'block';
   // document.getElementById("dhtml_Email_Thanks").style.display  = 'none';
    
    
    
    //fix ie bug that shows gallery drop down menus above the layer
    if (dd_gallery1 != null)
    {
      dd_gallery1.style.visibility='visible';
    }
    if (dd_gallery2 != null)
    {
      dd_gallery2.style.visibility='visible';
    }
      
      
    shrinkBox.style.top=cTop;
    shrinkBox.style.left=cLeft;
    shrinkBox.style.height=cHeight;
    shrinkBox.style.width=cWidth;
    shrinkBox.style.visibility='visible';
    if(cWidth<100) 
    { 
      clearTimeout(t);
      shrinkBox.style.visibility='hidden';
     // document.getElementById("dhtml_email_textBox").value='Enter Your Email Address';
	  
	  cHeight=180;
      cWidth = 350;
      cLeft = 291;
      cTop =  42;

      
      return;
    }
    cWidth=cWidth-115;
    cHeight=cHeight-77;
    cLeft=cLeft+20;
    /*cTop=cTop+18;*/
    t=setTimeout('close_dhtml_module()',90);
  }
} 



