//<script>

//if (document.URL.indexOf("cc_welcome.asp")==-1) {load()}

/*
window.onerror = handleErrors
function handleErrors(){return true}
*/

if (document.URL.toLowerCase().indexOf("embroideryoffice.com/")!=-1 ||
	document.URL.toLowerCase().indexOf("embroideryabc.com/")!=-1 ||
	document.URL.toLowerCase().indexOf("technologysouth.com/")!=-1) {	
	
	// NS7 DIFFERS FROM IE5 IN DISPLAY .CONTAINER DIV PROPERTIES AT eABC.com
	if (document.URL.toLowerCase().indexOf("embroideryabc.com/")!=-1){
		//if (navigator.userAgent.toLowerCase().indexOf("netscape")!=-1 || navigator.userAgent.toLowerCase().indexOf("opera")!=-1)
		if (navigator.userAgent.toLowerCase().indexOf("gecko/")!=-1){
			document.write("<style>.Container{width:520px}.mnbtn,.mnbtns{padding:0px}</style>")
			/*if (document.URL.toLowerCase().substring(document.URL.length-1,document.URL.length)=="/" || document.URL.toLowerCase().indexOf("default.asp")!=-1)
				document.write("<style>body{margin-left:0px;}</style>")*/
		}
		else if (navigator.userAgent.toLowerCase().indexOf("opera")!=-1)
			document.write("<style>.Container{width:740px}.mnbtn,.mnbtns{padding:0px}</style>")		
	}
	
	var turl = document.URL
	var jv = "True"	
	if (navigator.javaEnabled() < 1) {jv = "False"}
	var pgname = window.location.pathname;
	pgname = pgname.substring(pgname.lastIndexOf('/') + 1);
	var rf = document.referrer
	if (turl.indexOf("?ref=")!=-1)	
		rf = turl.substring(turl.lastIndexOf("?ref=")+5,turl.length)
	var oe = window.name
	if (oe.toLowerCase().indexOf("_unspecifiedframe")!=-1 && rf=="")
		rf = "MS+Outlook+Express"
	document.write( "<script language=\"JavaScript\" src=\"/cgi-local/Functions/NewUser.asp?ref="+ rf +"&res="+ window.screen.width + "x" + window.screen.height +"&cl="+ window.screen.colorDepth +"&jv="+ jv +"&pg="+ pgname +"\"><\/script>" )
	//alert("<script language=\"JavaScript\" src=\"/bin/Functions/NewUser.asp?ref="+ rf +"&res="+ window.screen.width + "x" + window.screen.height +"&cl="+ window.screen.colorDepth +"&jv="+ jv +"&pg="+ pgname +"\"><\/script>")
}


if (document.URL.indexOf("babelfish")==-1 && document.URL.indexOf("translate?")==-1 && 
document.URL.indexOf("cache:")==-1 && (document.URL.indexOf("cc_")==-1 || document.URL.indexOf("login")!=-1 || document.URL.indexOf("support")!=-1 || document.URL.indexOf("regis")!=-1)) {load()}

var iurl ="images/tbar/"
var hurl =""
if (document.URL.indexOf("/esp/")!=-1 || document.URL.indexOf("/portu/")!=-1)	iurl="../"+iurl
if (document.URL.indexOf("/esp/")!=-1 || document.URL.indexOf("/ESP/")!=-1)		hurl="s_"
if (document.URL.indexOf("/portu/")!=-1 || document.URL.indexOf("/PORTU/")!=-1)	hurl="p_"

function tbar() {
	
	var lk0=new Array("default.asp","products1.htm","cc_login.asp","contact.asp")
	var lk1=new Array("default.asp","s_products1.htm","s_cc_login.asp","s_contact.asp")
	var lk2=new Array("default.asp","p_products1.htm","p_cc_login.asp","p_contact.asp")
	var lk=new Array()
	var tx0=new Array("Home","Products","Customer Service","Contact Us")
	var tx1=new Array("Inicio","Productos","Servicio al Cliente","Contáctenos")
	var tx2=new Array("Inicio","Produtos","Clube de Clientes","Contacte-nos")	
	var tx=new Array()	
	
	if (hurl=="s_"){		tx=tx1;lk=lk1
	}else if (hurl=="p_"){	tx=tx2;lk=lk2
	}else{					tx=tx0;lk=lk0
	}

	var h=	"<table width='100%' border=0 cellspacing=0 cellpadding=0><tr>"+
		"<td><img src=http://www.embroideryoffice.com/images/tbar/tbar-06.jpg align=absbottom hspace=5></td>"+
		"<td align=right>"+
		"&nbsp;<img src=http://www.embroideryoffice.com/images/tbar/tbar-02.GIF align=absmiddle hspace=4><a href=http://www.embroideryoffice.com/default.asp target=_top>English</a> &nbsp;| "+		
		"&nbsp;<img src=http://www.embroideryoffice.com/images/tbar/tbar-04.GIF align=absmiddle hspace=4><a href=http://www.embroideryoffice.com/esp/default.asp target=_top>Español</a> &nbsp;| "+
		"<img src=http://www.embroideryoffice.com/images/tbar/tbar-03.GIF align=absmiddle hspace=4><a href=http://www.embroideryoffice.com/portu/default.asp target=_top>Português</a> "+
		"&nbsp;&nbsp;</td></tr><tr><td colspan=2>"+
		"<table border=0 width='100%' cellpadding=1 cellspacing=0 bgcolor=black><tr><td>"+
		"<table border=0 width='100%' cellpadding=0 cellspacing=0 bgcolor=white><tr><td background=http://www.embroideryoffice.com/images/tbar/tbar-05.JPG class=size2>"+
		"<b><font color=#FFFFFF>&nbsp;&nbsp;"+
		"&nbsp;&nbsp;"+
		"&nbsp;&nbsp;<a href="+ lk[0] +" class=subbar target=_top>"+ tx[0] +"</a>&nbsp;|"+
		"&nbsp;&nbsp;<a href="+ lk[1] +" class=subbar>"+ tx[1] +"</a>&nbsp;&nbsp;|"+
		"&nbsp;&nbsp;<a href="+ lk[2] +" class=subbar>"+ tx[2] +"</a>&nbsp;&nbsp;|"+			
		"&nbsp;&nbsp;<a href="+ lk[3] +" class=subbar>"+ tx[3] +"</a>"+
		"</font></b>"+
		"</td></tr></table></td></tr></table>"+
		"</td></tr>"+
		"<tr><td colspan=2 height=25>"+
		"</td></tr>"+
		"</table>"
	document.write(h)
}



function mbar(ar,c) {	
	var hcol,imgsep,ncol=""	
	switch (c){		
		case 2:		//Product Information
			hcol="#91B1D9"
			ncol="#3C6DAA"
			imgsep="aoo_7_d2.jpg"
			break;
		case 3:		//Customer Service
			hcol="#B3D09D"
			ncol="#84B362"
			imgsep="aoo_8_d2.jpg"
			break;
		case 4:		//Contact us
			hcol="#DFAABE"
			ncol="#BF557D"
			imgsep="tsi_8_d2.jpg"
			break;
		case 5:		//Private Area
			hcol="#E1E100"
			ncol="#808000"
			break;			
		case 6:		//MyHome@EO
			hcol="#D592EB"
			ncol="#8B20AE"
			break;			
		default:
			hcol="cyan"
			ncol="#056DFA"			
			break;
	}	
	var h="<table width='85%' border=0><tr><td>"
	if (ar[0].indexOf("[")==-1)	{
		h+="<table width='100%' bgcolor=#333366 border=0 cellpadding=0 cellspacing=0>"
	}
	for (var i=0;i<ar.length;i++) {				
		if (ar[i].indexOf("[")!=-1) {
			ar[i]=ar[i].substring(ar[i].lastIndexOf("[")+1,ar[i].length-1)			
			if (i>0){h+=	"</table>"	}
			h+=	"<table border=0 height=20><tr>"+
				"<td nowrap valign=bottom class=size1><b>"+ ar[i] +"</b></td></tr></table>"+				
				"<table width='100%' bgcolor=#333366 border=0 cellpadding=0 cellspacing=0>"				
		}else if (ar[i].indexOf(">")!=-1) {
			ar[i]=ar[i].substring(ar[i].lastIndexOf(">")+1,ar[i].length-1)			
			if (i>0){h+=	"</table>"	}
			h+=	"<table border=0 height=20><tr>"+
				"<td nowrap valign=bottom class=size1><b style=color:white>"+ ar[i] +"</b></td></tr></table>"+				
				"<table width='100%' bgcolor=#333366 border=0 cellpadding=0 cellspacing=0>"				
		}else if(ar[i]=="#sep#") {		
			h+=	"<tr><td></td></tr></table>"
			h+=	"<table height=20><tr><td></td></tr></table>"+				
				"<table width='100%' bgcolor=#333366 border=0 cellpadding=0 cellspacing=0>"
		}else if(ar[i].indexOf("{bold}")!=-1) {
			t=ar[i].substring(ar[i].lastIndexOf("}")+1,ar[i].length)
			t=t.split("$")
			
			h+=	"<tr bgcolor=#91B1D9><td class=CATEGORY height=20 onClick=mClk(this); onMouseOut=\"mOut(this,'#91B1D9');\" onMouseOver=\"mOvr(this,'#91B1D9');\">"+
				"&nbsp;<a href="+ t[1] +" title='"+ t[0] +" "+ t[2] +"'>"+ t[0] +"</a></td></tr>"
		}else{
			tmpar=ar[i].split("$")
			t=tmpar[1].substring(0,tmpar[1].lastIndexOf("."))
			if (document.URL.indexOf(t)!=-1) {
				h+=	"<tr bgcolor='"+ hcol +"'><td height=17 class=size1 nowrap>&nbsp;<b>"+
					tmpar[0] +"</b>&nbsp;</td></tr>"
			}else{
				h+=	"<tr bgcolor="+ ncol +"><td class=CATEGORY height=17 nowrap onClick=mClk(this); onMouseOut=\"mOut(this,'"+ ncol +"');\" onMouseOver=\"mOvr(this,'"+hcol+"');\">"+
					"&nbsp;<a href="+ tmpar[1] +" title='"+ tmpar[0] +" "+ tmpar[2] +"'>"+ tmpar[0] +"</a>&nbsp;</td></tr>"
			}
		}
		h+=	"<tr><td height=1 background=http://www.gosierra.com/images/"+ imgsep +"></td></tr>"
	}
	h+="</table></td></tr></table>"
	document.write(h)
}

function langs() {
var h = ""+
"<div style=padding-left:16px;padding-top:25px>"+
"<img src=http://www.embroideryoffice.com/images/flags/uk.gif align=absmiddle> <a href=http://www.embroideryoffice.com/ style=color:white>English</a><br>"+
"<img src=http://www.embroideryoffice.com/images/flags/spain.gif align=absmiddle vspace=3> <a href=http://www.embroideryoffice.com/esp/ style=color:white>Español</a><br>"+
"<img src=http://www.embroideryoffice.com/images/flags/portugal.gif align=absmiddle> <a href=http://www.embroideryoffice.com/portu/ style=color:white>Português</a></div>"
document.write( h )
}

function mOvr(src,clrOver) {
	if (!src.contains(event.fromElement)) {
		src.style.cursor = 'hand';
		src.bgColor = clrOver;
	}
}

function mOut(src,clrIn) {
	if (!src.contains(event.toElement)) {
		src.style.cursor = 'default';
		src.bgColor = clrIn;
	}
}

function mClk(src) {
    if(event.srcElement.tagName=='TD'){
		src.children.tags('A')[0].click();
    }
}


function load() {}

function lk(l,i){
	//parent.footer.location = "/footer.asp?newclick="+ i
	location.href = l
}

function realname(n,c,i){/*
	if ( n.length>2 && c.length>2 ) {
		parent.footer.location = "/footer.asp?data="+ i +"&realname="+ n +"%20["+ c +"]"
	}*/
}

function pshow(path,pid) {
	window2=open( path +'?pid='+ pid ,'secondWindow','status=yes,resizable=yes,scrollbars=yes,width=350,height=400');
	window2.moveTo(50,50);
	window2.focus();
}

function redir(url){			
	//if (confirm("Your name is not logged as a Club User.\nWould you like to log in now?")) parent.main.location.href=url;
	alert("Your name is not logged as a Club User!")
}

function popup(imagepath) {
	window2=open((imagepath),"secondWindow","scrollbars=yes,width=480,height=400")
	window2.document.bgColor="white";	
}

function popupzoom(im,wd,ht,lng) {
	zoomdirpath = "/zoom/3d-detail.asp?im=";
	window2=open((zoomdirpath+im+".jpg&wd="+wd+"&lang="+lng+"&ht="+ht+" "),"secondWindow","locationbar=visible,resizable=no,resizable=0,scrollbars=no,width="+wd+",height="+ht+" ");
}

function popuptour(url){
	wz5=open(url,"secondWindow","menubar=yes,toolbar=yes,links=yes,location=yes,personalbar=yes,resizable=yes,scrollbars=yes,width=790,height=425");
	wz5.moveTo(0,0);
	wz5.focus();	
}

function cctbar() {	
	var ilogo="cc-logo.jpg"
	if (document.URL.indexOf("/esp/")!=-1) {ilogo="cclub_sp_logo.JPG"}
	else if (document.URL.indexOf("/portu/")!=-1) {ilogo="cclub_pt_logo.JPG"}
	var h=	"<table border=0 width='100%' cellspacing=0 cellpadding=0><tr><td>"+
			"<img src='http://www.embroideryoffice.com/cclub/images/"+ ilogo +"' vspace=5>"+
			"</td><td align=right class=system>"
			if ( document.URL.indexOf("cclub/esp/")!=-1 || document.URL.indexOf("cclub/portu/")!=-1) {
				h +="&nbsp;<img src=http://www.embroideryoffice.com/images/tbar/tbar-02.GIF align=absmiddle hspace=4><a href=../cc_welcome.asp>English</a> | "+
					"&nbsp;<img src=http://www.embroideryoffice.com/images/tbar/tbar-04.GIF align=absmiddle hspace=4><a href=../esp/s_cc_welcome.asp>Español</a> | "+
					"<img src=http://www.embroideryoffice.com/images/tbar/tbar-03.GIF align=absmiddle hspace=4><a href=../portu/p_cc_welcome.asp>Português</a>"
			}else{
				h +="&nbsp;<img src=http://www.embroideryoffice.com/images/tbar/tbar-02.GIF align=absmiddle hspace=4><a href=cc_welcome.asp>English</a> | "+
					"&nbsp;<img src=http://www.embroideryoffice.com/images/tbar/tbar-04.GIF align=absmiddle hspace=4><a href=esp/s_cc_welcome.asp>Español</a> | "+
					"<img src=http://www.embroideryoffice.com/images/tbar/tbar-03.GIF align=absmiddle hspace=4><a href=portu/p_cc_welcome.asp>Português</a>"
			}
	h +="&nbsp;&nbsp;</td></tr><tr><td colspan=2><table border=0 width='100%' cellspacing=0 cellpadding=1 bgcolor=black><tr><td>"+
		"<table border=0 width='100%' cellspacing=0 cellpadding=0 bgcolor=white><tr><td width='100%' "+
		"background='http://www.embroideryoffice.com/images/tbar/tbar-05-cc.JPG' height=15 class=size1>.</td></tr></table>"+
		"</td></tr><tr><td width='100%' height=25 bgcolor=#FFFFFF></td></tr></table></td></tr></table>"
	document.write(h)
}

function detect(){
if (document.URL.toLowerCase().indexOf("/s_")!=-1)
	document.location.href="/esp/?ref="+document.referrer
else
	document.location.href="/?ref="+document.referrer
}