//@cc_on

//@if( @_jscript_version >= 5.5 )

var ua = navigator.userAgent;

var isFollowup = document.getElementById && !ua.match(/MSIE 5\.01/) && !(ua.match(/Netscape\/7\.0/i) || ua.match(/Netscape6\/6\./i));

var isWinIE = ua.match(/MSIE/) && !ua.match(/Mac/i) && !ua.match(/Opera/i);

var isOpera = ua.match(/Opera/i);



var imgCache = new Array();

var imgCacheCnt;



var menuRect = {

	"drawer1": { "openLeft":0,   "openTop":0, "openWidth":125, "openHeight":78, "closeLeft":0, "closeTop":0, "closeWidth":125, "closeHeight":30 },

	"drawer2": { "openLeft":125, "openTop":0, "openWidth":125, "openHeight":246, "closeLeft":125, "closeTop":0, "closeWidth":125,  "closeHeight":30 },

	"drawer3": { "openLeft":250, "openTop":0, "openWidth":125, "openHeight":102, "closeLeft":250, "closeTop":0, "closeWidth":125, "closeHeight":30 },

	"drawer4": { "openLeft":375, "openTop":0, "openWidth":163, "openHeight":126, "closeLeft":375, "closeTop":0, "closeWidth":125, "closeHeight":30 },

	"drawer5": { "openLeft":500, "openTop":0, "openWidth":140, "openHeight":102, "closeLeft":500, "closeTop":0, "closeWidth":125, "closeHeight":30 },

	"drawer6": { "openLeft":625, "openTop":0, "openWidth":125, "openHeight":198, "closeLeft":625, "closeTop":0, "closeWidth":125, "closeHeight":30 }

};



// メニュー設定

//@if(@_jscript_version >= 5.6) {

var menus = {

	"drawer1": {

		"link"    :"index.html",

		"imgName" :"G001",

		"imgSrc"  :"image/menu_G01",

		"width"   :"125",

		"alt"     :"TOP",

		"submenus":[

			{ "text":"News and Updates","link":"index.html" },

			{ "text":"Site Map","link":"sitemap.html" }

		]

	},

	"drawer2": {

		"link"    :"Generalinfo.html",

		"imgName" :"G002",

		"imgSrc"  :"image/menu_G02",

		"width"   :"125",

		"alt"     :"DiGRA2007",

		"submenus":[

			{ "text":"General Info","link":"Generalinfo.html" },
			{ "text":"Keynote","link":"Keynote.html" },
			{ "text":"Symposium","link":"Symposium.html" },
			{ "text":"Overview","link":"Overview.html" },
			{ "text":"Schedule at a Glance","link":"Schedule.html" },
			{ "text":"Program","link":"Program.html" },
			{ "text":"Social Events","link":"Sociale.html" },
			{ "text":"FAQ","link":"Faq.html" },
			{ "text":"Message from Chair","link":"Message.html" }

		]

	},

	"drawer3": {

		"link"    :"Callforpaper.html",

		"imgName" :"G003",

		"imgSrc"  :"image/menu_G03",

		"width"   :"125",

		"alt"     :"SUBMISSION",

		"submenus":[

			{ "text":"Call for Papers","link":"Callforpaper.html" },

			{ "text":"Submission","link":"Submission.html" },

			{ "text":"Call for Exhibition","link":"CallforEx.html" }

		]

	},

	"drawer4": {

		"link"    :"RegAccom.html",

		"imgName" :"G004",

		"imgSrc"  :"image/menu_G04",

		"width"   :"125",

		"alt"     :"REGISTRATION",

		"submenus":[

			{ "text":"Registration & Accommodation","link":"RegAccom.html" },

			{ "text":"Financial Support","link":"Financialsup.html" },

			{ "text":"Student Opportunities","link":"Studentopp.html" },

			{ "text":"For Volunteers","link":"Forvolunteer.html" }

		]

	},

	"drawer5": {

		"link"    :"Contacts.html",

		"imgName" :"G005",

		"imgSrc"  :"image/menu_G05",

		"width"   :"125",

		"alt"     :"VISITOR INFO",

		"submenus":[

			{ "text":"Contacts","link":"Contacts.html" },

			{ "text":"Transportation & Location","link":"Access.html" },

			{ "text":"Miscellaneous","link":"Miscellaneous.html" }

		]

	},

	"drawer6": {

		"link"    :"Organizingcomm.html",

		"imgName" :"G006",

		"imgSrc"  :"image/menu_G06",

		"width"   :"125",

		"alt"     :"ABOUT US",

		"submenus":[

			{ "text":"Organizing Committee","link":"Organizingcomm.html" },

			{ "text":"Advisory Board","link":"Advisoryboard.html" },

			{ "text":"Program Comittee","link":"Programcomm.html" },

			{ "text":"Review Committee","link":"Reviewcomm.html" },

			{ "text":"Sponsors","link":"Sponsors.html" },

			{ "text":"Collaborating Partners","link":"Collaborating.html" },

			{ "text":"Contact Information","link":"Contactinfo.html" }

		]

	}

};

//@ }

//@end





var OpenMenu, OnMenu;

var DropDownShim = null;

var isOpen = false;

var cTimerID = new Object();

var oTimerID = new Object();

var onTime   = 300;     // マウスをonして開くまでの時間 msec



function DropDown(target, mode) {



	// 不要なタイマー削除

	for(i=0;i<8;i++){

		if (target != 'Drawer' + i) {

			clearTimeout(oTimerID[target]);

			oTimerID[target] = null;

	    }

	}

	isOpen = mode;

	var dl = document.getElementById(target);

	var img = dl.getElementsByTagName("img")[0];

	if( !isFollowup ) {

		if(mode==true) {

			img.src = menus[target].imgSrc+"-on.jpg";

		} else {

			img.src = menus[target].imgSrc+".jpg";

		}

		return;

	}

	

	if(mode==true) {

		if ( target == OpenMenu ) {

			clearTimeout(cTimerID[target]);		

		} else {

			DropDownOff(OpenMenu);

		}

		if( OnMenu != target ) {

			img.src = menus[target].imgSrc+"-on.jpg";

		}

		oTimerID[target] = setTimeout("DisplayDropDown('" +target+ "');", onTime);

	} else {

		cTimerID[target] = setTimeout("DropDownOff('"+target+"');", 10);

		OpenMenu = target;

	}

}



function DisplayDropDown(target) {



        var dl = document.getElementById(target);

		

		// 表示ロジック

		dl.style.borderBottom = "1px solid #B30033";

		dl.style.width  = ""+menuRect[target].openWidth+"px";

		dl.style.height = ""+menuRect[target].openHeight+"px";

		dl.style.left   = ""+menuRect[target].openLeft+"px";

		dl.style.top    = ""+menuRect[target].openTop+"px";

		dl.style.zIndex = "2";

		

		if( isOpera ) {

		

			// Operaの場合

			dl.style.left      = ""+menuRect[target].closeLeft+"px";

			dl.style.minWidth  = ""+menuRect[target].openWidth+"px";

			dl.style.minHeight = ""+menuRect[target].openHeight+"px";

			dl.style.maxWidth  = ""+menuRect[target].openWidth+"px";

			dl.style.maxHeight = ""+menuRect[target].openHeight+"px";

			

		}

		if( isWinIE ) {

		

			// IEの場合

			if( !DropDownShim ) {

				DropDownShim = document.createElement('<iframe src=".html" scrolling="no" frameborder="0" style="position:absolute; z-index:1;" id="DropDownShim"></iframe>');

				document.getElementById("snav").appendChild(DropDownShim);

			}

			DropDownShim.style.width   = ""+menuRect[target].openWidth+"px";

			DropDownShim.style.height  = ""+(menuRect[target].openHeight-30)+"px";

			DropDownShim.style.left    = ""+menuRect[target].openLeft+"px";

			DropDownShim.style.top     = ""+(menuRect[target].openTop+30)+"px";

			DropDownShim.style.display = "block";

			

		}



}





function DropDownOff(target) {

		

	if( ! document.getElementById ) {

		return;

	}

	var dl = document.getElementById(target);

	if( !dl ) {

		return;

	}

	var img = dl.getElementsByTagName("img")[0];



	if( OnMenu != target) {



		img.src = menus[target].imgSrc+".jpg";

		

	}

	if( isWinIE ) {



		// changed this condition !!

		if (DropDownShim) {

		        DropDownShim.style.display = "none";

		}



		//if(!isOpen) DropDownShim.style.display = "none";



	}

	dl.style.borderBottom="none";

	dl.style.width  = ""+menuRect[target].closeWidth+"px";

	dl.style.height = ""+menuRect[target].closeHeight+"px";

	dl.style.left   = ""+menuRect[target].closeLeft+"px";

	dl.style.top    = ""+menuRect[target].closeTop+"px";

	dl.style.zIndex = "3";

	if( isOpera ) {

		dl.style.minWidth  = ""+menuRect[target].closeWidth+"px";

		dl.style.minHeight = ""+menuRect[target].closeHeight+"px";

		dl.style.maxWidth  = ""+menuRect[target].closeWidth+"px";

		dl.style.maxHeight = ""+menuRect[target].closeHeight+"px";

	}

}



function ImageCache(path) {

	imgCache[imgCacheCnt=imgCache.length] = new Image();

	imgCache[imgCacheCnt].src = path;

}



function resizeBugFix() {

	DropDownOff(OpenMenu);

	document.getElementById("snav").style.margin="0px auto";

}



if( isWinIE ) {

	window.attachEvent("onresize", resizeBugFix);

}



function MakeMenu(onName) {

	OnMenu = onName;

	var o = "";

	o += '<div id="snav">';

	for(var i in menus) {

		ImageCache(menus[i].imgSrc+".jpg");

		ImageCache(menus[i].imgSrc+"-on.jpg");

		ImageCache(menus[i].imgSrc+"-in.jpg");

		o += '<dl class="drawer" id="'+i+'" onmouseover="DropDown(\''+i+'\', true);" onmouseout="DropDown(\''+i+'\', false);">';

		if( i == onName ) {

			o += '<dt><a href="'+menus[i].link+'"><img src="'+menus[i].imgSrc+'-in.jpg" width="'+menus[i].width+'" height="30" alt="'+menus[i].alt+'" id="'+menus[i].imgName+'" name="'+menus[i].imgName+'" border="0"></a></dt>';

		} else {

			o += '<dt><a href="'+menus[i].link+'"><img src="'+menus[i].imgSrc+'.jpg" width="'+menus[i].width+'" height="30" alt="'+menus[i].alt+'" id="'+menus[i].imgName+'" name="'+menus[i].imgName+'" border="0"></a></dt>';

		}

		if( isFollowup ) {

			for(var j=0; j<menus[i].submenus.length; j++) {

				if(menus[i].submenus[j].target) {

					o += '<dd><a href="'+menus[i].submenus[j].link+'" target="'+menus[i].submenus[j].target+'"><span>'+menus[i].submenus[j].text+'</span></a></dd>';

				} else {

					o += '<dd><a href="'+menus[i].submenus[j].link+'"><span>'+menus[i].submenus[j].text+'</span></a></dd>';

				}

			}

		}

		o += '</dl>';

	}

	o += '</div>';

	document.write(o);

}



if( isOpera ) {

	var os = "";

	os += '<style type="text/css">';

	os += '#header #snav #drawer7 dt { text-align:left; }';

	os += '</style>';

	document.write(os);

}



//@end

