
var obj = "";                              
var eig = "";
var ie = 0;
var n = 0;           
var i=0;

function Init() {
   if (document.layers) {                 
     obj  = "document.layers"; 
     eig  = "";
	 n  = 1;
	 ie = 0;
   } else {
	 obj = "document.all"; 
	 eig = ".style"; 
	 n  = 0;
	 ie = 1;
   }			    
}

function Show(id){
	eval(obj+'["'+id+'"]'+eig+'.visibility="visible"');
}  

function Hide(id){
    eval(obj+'["'+id+'"]'+eig+'.visibility="hidden"');
}  


function contact(mailaddress,mSubject1,mSubject2){
	if (mSubject1 == '') {
		alert ('Please select a valid service from the list.');
	} else if (mSubject2 == '(Please select region)') {
		alert ('Please select a valid region from the list.');
	}else{
		var mSubject='About '+mSubject1+' in '+mSubject2;
		location.href='mailto:'+mailaddress+'?subject='+mSubject;
	}
}


var airtrackingURL ='HTTP://www3.NITTSU.CO.JP/CGI-BIN/PG3301';
var marintrackingURL ='http://www2.nittsu.co.jp/';

function jumpTosite_1(indexNum){
	if (document.header.officeselect.options[document.header.officeselect.selectedIndex].value==''){
		alert('Please select a valid site from the list.');	
	}
	else {
		document.header.target="_blank";
		jumpTo('office'+document.header.officeselect.selectedIndex);
	}


}

function jumpTosite_2(indexNum){
	document.header.target="_blank";
	if (document.header.serviceselect.options[document.header.serviceselect.selectedIndex].value==''){
		alert('Please select a valid site from the list.');
	}
	else {
		jumpTo('line'+document.header.serviceselect.selectedIndex);
	}
}


function jumpToTracking(indexNum){
	document.header.target="_blank";
	if (document.header.SELNO.options[document.header.SELNO.selectedIndex].value=='nolink'){
	alert('"'+document.header.SELNO.options[document.header.SELNO.selectedIndex].text+'" is not a correct tracking type. Please select a valid tracking type from the list.')
	}
	else if(indexNum>=10){
		window.open(marintrackingURL,'_marine');
	} 
	else {
		document.header.action=airtrackingURL;
		document.header.submit();
	}
}



function locatorJumpTo(o,s){
	if (document.country_service.country.options[document.country_service.country.selectedIndex].value=='' && document.country_service.service.options[document.country_service.service.selectedIndex].value==''){
	alert('Please select a country and a service from the list.')
	} else if(document.country_service.country.options[document.country_service.country.selectedIndex].value==''){
	alert('Please select a country from the list.')
	} else if(document.country_service.service.options[document.country_service.service.selectedIndex].value==''){
	alert('Please select a service from the list.')
	} else {
		var theURL;
		
		for (u=0; u<all_select.length; u++) {
	
			if(all_select[u][0]==o&&all_select[u][1]==s){
				theURL=all_select[u][2];
			};
		}

		if(theURL !=""){
				location.href = theURL;
		}
	}
}




function checkBrowser(){
	//alert(navigator.appVersion);
	this.ver = navigator.appVersion;
	this.dom = document.getElementById?1:0;
	this.ie6 = (this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ie55 = (this.ver.indexOf("MSIE 5.5")>-1 && this.dom)?1:0;
	this.ie5 = (this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4 = (document.all && !this.dom) ?1:0;
	this.ns5 = (this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4 = (document.layers) ? 1:0;	
	this.bw  = (this.ie5 || this.ie4 || this.ns4 || this.ns5 || this.ie55 || this.ie6);
	this.os  = (this.ver.indexOf("Macintosh")>-1)? "mac":"pc";
	this.ie  = (this.ie5 || this.ie4 || this.ie55 || this.ie6);
	this.ns  = (this.ns4 || this.ns5);
	this.screen =screen.width;
	this.client = (this.ie) ? "ie" : "ns";
	return this;
}


checkBrowser.prototype.toString = function(){
   return (this.client + "_" + this.os); 
}

checkBrowser.prototype.CSSstring = function(country, os) {

//optional "OS" param for debugging
// the other parameter is used to allow country specific style
// sheets. when calling this method, a country must be passed
// and the string needs to point to an actual file in the file
// system. This could lead to problems. A lookup table and
// numerical indices could be better. That way, if an index is 
// not resolved in the table, it could point to a default style sheet.

	if (!os) {
		return ("style_" + this.client + "_" + this.os + ".css");  
	}else{
		return ("style_" + this.client + "_" + os      + ".css");  
	}
}



var w = window;

function popUp(url,wi,he,wName){
    w = window.open(url,wName,'fullscreen=yes,scrollbars=no,outerHeight='+he+',outerWidth='+wi);
	alert(wi+","+he);
	w.blur();
	w.resizeTo(wi,he)
	w.focus();
	w.moveTo(100,100);
} 


