function mainInit(){
	if(!isMobile()) getPopup();
}
function getPopup(PIDX){
	$.ajax({
		type:'post',
		url: "/",
		data: "requestAction=Popup.getIdexnPopup&PIDX="+PIDX,
		success: function(data) {
			var obj = jQuery.parseJSON(data);
			var zIndex = 999; 
			$.each(obj, function(key,state) {
				if($.cookie("POPUP"+state[0]) !="Y" || PIDX){ 
					if(!$("#mainPopup"+state[0]).length){
						$("body").append($("<div>").attr("id", "mainPopup"+state[0]).attr("class", "W100 blogtext"));
					}
					$("#mainPopup"+state[0]).html(state[6]);
					if(PIDX){
						$( "#mainPopup"+state[0] ).dialog({
							width : parseInt(state[2])+100,
							height : 'auto',
							title: state[1],
							position: [parseInt(state[4]),parseInt(state[5])],
							show: 'scale' ,
							stack: true  ,
							zIndex: zIndex-- ,
							buttons: {
								"닫기": function() {
									$( this ).dialog('close');
								}
							},
							zIndex: 999999
						});
					}else{
						$( "#mainPopup"+state[0] ).dialog({
							width : parseInt(state[2])+100,
							height : 'auto',
							title: state[1],
							position: [parseInt(state[4]),parseInt(state[5])],
							show: 'scale' ,
							stack: true  ,
							zIndex: zIndex-- ,
							buttons: {
								"오늘하루 열지 않기": function() {
									$.cookie("POPUP"+state[0], "Y", {expires:1, path:'/', secure:0});
									$( this ).dialog('close');
								}
								,"닫기": function() {
									$( this ).dialog('close');
								}
							},
							zIndex: 999999
						});
					}
				}
			});
	  	}
	});
}
