﻿//   ##############  SIMPLE  BROWSER SNIFFER
window.moveTo(0,0);
window.resizeTo(screen.availWidth,screen.availHeight);

if (document.layers) {navigator.family = "nn4"}
if (document.all) {navigator.family = "ie4"}
if (window.navigator.userAgent.toLowerCase().match("gecko")) {navigator.family = "gecko"}

//  #########  popup text 
descarray = new Array(
"<tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='Glossary' onclick=__doPostBack('_ctl0:Glossary','')>Glossary</a>&nbsp;</td></tr><tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='User Guide' onclick=__doPostBack('_ctl0:User_Guide','')>User Guide</a>&nbsp;</td></tr><tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='Online Training Course' href='#')>Online Training Course</a>&nbsp;</td></tr><tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='Product Classification' onclick=__doPostBack('_ctl0:Reference_HS','')>Product Classification</a>&nbsp;</td></tr><tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='Updated Product Codes' onclick=__doPostBack('_ctl0:Reference_HS962002','')>Updated Product Codes</a>&nbsp;</td></tr><tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='Countries covered' onclick=__doPostBack('_ctl0:Reference_Countries','')>Countries covered</a>&nbsp;</td></tr><tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='Developing Countries' onclick=__doPostBack('_ctl0:Reference_DC','')>Developing Countries</a>&nbsp;</td></tr><tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='Methodology' onclick=__doPostBack('_ctl0:Reference_Methodology','')>Methodology</a>&nbsp;</td></tr><tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='Useful Links' onclick=__doPostBack('_ctl0:Useful_Links','')>Useful Links</a>&nbsp;</td></tr><tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='Customs Institutions' onclick=__doPostBack('_ctl0:Customs_Institutions','')>Customs Institutions</a>&nbsp;</td></tr><tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='Case Studies' onclick=__doPostBack('_ctl0:Case_Studies','')>Case Studies</a>&nbsp;</td></tr><tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='Data Availability' onclick=__doPostBack('_ctl0:Data_Availability','')>Data Availability</a>&nbsp;</td></tr><tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='Tariff Quotas' onclick=__doPostBack('_ctl0:Tariff_Quotas','')>Tariff Quotas</a>&nbsp;</td></tr>",
//"<tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='Opciones y Coste' onclick=__doPostBack('_ctl0:Subscription_Fees_es','')>Opciones y Coste</a>&nbsp;</td></tr><tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='Registrarse' onclick=__doPostBack('_ctl0:Register_es','')>Registrarse</a>&nbsp;</td></tr><tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='Registro de acceso temporal' onclick=__doPostBack('_ctl0:Register_Trial_es','')>Registro de acceso temporal</a>&nbsp;</td></tr><tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='Condiciones Generales del Contrato' onclick=__doPostBack('_ctl0:Subscription_Terms_es','')>Condiciones Generales del Contrato</a>&nbsp;</td></tr>",
"<tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='Opciones y Coste' onclick=__doPostBack('_ctl0:Subscription_Fees_es','')>Opciones y Coste</a>&nbsp;</td></tr><tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='Registrarse' href='http://mas-admintools.intracen.org/accounts/NewAccount.aspx' target='NewWindow'>Registrarse</a>&nbsp;</td></tr><tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='Registro de acceso temporal' href='http://mas-admintools.intracen.org/accounts/NewAccount.aspx?l=t' target='NewWindow'>Registro de acceso temporal</a>&nbsp;</td></tr><tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='Condiciones Generales del Contrato' onclick=__doPostBack('_ctl0:Subscription_Terms_es','')>Condiciones Generales del Contrato</a>&nbsp;</td></tr>",
"<tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='Organización' onclick=__doPostBack('_ctl0:AboutUs_es','')>Organización</a>&nbsp;</td></tr>",
"<tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='Institutions' onclick=__doPostBack('_ctl0:Institutions','')>Institutions</a>&nbsp;</td></tr><tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='Countries' onclick=__doPostBack('_ctl0:Countries','')>Countries</a>&nbsp;</td></tr>",
"<tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='Collaborations' onclick=__doPostBack('_ctl0:Collaborations','')>Collaborations</a>&nbsp;</td></tr><tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='Tailored Studies' onclick=__doPostBack('_ctl0:Tailored_Studies','')>Tailored Studies</a>&nbsp;</td></tr><tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='ACP Project' onclick=__doPostBack('_ctl0:ACP_Project','')>ACP Project</a>&nbsp;</td></tr><tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399' title='Millennium Development Goals' href='http://www.mdg-trade.org' target='NewWindow')>Millennium Development Goals</a>&nbsp;</td></tr>",
"<tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='Contactarnos' onclick=__doPostBack('_ctl0:ContactUs_es','')>Contactarnos</a>&nbsp;</td></tr><tr height=25 ><td nowrap>&nbsp;<a class=hrefBlue style='text-decoration:none;color: #333399;' title='Customs Network' onclick=__doPostBack('_ctl0:Customs_Network','')>Customs Network</a>&nbsp;</td></tr>"
);

var xPos, yPos;
overdiv="0";
//  #########  CREATES POP UP BOXES 
function PrePopLayer(arrItem)
{
	switch(arrItem)
	{
		case 0:
			if(navigator.family =="nn4") {
				xPos = document.RM.left - 5;
				yPos = document.RM.top + 16;
				}
			else if(navigator.family =="ie4"){
				xPos = RM.style.pixelLeft - 5;
				yPos = RM.style.pixelTop + 16;
				}
			else if(navigator.family =="gecko"){
				xPos = document.getElementById("RM").offsetLeft - 5;
				yPos = document.getElementById("RM").offsetTop + 16;
				}
			break;
		case 1:
			if(navigator.family =="nn4") {
				xPos = document.SP.left - 5;
				yPos = document.SP.top + 16;
				}
			else if(navigator.family =="ie4"){
				xPos = SP.style.pixelLeft - 5;
				yPos = SP.style.pixelTop + 16;
				}
			else if(navigator.family =="gecko"){
				xPos = document.getElementById("SP").offsetLeft - 5;
				yPos = document.getElementById("SP").offsetTop + 16;
				}
			break;
		case 2:
			if(navigator.family =="nn4") {
				xPos = document.AU.left + 10;
				yPos = document.AU.top + 16;
				}
			else if(navigator.family =="ie4"){
				xPos = AU.style.pixelLeft + 10;
				yPos = AU.style.pixelTop + 16;
				}
			else if(navigator.family =="gecko"){
				xPos = document.getElementById("AU").offsetLeft + 10;
				yPos = document.getElementById("AU").offsetTop + 16;
				}
			break;
		case 3:
			if(navigator.family =="nn4") {
				xPos = document.PP.left + 10;
				yPos = document.PP.top + 16;
				}
			else if(navigator.family =="ie4"){
				xPos = PP.style.pixelLeft + 10;
				yPos = PP.style.pixelTop + 16;
				}
			else if(navigator.family =="gecko"){
				xPos = document.getElementById("PP").offsetLeft + 10;
				yPos = document.getElementById("PP").offsetTop + 16;
				}
			break;
		case 4:
			if(navigator.family =="nn4") {
				xPos = document.CS.left - 5;
				yPos = document.CS.top + 16;
				}
			else if(navigator.family =="ie4"){
				xPos = CS.style.pixelLeft - 5;
				yPos = CS.style.pixelTop + 16;
				}
			else if(navigator.family =="gecko"){
				xPos = document.getElementById("CS").offsetLeft - 5;
				yPos = document.getElementById("CS").offsetTop + 16;
				}
			break;
		case 5:
			if(navigator.family =="nn4") {
				xPos = document.CU.left - 5;
				yPos = document.CU.top + 16;
				}
			else if(navigator.family =="ie4"){
				xPos = CU.style.pixelLeft - 5;
				yPos = CU.style.pixelTop + 16;
				}
			else if(navigator.family =="gecko"){
				xPos = document.getElementById("CU").offsetLeft - 5;
				yPos = document.getElementById("CU").offsetTop + 16;
				}
			break;
	}
	//alert(xPos + " " + yPos + " " + DB.style.pixelLeft + " " + navigator.family);
	popLayer(arrItem);
}

function popLayer(a){
if(!descarray[a]){descarray[a]="<font color=red>This popup (#"+a+") isn't setup correctly - needs description</font>";}
if (navigator.family == "gecko") {pad="0"; bord="0"; bordercolor="black";}
else {pad="1"; bord="0";}
desc = 	  "<table cellspacing=0 cellpadding="+pad+" border="+bord+" width=85px><tr><td>\n"
	+"<table cellspacing=0 cellpadding=3 border=0 width=100%>\n"
	+descarray[a]
	+"\n</table>\n"
	+"</td></tr></table>";
if(navigator.family =="nn4") {
	document.objPDMenu.document.write(desc);
	document.objPDMenu.document.close();
	document.objPDMenu.left=xPos; //x+15
	document.objPDMenu.top=yPos; //y-5
	}
else if(navigator.family =="ie4"){
	objPDMenu.innerHTML=desc;
	objPDMenu.style.pixelLeft=xPos;
	objPDMenu.style.pixelTop=yPos;
	}
else if(navigator.family =="gecko"){
	document.getElementById("objPDMenu").innerHTML=desc;
	document.getElementById("objPDMenu").style.left=xPos;
	document.getElementById("objPDMenu").style.top=yPos;
	}
}
function hideLayer(){
if (overdiv == "0") {
	if(navigator.family =="nn4") {eval(document.objPDMenu.top="-500");}
	else if(navigator.family =="ie4"){objPDMenu.innerHTML="";}
	else if(navigator.family =="gecko") {document.getElementById("objPDMenu").style.top="-500";}
	}
}

//  ########  TRACKS MOUSE POSITION FOR POPUP PLACEMENT
var isNav = (navigator.appName.indexOf("Netscape") !=-1);
function handlerMM(e){
x = (isNav) ? e.pageX : event.clientX + document.body.scrollLeft;
y = (isNav) ? e.pageY : event.clientY + document.body.scrollTop;
}
if (isNav){document.captureEvents(Event.MOUSEMOVE);}
document.onmousemove = handlerMM;
//  End -->

function dpb(obj)
{
	__doPostBack(obj.id,'');
}

function MaxWin()
{
	window.moveTo(0,0);
	window.resizeTo(screen.availWidth,screen.availHeight);
}
