// Dreamからのお知らせ、メディア掲載情報の表示

var sideInfo = null;
$(document).ready(function() {
	//sel_product = new SelProduct();
	
	sideInfo = new sideInfo();
	sideInfo.setPath(level_no);
	sideInfo.set();
	//window.alert('tes');			   

						   
});


var sideInfo = function() {
};

sideInfo.prototype = {
	
	path : "../",
	
	set : function() {
		this.setInfo();
		this.setMedia();
		this.setBanner();
	},
	
	setPath : function(no) {
		if(no == 3) {
			this.path = "../../";
		} else {
			this.path = "../";
		}
	},
	
	setInfo : function() {
		$.ajax({
			   context : this,
			   type : "GET",
			   url : this.path+"sys/common/get_news_list.php",
			  // data : "id="+this.class_id,
			   async : true,
			   cache : false,
			   success : this.ajaxInfoSuccess,
			   error : function(req, status, e) {
				   //window.alert(req);
			   }
		});
	},
	
	ajaxInfoSuccess : function(data) {
		//var data = eval("("+html+")");
		//window.alert(data);
		//$("div.menuDream ul").html(data);	
		$("div.menuDream").html(data);		
	},
	
	setMedia : function() {
		$.ajax({
			   context : this,
			   type : "GET",
			   url : this.path+"/sys/common/get_media_list.php",
			   //data : "id="+this.class_id,
			   async : true,
			   cache : false,
			   success : this.ajaxMediaSuccess,
			   error : function(req, status, e) {
				   //window.alert(req);
			   }
		});
	},
	
	ajaxMediaSuccess : function(data) {
		//data = eval("("+json+")");
		$("div.menuMedia").html(data);	
	},
	
	setBanner : function() {
		$("div#menu").append('<div id="dreamTvBanner"></div>');
		var txt = '<a href="http://www.mydream.co.jp/commodity/dreamTV/"><img height="47" width="200" alt="ドリームTV" src="'+this.path+'images/common/dreamTvBanner.gif"></a>';
		$("div#dreamTvBanner").html(txt);
		
	}
	
	
};


