//<script>
/*
window.onerror = handleErrors
function handleErrors(){return true}
*/

function doChangeLang(){
var u = document.URL
var p = u.substring(u.lastIndexOf("/")+1,u.length)
var newu = "";
if (u.toLowerCase().indexOf("/esp/s_eosc")!=-1)
	newu = "../"+ p.substring(2,p.length)
else
	newu = "esp/s_"+ p
/*alert(p)
alert(newu)*/
document.location.href=newu
}




var p_date, p_version, p_price;
var tDM1, tDM2, tDM3;

function doPack(pack,p_date,p_version,p_price,conts){
document.getElementById("Det2").innerHTML = "";
var c = "";
var hm = "";
for (var i=0; i<conts.length; i++) {
	var cs = conts[i].split(".");
	c += "<DIV><SPAN STYLE='float:left;width:75%;'><img src=\"/eosc/images/icon_"+cs[1]+".gif\" align=absmiddle hspace=2>"+cs[2]+"</SPAN><SPAN style='float:left;width:20%;'>"+cs[0]+"</SPAN></div>";
	var tnum = pack.toLowerCase();
	tnum = tnum.substring(tnum.lastIndexOf("x")+1,tnum.length)
	for (var k=0; k<tnum; k++) {
		hm += "<img src=\"/myhome/images/comp/"+ cs[1] +"/"+escape(pack)+"/"+ cs[1] +""+ (k+1)+"."+ cs[3] +"\" border=1 vspace=2 hspace=2> "
		if (cs[1]=="fonts") hm+="<br>"
	}
}
document.getElementById("Det2").innerHTML = c;
document.getElementById("PackDownload").href = "http://www.embroideryoffice.co/eosc/download.asp?action=download&comp="+cs[1]+"&file="+escape(pack)+"&gst=1";
document.getElementById("PackTitle").innerHTML = pack;
document.getElementById("Sum2").innerHTML = /*p_date +"<br>"+ */	p_version +"<br>"+ p_price;
//var tnum = pack.toLowerCase();
//tnum = tnum.substring(tnum.lastIndexOf("x")+1,tnum.length)
/*/for (var i=0; i<tnum; i++) {
	hm += "<img src=\"../myhome/images/comp/"+ (conts)[1] +"/"+escape(pack)+"/cp"+(i+1)+".gif\" border=1 vspace=2 hspace=2> "	
}*/
//http://www.embroideryoffice.com/myhome/images/comp/cp/ExtraEO3CP-F1x20/cp1.gif
document.getElementById("ThumbList").innerHTML = hm
}

function DM(ix){
for (var i=1; i<4; i++) {
	if (eval("document.getElementById('DropM"+i+"')"))
		eval("document.getElementById('DropM"+i+"').style.visibility='hidden';")
}
if (!isNaN(ix)) eval("document.getElementById('DropM"+ix+"').style.visibility='visible';");
}

/*------------------------------------------------------------------------------------------------------------------------------*/
/*		FUNCIONES PARA LA PAGINA DE ARTE DEL BORDADO																			*/
/*------------------------------------------------------------------------------------------------------------------------------*/
function doThumbView(ver){
var hm,tl = "";
//if (parseInt(ver)>=8) {ver="-v8"}else{ver=""}
var as = new Array();
hm = "<span></span>"
for (var i=0; i<art.length; i++) {
	var as = art[i].split(".")			
	tl = as[1];
	if (tl.indexOf(" - ")!=-1) {tl=(tl.split(" - "))[0]+"<br><small>"+ (tl.split(" - "))[1] +"</small>"}
	hm += "<a href=\"javascript:showArticle('"+as[0]+"','"+as[1]+"','"+as[2]+"',"+as[3]+",'"+as[4]+"', '"+ver+"');\" class=ABList Style='display:block' ><DIV CLASS=TMB><img OnLoad='doSize(this,54)' class=abthumb src=\"http://www.embroideryoffice.com/kbase/sip/images/"+ as[0].substring(0,11) +"_6.gif\" vspace=3 border=0></DIV>"+tl+"</a> "
}
document.getElementById("ThumbView").innerHTML = hm;
}

function showArticle(art_id,art_title,art_category,art_complexity,art_date, ver){
var cx = doComplexity(art_complexity);
var art_pdf = art_id.split("-")
var lg3 = "EN";
if (lg=="_sp") lg3 = "SP"
if (document.URL.toLowerCase().indexOf("eosc/esp/s_")!=-1)
	lg3 = "SP"
if (parseInt(ver)>=8)
	art_pdf = art_pdf[0] +"-"+ lg3 +"-"+ art_pdf[1] +"-"+ art_pdf[2] +"-v8";
else
	art_pdf = art_pdf[0] +"-"+ lg3 +"-"+ art_pdf[1] +"-"+ art_pdf[2];
document.getElementById("ABView").innerHTML = "<EMBED SRC=\"http://www.embroideryoffice.com/AB/"+art_id+"/"+lg2+"/"+art_pdf+".pdf\" HEIGHT=500 WIDTH=520> <NOEMBED> Your browser does not support embedded PDF files. Please, <a href=\""+art_pdf+"\" target=_blank>click here</a></NOEMBED> </EMBED><!--</OBJECT>--> "
document.getElementById("Sum2").innerHTML = art_category+"<br>"+cx+"<br>"+art_date;
document.getElementById("PackTitle").innerHTML = art_id +": <i style='font-weight:normal'>"+ art_title +"</i>";
if (parseInt(ver)>=8) {
	document.getElementById("Det4").innerHTML = ""+		
		"<a href=\"http://www.embroideryoffice.com/AB/"+art_id+"/"+art_id+".zip\"><img src=\"http://www.embroideryoffice.com/kbase/sip/images/icon_zip.gif\" align=absmiddle hspace=4 border=0 vspace=2>ZIP</a><br>"+
		"<a href=\"http://www.embroideryoffice.com/AB/"+art_id+"/"+lg2+"/"+art_pdf+".pdf\"><img src=\"http://www.embroideryoffice.com/kbase/sip/images/icon_pdf.gif\" align=absmiddle hspace=4 border=0>PDF</a><br>";
}else{
	document.getElementById("Det4").innerHTML = ""+
		"<a href=\"http://www.embroideryoffice.com/AB/"+art_id+"/"+art_id+".exe\"><img src=\"http://www.embroideryoffice.com/kbase/sip/images/icon_exe.gif\" align=absmiddle hspace=4 border=0>EXE</a><br>"+
		"<a href=\"http://www.embroideryoffice.com/AB/"+art_id+"/"+art_id+".zip\"><img src=\"http://www.embroideryoffice.com/kbase/sip/images/icon_zip.gif\" align=absmiddle hspace=4 border=0 vspace=2>ZIP</a><br>"+
		"<a href=\"http://www.embroideryoffice.com/AB/"+art_id+"/"+lg2+"/"+art_pdf+".pdf\"><img src=\"http://www.embroideryoffice.com/kbase/sip/images/icon_pdf.gif\" align=absmiddle hspace=4 border=0>PDF</a><br>";
}
}
function doComplexity(a){
var c = "";
for (var i=1; i<=5; i++) {
	if (i<=a){
		c += "<b class=complexity1>*</b>&nbsp;"
	}else{
		c += "<b class=complexity2>*</b>&nbsp;"
	}
}
return c;
}
function doPrint(){
parent["ABView"].focus()
parent["ABView"].print()
}
/*
function doSize(obj,sz){
imh = obj.height;
imw = obj.width;
if (imh>sz || imw>sz) {
	if (imh>imw){	
		rl = imh / imw
		imw = parseInt( (imw * sz) / imh )
		imh = imw * rl
	}else if (imw>imh){	
		rl = imw / imh
		imh = parseInt( (imh * sz) / imw )
		imw = imh * rl
	}else if (imw==imh) {
		imh = sz		
		imw = sz
	}			
}	
obj.style.width = imw;
obj.style.height = imh;
var pdt = parseInt( (sz - imh) / 2 )
obj.style.marginTop = Math.abs(pdt) + "px";
obj.style.visibility='visible';
}
*/
function doSize(obj,wd){
//alert(wd)
var ht = wd + 1
imh = obj.height;
imw = obj.width;
var rl;
// si el alto es mayor que el ancho
if (imh > imw){
	rl = imh / imw
	imw = parseInt( (imw * ht) / imh )
	imh = ht 
	if ( imw > wd ) {
		imw = wd;
		imh = parseInt( wd / rl )
	}
	if ( imh > ht ) {
		imh = ht;
		imw = parseInt( ht * rl )
	}
// si el ancho es mayor que el alto	
}else if (imw > imh) {
	rl = imw / imh
	imh = parseInt( (imh * wd) / imw )
	imw = wd 
	if ( imh > ht ) {
		imh = ht;
		imw = parseInt( ht * rl )
	}
	if ( imw > wd ) {
		imw = wd;
		imh = parseInt( wd / rl )
	}
}else{
	imw = ht 
	imh = ht 
}
/*obj.style.width = imw;
obj.style.height = imh;*/
obj.width = imw;
obj.height = imh;
var pdt = parseInt( (ht - imh) / 2 )
obj.style.marginTop = Math.abs(pdt) + "px";
obj.style.visibility='visible';
}
/*------------------------------------------------------------------------------------------------------------------------------*/


/*------------------------------------------------------------------------------------------------------------------------------*/
/*		FUNCIONES PARA LA PAGINA DE KNOWLEDGE																			*/
/*------------------------------------------------------------------------------------------------------------------------------*/
function SchMode(m){
switch (m) {
	case 1:	
		document.getElementById("SchPanel").innerHTML = document.getElementById("SchMode1").innerHTML;
		document.getElementById("Smode1").style.color="#ffffff";
		document.getElementById("Smode1").style.textDecoration="none";
		document.getElementById("Smode2").style.color="rgb(236,233,216)";
		document.getElementById("Smode2").style.textDecoration="underline";		
		break;
	case 2: 
		document.getElementById("SchPanel").innerHTML = document.getElementById("SchMode2").innerHTML;
		document.getElementById("Smode1").style.color="rgb(236,233,216)";
		document.getElementById("Smode1").style.textDecoration="underline";
		document.getElementById("Smode2").style.color="#ffffff";
		document.getElementById("Smode2").style.textDecoration="none";			
		break;
}
}
var curA = "";
function loadA(u){
curA = u;
document.getElementById("Aux2").src = curA;
}
function loadA2(u,fr){
curA = u;
document.getElementById(fr).src = curA;
}
function printA(){
//alert(curA)
if (curA.length>0)
	document.getElementById("Aux2").src = curA +"&print=1";
}
/*------------------------------------------------------------------------------------------------------------------------------*/


/*------------------------------------------------------------------------------------------------------------------------------*/
/*		FUNCIONES PARA LA PAGINA DE REGISTRATION																			*/
/*------------------------------------------------------------------------------------------------------------------------------*/
function makeForm(m){
for (var i=1; i<20; i++) {
	if (eval("document.getElementById('doForm"+i+"')")) {
		eval("document.getElementById('doForm"+i+"').style.display='none';")
		/*eval("document.getElementById('BxForm"+i+"a').style.borderWidth='0px';")				
		eval("document.getElementById('BxForm"+i+"b').style.borderWidth='0px';")		
		eval("document.getElementById('BxForm"+i+"a').style.backgroundColor='#ffffff';")				
		eval("document.getElementById('BxForm"+i+"b').style.backgroundColor='#ffffff';")		*/
		eval("document.getElementById('btnOpen"+i+"').style.display='';")
		eval("document.getElementById('btnClose"+i+"').style.display='none';")
	}
}
eval("document.getElementById('doForm"+m+"').style.display='';");
/*eval("document.getElementById('BxForm"+m+"a').style.backgroundColor='rgb(245,244,235)';")
eval("document.getElementById('BxForm"+m+"b').style.backgroundColor='rgb(245,244,235)';")
eval("document.getElementById('BxForm"+m+"a').style.border='inset 1px silver';")
eval("document.getElementById('BxForm"+m+"b').style.border='inset 1px silver';")
eval("document.getElementById('BxForm"+m+"a').style.borderBottom='solid 0px transparent';")
eval("document.getElementById('BxForm"+m+"b').style.borderBottom='solid 0px transparent';")
eval("document.getElementById('BxForm"+m+"a').style.borderRight='solid 0px transparent';")
eval("document.getElementById('BxForm"+m+"b').style.borderLeft='solid 0px transparent';")*/
/*
eval("document.getElementById('BxForm"+m+"a').style.borderTop='solid 2px #AFA792';")
eval("document.getElementById('BxForm"+m+"b').style.borderTop='solid 2px #AFA792';")
eval("document.getElementById('BxForm"+m+"b').style.borderTop='solid 2px #AFA792';")*/
eval("document.getElementById('btnOpen"+m+"').style.display='none';")
eval("document.getElementById('btnClose"+m+"').style.display='';")
if (document.getElementById("ErrArrow")) {document.getElementById("ErrArrow").style.visibility="hidden";}
}
function closeForm(m){
//eval("document.getElementById('doForm"+m+"').style.display='none';")
/*eval("document.getElementById('BxForm"+m+"a').style.borderWidth='0px';")		
eval("document.getElementById('BxForm"+m+"b').style.borderWidth='0px';")		*/
/*eval("document.getElementById('btnOpen"+m+"').style.display='';")
eval("document.getElementById('btnClose"+m+"').style.display='none';")*/

eval("document.getElementById('doForm"+m+"').style.display='none';")
/*eval("document.getElementById('BxForm"+m+"a').style.borderWidth='0px';")				
eval("document.getElementById('BxForm"+m+"b').style.borderWidth='0px';")		
eval("document.getElementById('BxForm"+m+"a').style.backgroundColor='#ffffff';")				
eval("document.getElementById('BxForm"+m+"b').style.backgroundColor='#ffffff';")		*/
eval("document.getElementById('btnOpen"+m+"').style.display='';")
eval("document.getElementById('btnClose"+m+"').style.display='none';")

}
/*------------------------------------------------------------------------------------------------------------------------------*/


/*------------------------------------------------------------------------------------------------------------------------------*/
/*		FUNCIONES PARA LA PAGINA DE WISH LIST																			*/
/*------------------------------------------------------------------------------------------------------------------------------*/
function dropW(w,t){
for (var i=0; i<t; i++){
	eval("document.getElementById('W"+i+"').style.display='none';")
}
eval("document.getElementById('W"+w+"').style.display='';")
}
if (window.Event) {
	document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove = getXY;
var pX, pY;
function getXY(e) {
pX = (window.Event) ? e.pageX : event.clientX;
pY = (window.Event) ? e.pageY : event.clientY;
}
function addNW(p){
//document.getElementById("newWish").style.left = pX+"px";
if (document.f1){
var s = document.f1.r_Product1;
for (var i=0; i<s.length; i++) {
	if (s[i].value==p) {
		s[i].selected=true;
		break;
	}
}
}
document.getElementById("newWish").style.left = "427px";
document.getElementById("newWish").style.top = (pY+10)+"px";
document.getElementById("newWish").style.display="";
}
/*------------------------------------------------------------------------------------------------------------------------------*/


/*------------------------------------------------------------------------------------------------------------------------------*/
/*		FUNCIONES PARA LA PAGINA DE WALLPAPERS																			*/
/*------------------------------------------------------------------------------------------------------------------------------*/
function doWallP(wname, wdate, wauthor){
var c = "";
var hm = "";
/*for (var i=0; i<conts.length; i++) {
	var cs = conts[i].split(".");
	c += "<DIV><SPAN STYLE='float:left;width:75%;'><img src=\"images/icon_"+cs[1]+".gif\" align=absmiddle hspace=2>"+cs[2]+"</SPAN><SPAN style='float:left;width:20%;'>"+cs[0]+"</SPAN></div>";
	var tnum = pack.toLowerCase();
	tnum = tnum.substring(tnum.lastIndexOf("x")+1,tnum.length)
	for (var k=0; k<tnum; k++) {
		hm += "<img src=\"../myhome/images/comp/"+ cs[1] +"/"+escape(pack)+"/"+ cs[1] +""+ (k+1)+"."+ cs[3] +"\" border=1 vspace=2 hspace=2> "
		if (cs[1]=="fonts") hm+="<br>"
	}
}*/
//document.getElementById("Det2").innerHTML = c;
//document.getElementById("PackDownload").href = "../myhome/bin/Functions/MyHome/MHUserHistory.asp?action=download&comp="+cs[1]+"&file="+escape(pack)+"&gst=1";
var t = "Wallpaper";
if (document.URL.indexOf("/esp/s_")!=-1) t = "Fondos de Pantalla";
document.getElementById("PackTitle").innerHTML = t +": <i>"+ wname +"</i>";
document.getElementById("Sum2").innerHTML = /*p_date +"<br>"+ */	wdate +"<br>"+ wauthor;
document.getElementById("WP_L").href = "/eosc/download.asp?action=download&comp=wp&file="+escape(wname)+"&size=L&gst=1";
document.getElementById("WP_M").href = "/eosc/download.asp?action=download&comp=wp&file="+escape(wname)+"&size=M&gst=1";
document.getElementById("WP_S").href = "/eosc/download.asp?action=download&comp=wp&file="+escape(wname)+"&size=S&gst=1";

//var tnum = pack.toLowerCase();
//tnum = tnum.substring(tnum.lastIndexOf("x")+1,tnum.length)
/*/for (var i=0; i<tnum; i++) {
	hm += "<img src=\"../myhome/images/comp/"+ (conts)[1] +"/"+escape(pack)+"/cp"+(i+1)+".gif\" border=1 vspace=2 hspace=2> "	
}*/
//http://www.embroideryoffice.com/myhome/images/comp/cp/ExtraEO3CP-F1x20/cp1.gif
document.getElementById("ThumbList").innerHTML = "<img src=\"/myhome/images/comp/wp/"+wname+".jpg\" Style=\"border: solid 1px black\">";

}
function doHideWP_Help(){
document.getElementById("WP_Help").style.display="none";
}
/*------------------------------------------------------------------------------------------------------------------------------*/


/*------------------------------------------------------------------------------------------------------------------------------*/
/*		FUNCIONES PARA LA PAGINA DE WHAT'S NEW																			*/
/*------------------------------------------------------------------------------------------------------------------------------*/
function showPressR(id) {
var p = "";
if (document.URL.toLowerCase().indexOf("/esp/s_")!=-1) {p = "s_";}
curA = p +"eosc_whatsnew_search.asp?prID="+id;
document.getElementById("Aux").src = curA;
}

function showPressR2(id) {
var p = "";
if (document.URL.toLowerCase().indexOf("/esp/s_")!=-1) p = "s_";
if (wn && wn.open && !wn.closed)
	wn.document.location.href= p +"eosc_whatsnew_search.asp?prID="+id;
else
	var wn = window.open( p +"eosc_whatsnew_search.asp?prID="+id, "WhatsNew", "width=500,height=450,scrollbars=1" );
}
/*------------------------------------------------------------------------------------------------------------------------------*/

function CHL(l){
var pg = self.document.URL;
switch (l){	
	case 2:
		pg = pg.substring(pg.lastIndexOf("/")+1,pg.length);
		pg = "/eosc/esp/s_"+pg;
		break;
	default:
		pg = pg.toLowerCase();		
		pg = pg.substring(0,pg.toLowerCase().indexOf("/esp/s_")) +"/"+ pg.substring(pg.toLowerCase().indexOf("/esp/s_")+7,pg.length)		
		break;
}
self.document.location.href = pg;
}

/*------------------------------------------------------------------------------------------------------------------------------*/
/*		FUNCIONES PARA LA PAGINA DE COMPRA DE COMPONENTES																		*/
/*------------------------------------------------------------------------------------------------------------------------------*/
function getShopCart(d,o,q,l){
//alert(o)
//if (o.length>0){
	//alert(l)
	d.innerHTML = "<iframe src='/Shop/default.asp?lang="+l+"&serial="+o+"&"+q+"' frameborder=0 scrolling=no noresize width=609 height=800></iframe>";	
//}
}
