//-----------------------------------------------------------------
//	ObjectFMM
//-----------------------------------------------------------------
MM = {
	dlg : {
		self : null,
		init : function(){
			ua = navigator.userAgent;
			if( ua.indexOf("Mac") != -1 ){
				var isMSIE = /*@cc_on!@*/false;
				if( isMSIE ){
					w  = document.all.wrapper;
					as = w.getElementsByTagName("a");
					for(i=0; i<as.length; i++ ){
						if( as[i].className == 'mburl' ){
							as[i].target="_blank";
						}
					}
				}else{
					$$('a.mburl').each(function(link){
						new Control.Modal(link,{
							opacity:0.6,
							width:500,
							height:500
						});
					});
				}
				
			}else{
				$$('a.mburl').each(function(link){
					
					new Control.Modal(link,{
						opacity:0.6,
						width:500,
						height:500
					});
					
				});
			}
			this.self = "http://" + location.hostname + "/index.php";
		},
		send : function(f){
			new Ajax.Request(
//				'http://mu-motest.avexnet.jp/index.php',
				this.self,
				{	method : 'post',
					postBody : Form.serialize(f),
					onComplete : function(req){
						$('dialogMsg').style.display = 'block';
						$('dialogMsg').innerHTML = req.responseText;
					}
				}
			);
		}
	},
	form : {
		init : function(){
		
		},
		send : function(f){
			new Ajax.Request(
//				'http://mu-motest.avexnet.jp/index.php',
				this.self,
				{	method : 'post',
					postBody : Form.serialize(f),
					onComplete : function(req){
						$('msg').style.display = 'block';
						var text = req.responseText;
						if ( navigator.appVersion.indexOf( "KHTML" ) > -1 ) {
							var esc = escape( text );
							if ( esc.indexOf("%u") < 0 && esc.indexOf("%") > -1 ) {
								text = decodeURIComponent( esc );
							}
							$('dialogMsg').innerHTML = text;
						}else{
							$('dialogMsg').innerHTML = text;
						}
					}
				}
			);
		}
	}
};

window.onload = function() {
	MM.dlg.init();
}
