/*------------------Inner pages menu---------------------*/
function mmLoadMenus() {
  if (window.mm_menu_0925153203_0) return;
  window.mm_menu_0925153203_0 = new Menu("root",120,20,"Arial, Helvetica, sans-serif",11,"#ffffff","#ffffff","#5D4522","#BE8F4A","left","middle",0,0,1000,-5,7,true,true,true,10,true,true);
  mm_menu_0925153203_0.addMenuItem("RUGS","location='rugs.htm'");
  mm_menu_0925153203_0.addMenuItem("CARPET","location='carpet.htm'");
  mm_menu_0925153203_0.addMenuItem("NATURAL FIBERS","location='natural_fibers.htm'");
  mm_menu_0925153203_0.addMenuItem("HARD SURFACE","location='hard_surface.htm'");
   mm_menu_0925153203_0.hideOnMouseOut=true;
   mm_menu_0925153203_0.bgColor='#B18C53';
   mm_menu_0925153203_0.menuBorder=1;
   mm_menu_0925153203_0.menuLiteBgColor='#B18C53';
   mm_menu_0925153203_0.menuBorderBgColor='#907142';

mm_menu_0925153203_0.writeMenus();
} // mmLoadMenus()
/*------------------Inner pages menu---------------------*/

/*-------------------Image rotation---------------------*/
g_fPlayMode = 0;
g_iimg = -1;
g_imax = 0;
g_ImageTable = new Array();

function ChangeImage(fFwd)
{
if (fFwd)
{
if (++g_iimg==g_imax)
g_iimg=0;
}
else
{
if (g_iimg==0)
g_iimg=g_imax;
g_iimg--;
}
Update();
}

function getobject(obj){
if (document.getElementById)
return document.getElementById(obj)
else if (document.all)
return document.all[obj]
}

function Update(){
getobject("_Ath_Slide").src = g_ImageTable[g_iimg][0];

}


function Play()
{
g_fPlayMode = !g_fPlayMode;
if (g_fPlayMode)
{
//getobject("btnPrev").disabled = getobject("btnNext").disabled = true;
Next();
}
else 
{
getobject("btnPrev").disabled = getobject("btnNext").disabled = false;

}
}
function OnImgLoad()
{
if (g_fPlayMode)
window.setTimeout("Tick()", g_dwTimeOutSec*1000);
}
function Tick() 
{
if (g_fPlayMode)
Next();
}
function Prev()
{
ChangeImage(false);
}
function Next()
{
ChangeImage(true);
}

//extend the above list as desired
g_dwTimeOutSec=5
////End configuration/////////////////////////////

if (document.getElementById||document.all)
window.onload=Play
/*-------------------Image rotation---------------------*/

/*------------Project Gallery----------------*/
var msg = Object;
msg['text1'] = '<a class="cphoto">Rugs - Area Rugs</a>';
msg['text2'] = '<a class="cphoto">Main Store - Bockrath Interior</a>';
msg['text3'] = '<a class="cphoto">Bockrath is the region’s exclusive dealer of <br>Karastan & Ralph Lauren carpet, the most <br>respected name in carpeting and rugs<br></a>';
msg['text4'] = '<a class="cphoto">Natural Fibers</a>';
msg['text5'] = '<a class="cphoto">Relax, It’s Lees</a>';
msg['text6'] = '<a class="cphoto">Hardwood Floor Selection</a>';
msg['text99'] = '<a class="cphoto">&nbsp;</a>';

function getElement(id) {
return document.getElementById ? document.getElementById(id) :
document.all ? document.all(id) : null;
}

function rollTwo(which, state, textCellId) {
//document['pic' + which].src = window['pic' + which + state].src;
var el = getElement(textCellId);
if (el && typeof el.innerHTML != 'undefined') {
if (state == 'on') el.innerHTML = msg['text' + which];
else el.innerHTML = msg['text99'];
}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
/*------------Project Gallery----------------*/

/*------------include function---------------------*/
function include_file(id, url) {
	
  var req = false;
  // For Safari, Firefox, and other non-MS browsers
  if (window.XMLHttpRequest) {
    try {
      req = new XMLHttpRequest();
    } catch (e) {
      req = false;
    }
  } else if (window.ActiveXObject) {
    // For Internet Explorer on Windows
    try {
      req = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        req = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        req = false;
      }
    }
  }
 var element = document.getElementById(id);
  if (req) {
    // Synchronous request, wait till we have it all
	req.open('GET', url, false);
    req.send(null);
    element.innerHTML = req.responseText;
  } 
}
/*------------include function---------------------*/

/*--------------Holdlink()---------------*/
function holdlink(id){
	document.getElementById(id).className='current';
}
/*--------------Holdlink()---------------*/

/*---------popup windows---------------*/
function winopen()
{
	var NewWin1;
	
	NewWin2=window.open("inner/cupon.htm",'NewWin1','height=500,width=615,top=50,left=50,location=no,status=no,toolbar=no,menubar=no,scrollbars=yes');
	NewWin2.focus();

}

function OpenWin1()
{
	var NewWin;
	path="rugs/DSC_5253.htm";
	NewWin1=window.open(path,'NewWin1','width=700,height=540,top=50,left=50,location=no,status=no,toolbar=no,menubar=no,scrollbars=no');
	NewWin1.focus();
}
function OpenWin2()
{
	var NewWin;
	path="main_store/DSC_5280.htm";
	NewWin1=window.open(path,'NewWin1','width=700,height=540,top=50,left=50,location=no,status=no,toolbar=no,menubar=no,scrollbars=no');
	NewWin1.focus();
}
function OpenWin3()
{
	var NewWin;
	path="carpet/DSC_5096.htm";
    //path="carpet/DSC_5282.htm";
	NewWin1=window.open(path,'NewWin1','width=700,height=540,top=50,left=50,location=no,status=no,toolbar=no,menubar=no,scrollbars=no');
	NewWin1.focus();
}
function OpenWin4()
{
	var NewWin;
	path="natural_fibers/DSC_5164.htm";
	NewWin1=window.open(path,'NewWin1','width=700,height=540,top=50,left=50,location=no,status=no,toolbar=no,menubar=no,scrollbars=no');
	NewWin1.focus();
}
function OpenWin5()
{
	var NewWin;
	path="lees/lees1.htm";
	NewWin1=window.open(path,'NewWin1','width=700,height=540,top=50,left=50,location=no,status=no,toolbar=no,menubar=no,scrollbars=no');
	NewWin1.focus();
}
function OpenWin6()
{
	var NewWin;
	path="hardwood/hardwood1.htm";
	NewWin1=window.open(path,'NewWin1','width=700,height=540,top=50,left=50,location=no,status=no,toolbar=no,menubar=no,scrollbars=no');
	NewWin1.focus();
}

function Opencabinet()
{
	var NewWin;
	path="../popup/cabinet.htm";
	NewWin1=window.open(path,'NewWin1','width=700,height=540,top=100,left=100,location=no,status=no,toolbar=no,menubar=no,scrollbars=yes');
	NewWin1.focus();
}
/*---------popup windows---------------*/

/*misc functions*/
function mOvr(src,clrOver){ 
	if (!src.contains(event.fromElement)){ 
		src.style.cursor = 'default'; 
		src.bgColor = clrOver; 
	} 
} 

function mOut(src,clrIn){ 

if (!src.contains(event.toElement)){ 

src.style.cursor = 'default'; 

src.bgColor = clrIn; 

} 
}
/*misc functions*/

