<!--
window.status="WEB SITE DESIGNED BY Southwold Design Studio For enquiries call Jackie 01728 454044 www.southwold-design.co.uk";

var ve=false;	// true - the main menu runs vertically, false - horizontally
var popwin;
//	Modify following four lines to customize your menu
var tdColor="#42724a";		// menu item text color
var tdBgColor="#ffff99";	// menu item background color
var hlColor="#cc9900";		// highlight text color
var hlBgColor="#ffff99";	// highlight background color
//	After change, modify same values in your *.css file

var StdWindow=",resizeable";
var md=150;
var ti=-1;
var oTd=new Object;
oTd=null;

var tt="";
var sT="";
var pT=new Array();
var tA=new Array();


// sets the menu options
td_1 = "Home"
url_1 = "default.asp"


td_2 = "Fabrics"
td_2_1="Roger Austin"
url_2_1 = "fabrics_new.asp?catid=4"
td_2_2="KandK"
url_2_2 = "fabrics_new.asp?catid=3"



td_3 = "Wallcoverings"

td_3_1="Coordinated"
url_3_1 = "fabrics_new.asp?catid=1"

td_3_2="Wallpapers"
url_3_2 = "fabrics_new.asp?catid=7"
/*td_3_2_1="Gondwana"
url_3_2_1="wallpapers.asp?paperstyle=gond"*/

td_3_3="Vinyls"
url_3_3 = "fabrics_new.asp?catid=6"
/*td_3_3_1="Moire"
url_3_3_1 = "vinyls.asp?vinstyle=moire"
td_3_3_2="Grand Gala"
url_3_3_2 = "vinyls.asp?vinstyle=grand"*/

td_3_4="Textiles"
url_3_4 = "fabrics_new.asp?catid=5"
/*
td_3_4_1="Astrotex"
url_3_4_1="textiles.asp?textstyle=astro"
td_3_4_2="Off White"
url_3_4_2="textiles.asp?textstyle=offwhite"
td_3_4_3="Oriental"
url_3_4_3="textiles.asp?textstyle=orient"
td_3_4_4="Natural"
url_3_4_4="textiles.asp?textstyle=natural"
td_3_4_5="Peau de Peche"
url_3_4_5="textiles.asp?textstyle=peau"
td_3_4_6="Pure Silk"

td_3_5="Digital Wall Art - Murals"
url_3_5 = "fabrics_new.asp?catid=2"

td_3_5_1="Wallpower"
url_3_5_1="digital_wall.asp"

td_3_5_2="Wallpower for Kids"
url_3_5_2="digital_wall_kids.asp"
*/
td_3_5="Digital Wall Art For Kids"
url_3_5 = "fabrics_new.asp?catid=8"

td_4 = "Samples"
url_4 = "samples.asp"


td_5 = "Book Club"
url_5 = "book_club.asp"


td_6 = "Free Fabric Stand"
url_6 = "fabric_stand.asp"

td_7 = "Stockists"
url_7 = "stockist.asp"

td_8 = "Contact Us"
url_8 = "contact_us.asp"

/*td_9 = "Clearance"
url_9 = "clearence_new.asp"

td_10 = "Site Map"
url_10 = "sitemap.htm"*/


function doMenu(td){

	clearTimeout(ti);
	td.style.backgroundColor=hlBgColor;
	td.style.color=hlColor
	td.style.cursor = 'pointer';
	//alert(img);
	//alert(typeof(img) != "undefined");
	
	var i;
	var sT="";
	var tda=new Array();
	tda=td.id.split("_");
	if(oTd!=null){
		var tdo=new Array();
		tdo=oTd.id.split("_");
		for(i=1;i<tdo.length;i++){
			sT+="_"+tdo[i];
			if(tdo[i]!=tda[i]){
				document.getElementById("td"+sT).style.backgroundColor=tdBgColor;
				document.getElementById("td"+sT).style.color=tdColor;
				if(document.getElementById("tbl"+sT)!=null)
					document.getElementById("tbl"+sT).style.visibility="hidden";
			}
		}			
	}
	oTd=td;
	sT="tbl";
	for(i=1;i<tda.length;i++)
		sT+="_"+tda[i];
	if(document.getElementById(sT)!=null)
		document.getElementById(sT).style.visibility="visible";

}


function clearMenu(){
	if(oTd!=null){
		var tdo=new Array();
		tdo=oTd.id.split("_");
		var sT="";
		for(var i=1;i<tdo.length;i++){
			sT+="_"+tdo[i];
			document.getElementById("td"+sT).style.backgroundColor=tdBgColor;
			document.getElementById("td"+sT).style.color=tdColor;
			if(document.getElementById("tbl"+sT)!=null)
				document.getElementById("tbl"+sT).style.visibility="hidden";
		}
		oTd=null;			
	}
}
function runMenu(strURL,winName,Height,Width,newWin){
	
if (typeof(winName) != "undefined") {
	(winName == "_blank") ? window.open(strURL,winName) : window.open(strURL,winName,'Height='+Height+",Width="+Width+StdWindow);
	}
else	{
	location.href=strURL;
	}
}




function getCoord(st){

	// st = _1 , _2 , _5_2  etc
	tA=st.split("_");
	// CALCULATES THE 3rd MENUE
	if(tA.length>2){
	
		// tA turns _5_2	into ,5,2
		tA=tA.slice(0,-1);  // now ,5
		tt=tA.join("_");    // tt is _5
		return (document.getElementById("tbl"+tt).offsetTop+document.getElementById("td"+st).offsetTop+4)+"px;left:"+			(document.getElementById("tbl"+tt).offsetLeft+document.getElementById("td"+st).offsetWidth-2)+"px'>";
	}
	// CALCULATES THE 2nd MENU
	var p1=ve?document.getElementById("td"+st).offsetTop+4:document.getElementById("td"+st).offsetHeight+1;
	
//	alert(document.getElementById("mainmenu").offsetLeft)
	var p2=ve?document.getElementById("mainmenu").offsetWidth-4:document.getElementById("td"+st).offsetLeft+5;

	return	(document.getElementById("mainmenu").offsetTop+p1)+"px;left:"+(document.getElementById("mainmenu").offsetLeft+p2)+"px'>";
}




function draw_menue()
{

if(document.getElementById){

	var img_show;
	var g1=ve?"":"<tr>";
	var g2=ve?"":"<td width='100%'>&nbsp;</td></tr>";
	var v1=ve?"<tr>":"";
	var v2=ve?"</tr>":"";
	var v3=ve?" style='float:left'>":">";
	var sH="<table class='menu2' id='mainmenu' width='100%' cellspacing='0'"+v3+g1;
	var p=0;
	var j=0;
	while(eval("typeof(td_"+ ++j +")!='undefined'"))
		{
			
			sH+=v1+"<td id='td_"+j+"'  onmouseover=\"doMenu(this)\" onmouseout=\"ti=setTimeout('clearMenu()',md)\"";
			sH+=(eval("typeof(url_"+j+")!='undefined'"))?" onclick=\"runMenu('"+eval("url_"+j)+"":"";
			if (eval("typeof(popn_"+j+")!='undefined'"))
				sH+="','"+eval("popn_"+j)+"','"+eval("poph_"+j)+"','"+eval("popw_"+j);
			sH+=(eval("typeof(url_"+j+")!='undefined'"))?"')\">":">";
			sH+=eval("td_"+j)+"</td>"+v2;
			if (eval("typeof(td_"+j+"_1)!='undefined'"))
				pT[p++]="_"+j;
		}
	sH+=g2+"</table>";
	//alert("1 st " + sH);

	document.write(sH);
// *************************
// mc now find coords of main table just written
//alert(document.getElementById("mainmenu").offsetLeft);


// ****************************

	for(var q=0;typeof(pT[q])!="undefined";q++)
		{
			sT=pT[q];
	/*alert(typeof(sT));
	alert(sT);*/
	sH="";
	j=0;
	sH+="<table class='menu' id='tbl"+sT+"' cellspacing='0' style='top:"+getCoord(sT);
	while(eval("typeof(td"+sT+"_"+ ++j +")!='undefined'")){
		sH+="<tr><td id='td"+sT+"_"+j+"' onmouseover='doMenu(this)' onmouseout=\"ti=setTimeout('clearMenu()',md)\"";
		sH+=(eval("typeof(url"+sT+"_"+j+")!='undefined'"))?" onclick=\"runMenu('"+eval("url"+sT+"_"+j)+"":"";
		if (eval("typeof(popn"+sT+"_"+j+")!='undefined'"))
			sH+="','"+eval("popn"+sT+"_"+j)+"','"+eval("poph"+sT+"_"+j)+"','"+eval("popw"+sT+"_"+j);
		sH+=(eval("typeof(url"+sT+"_"+j+")!='undefined'"))?"')\">":">";
//		alert(sH);
		sH+=eval("td"+sT+"_"+j)+"</td></tr>";
		if (eval("typeof(td"+sT+"_"+j+"_1)!='undefined'"))
			pT[p++]=sT+"_"+j;
	}
	sH+="</table>";
	//alert("2nd " + sH);
	
	document.write(sH);
	
}
document.getElementById("mainmenu").style.visibility="visible";
}
else document.write("<p>This page uses DHTML and DOM, but your browser doesn't support them.</p>");

}



function MM_preloadImages() { //v3.0
  var d=document; 
  if(d.images)
	{ 
		
		if(!d.MM_p) d.MM_p=new Array();
		var i
		var j=d.MM_p.length
		var 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];
							
						}
				}
		hide(loading);		
				
	}
}

function hide(obj)
{
obj.style.visibility='hidden';
}

function show_large(img)
{
document.range.src='rangeimage/' + img;
}
function hand(elem)
{
elem.style.cursor = 'pointer';
}

function hand_more(elem)
{
elem.style.cursor = 'pointer';
elem.src='buttons/but_more_ro.gif';
}
function hand_back(elem)
{
elem.style.cursor = 'pointer';
elem.src='buttons/but_back_ro.gif';
}

function show_div(dv)
{
d1.style.visibility='hidden';
d2.style.visibility='hidden';
dv.style.visibility='visible';
}

function show_book_club_div(dv)
{
//alert (f.scr_width.value);
//alert (document.getElementById("main_div").style.width);
var dob;
var lft;
var t;
for (var ob=1;ob <= f.max_id.value ;ob++)
	{
		dob='d' + ob
		if(document.getElementById(dob)) document.getElementById(dob).style.visibility='hidden';
		
	}
t=f.scr_width.value/2 - 350
lft=t + "px"
dv.style.left=lft;

dv.style.visibility='visible';
}
function trim(a)
{	
	while (a.indexOf(" ")==0){
		a= a.substring(1,a.length);
	}
	while (a.charAt(a.length-1)==" "){
		a= a.substring(0,a.length-1);
	}
	return a;
}

function set_county(cty) // from stockists
{

	for (var x=0; x < f.county.length ; x++)
	{
		if (f.county.options[x].text==cty) f.county.selectedIndex=x;
	}
	//f.sub.value='search';
	f.dummy.value='go';
	document.f.submit();
}

function tm()
{
var tim=setTimeout("hide(loading);",5000);
}

function change_butt(ob,img)
{
	ob.src='buttons/' + img;
	ob.style.cursor = 'pointer';
}
function open_win(url,t,l,w,h)
{
	if (popwin != null) popwin.close();
	popwin=window.open(url,"","top=" + t + ",left=" + l + ",width=" + w + ",height=" + h );
	
}
//-->