

	function detectSP2() {	
	// Thank you, Microsoft for your lousy Service Pack 2, which ignores 'status=no' property
	// So now I have to detect if SP2 is installed, and if it is, increase the height
	// of the window to compensate for the frickin' status bar, which appears
	// whether I like it or not (and I do NOT like it, for the record, not that MS cares).
	
	var g_fIsSP2 = false;
	
  		g_fIsSP2 = (window.navigator.userAgent.indexOf("SV1") != -1);
		//alert(g_fIsSP2);
  	if (g_fIsSP2){
      //This browser is Internet Explorer in SP2. 
	  h = parseInt(h);	  
	  h = h + 22;  // the approximate height of the status bar.
	}
  else{
      //This browser is not Internet Explorer in SP2.
	  h = parseInt(h);	  
	  h = h + 0;
	  }
	}
	

	
/***********
	function mieUWHLT()  --for use on miele.com for opening feature/benefit windows
***********/
function mieUWHLT(url,width,height,left,top) {
	
	w= width;
	h= height;		
	l = left;
	t = top;	
	spTest = detectSP2();
	//ww = detectSP2();
	//wh = detectSP2();
	myNewWin=window.open(url,"mieWindow","resizable=yes,menubar=no,location=no,toolbar=no,scrollbars=yes,status=no,directories=no");if(window.focus){myNewWin.focus();};	
	
	myNewWin.resizeTo(w,h);	
	myNewWin.moveTo(l,t);	
	 
	
	myIP = "";
	theUrl = "";	
	w= "";
	h= "";
	l = "";
	t = "";
	
	//mieUWHLTresize(ww,wh)
	}	
	
/**************************************/	
	
	
	
	
	
/**********************************/
function hideDiv(el_name) {
	document.getElementById(el_name).style.display="none";
	document.getElementById('overlay').style.display="none";
	document.body.style.overflow = 'auto';
	//	alert(el_name)

}

function hideKit(el_name) {
    document.getElementById(el_name).style.display = "none";
    document.getElementById('overlay').style.display = "none";
    // document.body.style.overflow = 'auto';
    //	alert(el_name)
    // refreshPage();
}



function refreshPage() {
   window.location.href = window.location.href
}

	

	function displayPopUp(name,width,height)
	{
	      
	       window.open(name,"","width="+ width +",height="+height +",resizable=no,menubar=no,location=no,toolbar=no,scrollbars=yes,status=no,directories=no")//) //,"AddContact", "width=550,height=100" )
	      
	}
	
	
	
	
	
	
	/***********from Doug for features ****************/
	

function displayElement(el_name,el_w,el_h,el_left,el_top) {

arrSize = new Array;

arrSize = getPageSize();

var pwSize = arrSize[0];
var phSize = arrSize[1];
var wwSize = arrSize[2];
var whSize = arrSize[3];


arrScroll = new Array;

arrScroll = getPageScroll();

var xScroll = arrScroll[0];
var yScroll = arrScroll[1];
/*alert("yScroll: " + yScroll + "<--");*/

/*pageWidth,pageHeight,windowWidth,windowHeight*/
  
	document.getElementById(el_name).style.display='block';
	document.getElementById(el_name).style.zIndex=5;
	
	document.getElementById(el_name).style.width= el_w + 'px';
	document.getElementById(el_name).style.height= el_h + 'px';
	
	
	
	document.getElementById(el_name).style.left= el_left + 'px';
	/*document.getElementById(el_name).style.top= el_top + 'px';	*/
	
	
	if ( el_name == 'showImage' ) {
        document.getElementById(el_name).style.top= yScroll + 100 + 'px';
        document.getElementById(el_name).style.left= 75 + 'px';				
	}
	else {
		document.getElementById(el_name).style.top= yScroll + 56 + 'px';	
		
	}	
	
	

	    //document.getElementById(el_name).style.top= yScroll + 56 + 'px';		
	
}

function displayAlert() {
    
}

/* function which launches the precart*/

function preCart(el_name) {

    arrSize = new Array;

    arrSize = getPageSize();

    var pwSize = arrSize[0];
    var phSize = arrSize[1];
    var wwSize = arrSize[2];
    var whSize = arrSize[3];
    
    arrScroll = new Array;

    arrScroll = getPageScroll();

    var xScroll = arrScroll[0];
    var yScroll = arrScroll[1];
    /*alert("yScroll: " + yScroll + "<--");    
       alert("phSize is: " + phSize + "<--"); */
    

    /*document.body.style.overflow='hidden';*/

    document.getElementById('overlay').style.display='block';

    var scowHeight = document.getElementById('storeContentOuterWrapper').offsetHeight;
    var storeConHeight = document.getElementById('storeContainer').offsetHeight;

    /*alert(storeConHeight);*/

    /*document.getElementById('overlay').style.height = phSize - 156 + 'px';*/
    document.getElementById('overlay').style.height = storeConHeight + 'px';
      
	document.getElementById(el_name).style.display='block';
	document.getElementById(el_name).style.zIndex=5;
	document.getElementById(el_name).style.top= yScroll + 'px';
	document.getElementById('overlay').style.backgroundColor = '#fff';

	
    
    /*
	    document.getElementById(el_name).style.width= el_w + 'px';
	    document.getElementById(el_name).style.height= el_h + 'px';
	    document.getElementById(el_name).style.left= el_left + 'px';
	    document.getElementById(el_name).style.top= el_top + 'px';		
	*/
	
	var featureswindow = document.getElementById('modelFeatures')
	
	if( featureswindow.style.display == 'block' ) {
		featureswindow.style.display = 'none';
	}
	else {
		featureswindow.style.display = 'none';
	}

}







/* function which launches the precart*/

function myFavPreCart(el_name) {

    /*alert(el_name);*/

    arrSize = new Array;

    arrSize = getPageSize();

    var pwSize = arrSize[0];
    var phSize = arrSize[1];
    var wwSize = arrSize[2];
    var whSize = arrSize[3];

    arrScroll = new Array;

    arrScroll = getPageScroll();

    var xScroll = arrScroll[0];
    var yScroll = arrScroll[1];
    /*alert("yScroll: " + yScroll + "<--");    
    alert("phSize is: " + phSize + "<--"); */


    /*document.body.style.overflow='hidden';*/

    document.getElementById('overlay').style.display = 'block';

    var scowHeight = document.getElementById('storeContentOuterWrapper').offsetHeight;
    var storeConHeight = document.getElementById('storeContainer').offsetHeight;

    /*alert(storeConHeight);*/

    /*document.getElementById('overlay').style.height = phSize - 156 + 'px';*/
    document.getElementById('overlay').style.height = storeConHeight + 'px';

    document.getElementById(el_name).style.display = 'block';
    document.getElementById(el_name).style.zIndex = 5;
    document.getElementById(el_name).style.top = yScroll + 'px';
    document.getElementById('overlay').style.backgroundColor = '#fff';

    /*
    document.getElementById(el_name).style.width= el_w + 'px';
    document.getElementById(el_name).style.height= el_h + 'px';
    document.getElementById(el_name).style.left= el_left + 'px';
    document.getElementById(el_name).style.top= el_top + 'px';		
    */

    var featureswindow = document.getElementById('modelFeatures')

    if (featureswindow.style.display == 'block') {
        featureswindow.style.display = 'none';
    }
    else {
        featureswindow.style.display = 'none';
    }

}






/* function which launches the my account pop up*/

function myAcctPopUp(el_name) {

    arrSize = new Array;

    arrSize = getPageSize();

    var pwSize = arrSize[0];
    var phSize = arrSize[1];
    var wwSize = arrSize[2];
    var whSize = arrSize[3];

    arrScroll = new Array;

    arrScroll = getPageScroll();

    var xScroll = arrScroll[0];
    var yScroll = arrScroll[1];
    /*alert("yScroll: " + yScroll + "<--");    
    alert("phSize is: " + phSize + "<--"); 
    */

    document.getElementById('overlay').style.display = 'block';

    var scowHeight = document.getElementById('storeContentOuterWrapper').offsetHeight;
    document.getElementById('overlay').style.height = scowHeight + 'px';

    document.getElementById(el_name).style.display = 'block';
    document.getElementById(el_name).style.zIndex = 5;
    document.getElementById(el_name).style.top = yScroll + 'px';
    document.getElementById('overlay').style.backgroundColor = '#fff';

}


/* function which launches the my account pop up*/

function returnsPopUp(el_name) {

    arrSize = new Array;

    arrSize = getPageSize();

    var pwSize = arrSize[0];
    var phSize = arrSize[1];
    var wwSize = arrSize[2];
    var whSize = arrSize[3];

    arrScroll = new Array;

    arrScroll = getPageScroll();

    var xScroll = arrScroll[0];
    var yScroll = arrScroll[1];
    /*alert("yScroll: " + yScroll + "<--");    
    alert("phSize is: " + phSize + "<--"); 
    */

    document.getElementById('overlay').style.display = 'block';

    var scowHeight = document.getElementById('storeContentOuterWrapper').offsetHeight;
    document.getElementById('overlay').style.height = scowHeight + 'px';

    document.getElementById(el_name).style.display = 'block';
    document.getElementById(el_name).style.zIndex = 5;
    document.getElementById(el_name).style.top = yScroll + 'px';
    document.getElementById('overlay').style.backgroundColor = '#fff';

}



/* function which launches the print terms pop up*/

function printTerms(el_name) {

    arrSize = new Array;

    arrSize = getPageSize();

    var pwSize = arrSize[0];
    var phSize = arrSize[1];
    var wwSize = arrSize[2];
    var whSize = arrSize[3];

    arrScroll = new Array;

    arrScroll = getPageScroll();

    var xScroll = arrScroll[0];
    var yScroll = arrScroll[1];
    /*alert("yScroll: " + yScroll + "<--");    
    alert("phSize is: " + phSize + "<--"); 
    */

    document.getElementById('overlay').style.display = 'block';

    var scowHeight = document.getElementById('storeContentOuterWrapper').offsetHeight;
    document.getElementById('overlay').style.height = scowHeight + 'px';

    document.getElementById(el_name).style.display = 'block';
    document.getElementById(el_name).style.zIndex = 5;
    document.getElementById(el_name).style.top = yScroll + 'px';
    document.getElementById('overlay').style.backgroundColor = '#fff';

}



 /******************************************/
 
  
 function displayShippingTable () {
 
 document.getElementById(ship_tab).style.display='block';
 
 }
 
 
 function showHideforLaundry(the_object) {
	var el = document.getElementById(the_object);
//alert(the_object)
	if ( el.style.display == 'block' ) {
		//el.style.display = 'none';
		el.style.filter = 'alpha(opacity=' + 00 + ')';		
		el.style.opacity=0.5;		
	}
	else {
		el.style.display = 'block';
		
	}
}
 
 
function showHide(the_object) {

	var el = document.getElementById(the_object);
//alert(the_object)
	if ( el.style.display == 'block' ) {
		el.style.display = 'none';
	}
	else {
		el.style.display = 'block';
	}
}

 
 
 
		
		
		
		
		
function SetFocus(element){
window.scrollTo(0,0);
return true;
}
	
	
	
	//
// getPageSize()
// Returns array with page width, height and window width, height
// Core code from - quirksmode.org
// Edit for Firefox by pHaez
//
function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}


//
// getPageScroll()
// Returns array with x,y page scroll values.
// Core code from - quirksmode.org
//
function getPageScroll(){

	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}

	arrayPageScroll = new Array('',yScroll) 
	return arrayPageScroll;
}






function backToTop() {
    var x1 = x2 = x3 = 0;
    var y1 = y2 = y3 = 0;

    if (document.documentElement) {
        x1 = document.documentElement.scrollLeft || 0;
        y1 = document.documentElement.scrollTop || 0;
    }

    if (document.body) {
        x2 = document.body.scrollLeft || 0;
        y2 = document.body.scrollTop || 0;
    }

    x3 = window.scrollX || 0;
    y3 = window.scrollY || 0;

    var x = Math.max(x1, Math.max(x2, x3));
    var y = Math.max(y1, Math.max(y2, y3));

    window.scrollTo(Math.floor(x / 2), Math.floor(y / 2));

    if (x > 0 || y > 0) {
        window.setTimeout("backToTop()", 25);
    }
}










function fade(eid)
{

  document.getElementById('overlay').style.display='block';    
    
  var TimeToFade = 2000.0;
  var element = document.getElementById(eid);
  document.getElementById(eid).style.display="block";
  
  
  if(element == null)
    return;
   
  if(element.FadeState == null)
  {
    if(element.style.opacity == null
        || element.style.opacity == ''
        || element.style.opacity == '1')
    {
      element.FadeState = 2;
    }
    else
    {
      element.FadeState = -2;
    }
  }
   
  if(element.FadeState == 1 || element.FadeState == -1)
  {
    element.FadeState = element.FadeState == 1 ? -1 : 1;
    element.FadeTimeLeft = TimeToFade - element.FadeTimeLeft;
  }
  else
  {
    element.FadeState = element.FadeState == 2 ? -1 : 1;
    element.FadeTimeLeft = TimeToFade;
    setTimeout("animateFade(" + new Date().getTime() + ",'" + eid + "');", 33);
  }  
}



function animateFade(lastTick, eid)
{  
    var TimeToFade = 1000.0;
  var curTick = new Date().getTime();
  var elapsedTicks = curTick - lastTick;
 
  var element = document.getElementById(eid);
 
  if(element.FadeTimeLeft <= elapsedTicks)
  {
    element.style.opacity = element.FadeState == 1 ? '1' : '0';
    element.style.filter = 'alpha(opacity = '
        + (element.FadeState == 1 ? '100' : '0') + ')';
    element.FadeState = element.FadeState == 1 ? 2 : -2;
    window.parent.hideDiv('cartPage');
    parent.document.location=parent.document.location
    return;
  }
 
  element.FadeTimeLeft -= elapsedTicks;
  var newOpVal = element.FadeTimeLeft/TimeToFade;
  if(element.FadeState == 1)
    newOpVal = 1 - newOpVal;

  element.style.opacity = newOpVal;
  element.style.filter = 'alpha(opacity = ' + (newOpVal*100) + ')';
 
  setTimeout("animateFade(" + curTick + ",'" + eid + "')", 33);
  
}




function pageTop(){
window.scrollTo(0,0);
//document.getElementById('shipping_customer_name').focus;
}





function kitComponents(el_name) {

    arrSize = new Array;
    arrSize = getPageSize();

    var pwSize = arrSize[0];
    var phSize = arrSize[1];
    var wwSize = arrSize[2];
    var whSize = arrSize[3];

    arrScroll = new Array;
    arrScroll = getPageScroll();

    var xScroll = arrScroll[0];
    var yScroll = arrScroll[1];
    /*alert("yScroll: " + yScroll + "<--");
    alert("phSize is: " + phSize + "<--");
    alert("el_name is: " + el_name + "<--");*/

    var yScrollNew = whSize / 2;
    var yScrollNew = yScrollNew + yScroll;

    /*alert("yScrollNew = " + yScrollNew + "<--");
    alert("pwSize = " + pwSize + "<--");
    alert("phSize = " + phSize + "<--");
   */

    document.body.style.overflow='hidden';

    /*document.getElementById('overlay').style.display = 'block';*/

    var scowHeight = document.getElementById('container').offsetHeight;
    document.getElementById('overlay').style.height = scowHeight + 'px';

    document.getElementById(el_name).style.display = 'block';
    document.getElementById(el_name).style.zIndex = 5;
    document.getElementById(el_name).style.top = yScrollNew + 'px';
    document.getElementById('overlay').style.backgroundColor = '#fff';
    document.getElementById('overlay').style.overflow = 'hidden';    
    document.getElementById('overlay').style.width = pwSize - 28 + 'px';
    document.getElementById('overlay').style.height = phSize - 16 + 'px';
    /*document.getElementById(el_name).style.width = wwSize - 37 + 'px';*/
 

    /*
    document.getElementById(el_name).style.width= el_w + 'px';
    document.getElementById(el_name).style.height= el_h + 'px';
    document.getElementById(el_name).style.left= el_left + 'px';
    document.getElementById(el_name).style.top= el_top + 'px';		
    */

    /*var featureswindow = document.getElementById('modelFeatures')

    if (featureswindow.style.display == 'block') {
        featureswindow.style.display = 'none';
    }
    else {
        featureswindow.style.display = 'none';
    }
    */

}


function PrintPage() {
    alert('I am in the function');
    window.print();
}















function displayService(el_name, el_w, el_h, el_left, el_top) {

    arrSize = new Array;

    arrSize = getPageSize();

    var pwSize = arrSize[0];
    var phSize = arrSize[1];
    var wwSize = arrSize[2];
    var whSize = arrSize[3];


    


    arrScroll = new Array;

    arrScroll = getPageScroll();

    var xScroll = arrScroll[0];
    var yScroll = arrScroll[1];
    /*alert("yScroll: " + yScroll + "<--");*/

    /*pageWidth,pageHeight,windowWidth,windowHeight*/

    document.getElementById(el_name).style.display = 'block';
    document.getElementById(el_name).style.zIndex = 5;

    document.getElementById(el_name).style.width = el_w + 'px';
    document.getElementById(el_name).style.height = el_h + 'px';



    document.getElementById(el_name).style.left = el_left + 'px';
    /*document.getElementById(el_name).style.top= el_top + 'px';	*/


    if (el_name == 'showImage') {
        document.getElementById(el_name).style.top = yScroll + 100 + 'px';
        document.getElementById(el_name).style.left = 75 + 'px';
    }
    else {
        document.getElementById(el_name).style.top = yScroll + 'px';

    }



    //document.getElementById(el_name).style.top= yScroll + 56 + 'px';

}




   
function getPosition(e) {
    e = e || window.event;
      var cursor = {x:0, y:0};
      
      if (e.pageX || e.pageY) {
      cursor.x = e.pageX;
      cursor.y = e.pageY;
      }
      else {
      cursor.x = e.clientX + (document.documentElement.scrollLeft ||
        document.body.scrollLeft) - 
        document.documentElement.clientLeft;
      cursor.y = e.clientY + (document.documentElement.scrollTop ||
        document.body.scrollTop) -
        document.documentElement.clientTop;
      }
      return cursor;
      alert(cursor);
  }









  function recalculatingItems() {
      document.getElementById('overlay').style.display = 'block';
      document.getElementById('recalculatingItemsContainer').style.display = 'block';
      }




      function hideLoadScreen() {
        window.parent.document.getElementById("loadingScreen").style.display = "none";
    }







    /* function which launches the precart*/

    function builtInDetails(list_item) {
        
        /* need to display doorPanelDetails within the list_item which is being passed 
        example: li#item_5 #doorPanelDetails{display:block;} 
        
        document.getElementById(list_item).getElementsByTagName('span').style.display = 'block';
        */

        // var dpd_div = "doorPanelDetails_" + list_item;
        var dpd_div = list_item;

        // alert(dpd_div);
       document.getElementById(dpd_div).style.display = 'block';
        
        
    }





    /* function which launches the precart*/

    function quoteWindow(el_name) {

        arrSize = new Array;

        arrSize = getPageSize();

        var pwSize = arrSize[0];
        var phSize = arrSize[1];
        var wwSize = arrSize[2];
        var whSize = arrSize[3];

        arrScroll = new Array;

        arrScroll = getPageScroll();

        var xScroll = arrScroll[0];
        var yScroll = arrScroll[1];
        /*alert("yScroll: " + yScroll + "<--");    
        alert("phSize is: " + phSize + "<--"); */


        /*document.body.style.overflow='hidden';*/

        document.getElementById('overlay').style.display = 'block';

        var scowWidth = document.getElementById('storeContentInnerWrapper').offsetWidth - 26;
        var scowHeight = document.getElementById('storeContentOuterWrapper').offsetHeight;
        var storeConHeight = document.getElementById('storeContainer').offsetHeight;
        var storeWidth = document.getElementById('storeWrapper').offsetWidth;
        var storeHeight = document.getElementById('storeWrapper').offsetHeight - 126;


        /*document.getElementById('overlay').style.height = phSize - 156 + 'px';*/
        /*document.getElementById('overlay').style.height = storeConHeight + 'px';*/
        document.getElementById('overlay').style.width = scowWidth + 'px';
        document.getElementById('overlay').style.height = storeHeight + 'px';

        document.getElementById(el_name).style.display = 'block';
        document.getElementById(el_name).style.zIndex = 5;
        document.getElementById(el_name).style.top = yScroll + 'px';
        document.getElementById('overlay').style.backgroundColor = '#fff';

        /*
        document.getElementById(el_name).style.width= el_w + 'px';
        document.getElementById(el_name).style.height= el_h + 'px';
        document.getElementById(el_name).style.left= el_left + 'px';
        document.getElementById(el_name).style.top= el_top + 'px';		
        */

        var featureswindow = document.getElementById('modelFeatures')

        if (featureswindow.style.display == 'block') {
            featureswindow.style.display = 'none';
        }
        else {
            featureswindow.style.display = 'none';
        }

    }