// basic variable
var agent = navigator.userAgent ;
var appve = navigator.appVersion ;
var appna = navigator.appName ;

var userOs = null ;
var browser = null ;
var version = null ;
// OS
if ( agent.indexOf('Win') != -1 ){
userOs = "Win";
}
else if ( agent.indexOf('Mac') != -1 ){
userOs = "Mac" ;
}
else{
userOs = "other" ;
}
// browse
if ( appna == "Microsoft Internet Explorer" ){
	browser = "MSIE";
	version = agent.substring((agent.indexOf('MSIE') + 5),(agent.indexOf('MSIE') + 8)) ;
}else if(agent.indexOf('Safari')!=-1){
	browser = "safari";
}else if ( appna == "Netscape" ){
	browser = "NN";

}else{
	browser = "other";
}


//body css
document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="http://www.narita-airport.jp/ch1/css/body.css">');
// browse css
if (userOs == "Win") {
	if (browser == "MSIE") {
		document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="http://www.narita-airport.jp/ch1/css/ie.css">');
	}else if (browser == "NN") {
		document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="http://www.narita-airport.jp/ch1/css/win_nn.css">');
	}else {
		document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="http://www.narita-airport.jp/ch1/css/ie.css">');
	}
} else if(userOs == "Mac"){
	if (browser == "MSIE") {
		document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="http://www.narita-airport.jp/ch1/css/ie.css">');
	}else if (browser == "NN") {
		document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="http://www.narita-airport.jp/ch1/css/mac_nn.css">');
	}else if (browser == "safari") {
		document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="http://www.narita-airport.jp/ch1/css/mac_safari.css">');
	}else {
		document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="http://www.narita-airport.jp/ch1/css/ie.css">');
	}
} else { null };


//POPUP
function openWin(my_url){
pMap = window.open(my_url,"mapWin","menubar=1,status=1,toolbar=1,scrollbars=1,resizable=1,left=4,top=4");
pMap.focus();
}
//airport map POPUP
function openWinAp(my_url){
pMap = window.open(my_url,"mapWin","width=753,height=617,menubar=1,status=1,toolbar=1,scrollbars=1,resizable=1,left=4,top=4");
pMap.focus();
}

//service POPUP
function openWinCt(my_url){
pMap = window.open(my_url,"mapWin","width=660,height=500,menubar=1,status=1,toolbar=1,scrollbars=1,resizable=1,left=4,top=4");
pMap.focus();
}
//Maintenance POPUP
function openWinMt(my_url){
pMap = window.open(my_url,"mapWin","width=550,height=350,menubar=1,status=1,toolbar=1,scrollbars=1,resizable=1,left=4,top=4");
pMap.focus();
}

//PrintWindow POPUP
function openWinPt(my_url){
	if (userOs == "Win") {
		if (browser == "MSIE") {
			window.print();
		}else if (browser == "FF") {
			pMap = window.open(my_url,"mapWin","width=200,height=254,menubar=0,status=0,toolbar=0,scrollbars=0,resizable=0,left=4,top=4");
			pMap.focus();
		}else {
			window.print();
		}
	} else if(userOs == "Mac"){
		if (browser == "MSIE") {
			window.print();
		}else if (browser == "safari") {
			pMap = window.open(my_url,"mapWin","width=200,height=254,menubar=0,status=0,toolbar=0,scrollbars=0,resizable=0,left=4,top=4");
			pMap.focus();
		}else {
			window.print();
		}
	} else { null };
}
