//<script>

window.onerror = handleErrors
function handleErrors(){return true}

//if (document.URL.indexOf("cc_welcome.asp")==-1) {load()}

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=""
	var ncol=""	
	switch (c){		
		case 2:		//Product Information
			hcol="#00FF00"
			ncol="green"
			break;
		case 3:		//Customer Service
			hcol="#FF80FF"
			ncol="#AA00AA"
			break;
		case 4:		//Contact us
			hcol="orange"
			ncol="#C15F0D"
			break;
		case 5:		//Private Area
			hcol="#E1E100"
			ncol="#808000"
			break;			
		default:
			hcol="cyan"
			ncol="#056DFA"			
			break;
	}	
	var h="<table width='100%' border=0><tr><td>"
	if (ar[0].indexOf("[")==-1)	{
		h+="<table width='100%' border=0 cellspacing=0 cellpadding=1 bgcolor=black><tr><td>"+
		"<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></td></tr></table>"	}
			h+=	"<table border=0 height=20><tr>"+
				"<td nowrap valign=bottom class=size1><b>"+ ar[i] +"</b></td></tr></table>"+
				"<table width='100%' border=0 cellspacing=0 cellpadding=1 bgcolor=black><tr><td>"+
				"<table width='100%' bgcolor=#333366 border=0 cellpadding=0 cellspacing=0>"				
		}else if(ar[i]=="#sep#") {		
			h+=	"<tr><td></td></tr></table></td></tr></table>"
			h+=	"<table height=20><tr><td></td></tr></table>"+
				"<table width='100%' border=0 cellspacing=0 cellpadding=1 bgcolor=black><tr><td>"+
				"<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=#E30000><td class=CATEGORY height=20 onClick=mClk(this); onMouseOut=\"mOut(this,'#E30000');\" onMouseOver=\"mOvr(this,'#E30000');\">"+
				"&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,'#E30000');\">"+
					"&nbsp;<a href="+ tmpar[1] +" title='"+ tmpar[0] +" "+ tmpar[2] +"'>"+ tmpar[0] +"</a>&nbsp;</td></tr>"
			}
		}
		h+=	"<tr><td bgcolor=black><img src=/images/misc/white.gif height=1></td></tr>"
	}
	h+=	"</table></td></tr></table>"
	if (hurl=="s_") h+="<!-- BEGIN HumanClick Button Code --><table border='0' cellspacing='0' cellpadding='0'><tr><td align='center'><a href='http://hc2.humanclick.com/hc/90987566/?cmd=file&file=visitorWantsToChat&site=90987566&byhref=1' target='chat90987566' onClick=\"window.open('http://hc2.humanclick.com/hc/90987566/?cmd=file&file=visitorWantsToChat&site=90987566','chat90987566','width=472,height=320');return false;\"><img src='http://hc2.humanclick.com/hc/90987566/?cmd=repstate&site=90987566&category=es;general;set-h&ver=1' name='hcIcon' width=78 height=88 border=0></a></td></tr><tr><td align='center'><a href='http://hc2.humanclick.com/hc/90987566/?cmd=PoweredByPage&site=90987566' target='_top'><img src='http://hc2.humanclick.com/hc/90987566/?cmd=hccredit&site=90987566' width=106 height=35 border=0></a></td></tr></table><!-- END HumanClick Button code -->"	
	h+="</td><td><img src=/images/misc/white.gif width=10></td></tr></table>"
	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() {
/*
	if ((navigator.appVersion).indexOf("Mozilla/2.0")==-1 || (navigator.appVersion).indexOf("Mozilla/3.0")==-1) {
		window.onerror=null		
		var ref = document.referrer
		var loc = window.top.location.pathname
		var sch = window.top.location.search
		var p = loc.substring(loc.lastIndexOf('/')+1)
		var jv = "True"
		if (navigator.javaEnabled() < 1) 
			jv = "False";
		var osdata = "cl="+ window.screen.colorDepth +"&res="+ window.screen.width + "x" + window.screen.height +"&jv="+ jv 
		if (window.name!="main") {
			if (document.URL.indexOf("/cclub")!=-1){
				if (document.URL.indexOf("/s_")!=-1){
					window.top.location.href = "http://www.embroideryoffice.com/cclub/esp/s_cc_start.asp?ref="+ ref +"&newpg="+ p + sch +"&"+ osdata
				}else if (document.URL.indexOf("/p_")!=-1){
					window.top.location.href = "http://www.embroideryoffice.com/cclub/portu/p_cc_start.asp?ref="+ ref +"&newpg="+ p + sch +"&"+ osdata
				}else{
					window.top.location.href = "http://www.embroideryoffice.com/cclub/cc_start.asp?ref="+ ref +"&newpg="+ p + sch +"&"+ osdata
				}
			}else{
				if (document.URL.indexOf("/s_")!=-1){
					window.top.location.href = "http://www.embroideryoffice.com/esp/bienvenido.asp?ref="+ ref +"&newpg="+ p + sch +"&"+ osdata
				}else if (document.URL.indexOf("/p_")!=-1){
					window.top.location.href = "http://www.embroideryoffice.com/portu/benvindo.asp?ref="+ ref +"&newpg="+ p + sch +"&"+ osdata
				}else{
					window.top.location.href = "http://www.embroideryoffice.com/welcome.asp?ref="+ ref +"&newpg="+ p + sch +"&"+ osdata
				}
			}
		}else{
			window.top.document.title = window.top.frames['main'].document.title
		}
	}
*/	

}

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 = "http://www.technologysouth.com/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)
}