//トップレベルの処理やユーティリティ（リファクタリング対象）

var CHAT_FLASH_WIDTH = 760;
var CHAT_FLASH_HEIGHT = 442;
var TOP_FLASH_WIDTH = 760;
var TOP_FLASH_HEIGHT = 450;
var CHARA_SELECTER_WIDTH = 570;
var CHARA_SELECTER_HEIGHT = 420;

var ajax_submit_selecter;
var second_frame_pointer_y;
var allow_book = null;
var window_height;

if(!Array.indexOf){
    Array.prototype.indexOf = function(object){
        for(var i = 0; i < this.length; i++){
            if(this[i] == object){ 
                return i;
            }
        }
        return -1;
    }
}

$.isDisplayScrollBar = function(target,key){
        var val=target.css('overflow-'+key)
        if(val=='scroll')return true;
        if(val=='hidden')return false;
        if(val=='auto'||target.attr('tagName')=='HTML'){
                var method=(key=='y'?'Height':'Width');
                return target.attr('client'+method) < target.attr('scroll'+method);
        }
        return false;
}



jQuery(document).ready(function(){
	checkNeadUpgrade();
//	jQuery.noConflict();
	checkBlockLoaded();
	
	setCloseAction();
	
	ajaxSubmit();
	
	//ウィンドウサイズを監視して、ポップ画面のサイズを変更
	$(window).resize(setCenterFrameSize);
	$(window).resize(setPopFramePosition);
	$(window).resize(setPopPagePosition);
	
	SecondFrameSwitch();
	
	//パネルの最大化最小化
    $("div#first_frame div.panel_title_on").live("click", function(){
		closePanel($(this).parent());
    });
	$("div#first_frame div.panel_title_off").live("click", function(){
		openPanel($(this).parent());
    });
	
	$('img.help_icon, .qa_link').live('click', function (e) {
		
		var param = $(this).attr('id').split('_');
		
		$.post('/help/index',{'subject' : param[0]},
		       function(data) {
                    $('#pop_frame').html(data);
					showPopWindow();

//                    $('#pop_page').html(data);
//                    showPopPage();
			   });
		pageTracker._trackPageview('/ajaxcnt/' + param[0]);

        return false;
	});
	
	initTop();
	
	if (typeof(chat_direct) != 'undefined' && chat_direct) {
		
        ajax.chatComplete();
    }
});


//ログインパネルとマイリストパネルのどっちを表示するかの振り分け
function checkBlockLoaded(){
	
	if ($("#loginFlag").html() == 'regist') {
        $("body").removeClass('body_bg');
	}
	else if ($("#loginFlag").html() == 'true') {
		initLogin();
		$("#first_frame").show('fast', function(){
			setCenterFrameSize();
		});
	} else {
		initMylist();
        $("#first_frame").show('fast', function(){
			setCenterFrameSize();
		});
	}
	setCenterFrameSize();
}

function SecondFrameSwitch() {
	$("div#second_frame div.panel_title_on").live('click', function(){
        var title_selecter = $(this);
		
		var pos = getSecondFramePos('#second_frame', second_frame_pointer_y);
        $('#second_frame').animate({'top': pos + 'px'}, 'fast');
        
		$(this).parent().children(".panel_content, .panel_footer").slideUp('fast', function() {
            title_selecter.attr('class', 'panel_title_off');
        });
    });
    $("div#second_frame div.panel_title_off").live('click', function(){
		var pos = getSecondFramePos('#second_frame', second_frame_pointer_y);
        $('#second_frame').animate({'top': pos + 'px'}, 'fast');
		
        $(this).attr('class', 'panel_title_on');
        $(this).parent().children(".panel_content, .panel_footer").slideDown('fast');
    });
}

function openSecondFramepanel(target, noevent) {
	if (noevent) {
		$('#' + target + ' .panel_title_noevent_off').attr('class', 'panel_title_on');
	}
	$('#' + target + ' .panel_title_off').attr('class', 'panel_title_on');
	
	$('#' + target + ' .panel_title_noevent_off').attr('class', 'panel_title_noevent_on');
	$('#' + target).children(".panel_content, .panel_footer").slideDown('fast');
}

function closeSecondFramepanel(target, noevent) {
    
	if ($('#' + target).children(".panel_content:visible").size() == 0){
        if (noevent) {
            $('#' + target + ' .panel_title_off').attr('class', 'panel_title_noevent_off');
        }
		return;
    }
	
	$('#' + target).children(".panel_content, .panel_footer").slideUp('fast', function() {
		if (noevent) {
			$('#' + target + ' .panel_title_on').attr('class', 'panel_title_noevent_off');
		} else {
			$('#' + target + ' .panel_title_on').attr('class', 'panel_title_off');
		}
	});
	
}

function getPanelPos(panel, target_pos) {
	var ctrl_height = $(panel).height();
    var header = $('#first_frame').offset().top;
    var footer = $('#footer').height();
    var w_height = $(window).height();
    var pos = target_pos - header;
	
//    if (ctrl_height > w_height - header) {
//        pos = 10;
//        $(panel + ' .panel_pointer').css('top', (target_pos - pos - header + 5) + 'px');
//    }
//    else if ( target_pos + ctrl_height > w_height ) {
//        pos = w_height - header - ctrl_height;
//		$(panel + ' .panel_pointer').css('top', (target_pos - header - pos + 5) + 'px');
//    }
	return pos - 10;
}

function getSecondFramePos(panel, target_pos) {
	target_pos = target_pos || 0;
	
    var panel_height = $(panel).outerHeight();
    var header = $('#first_frame').offset().top;
    var footer = $('#footer').outerHeight();
    var window = $(window).height();
	var pos = target_pos;
	
    if (panel_height > window_height - header) {
        pos = header + 10;
    }
    else if (target_pos + panel_height > window_height) {
        pos = window_height - panel_height;
    }
	
	if (target_pos == 0) {
		$(panel + ' .panel_pointer').css('top', (pos - header - 5) + 'px');
	} else {
		$(panel + ' .panel_pointer').css('top', (target_pos - pos + 5) + 'px');
	}
	
    return pos - 10;
}


//onchangeで更新データを送信
function ajaxSubmit() {
	
	ajax_submit_selecter = $(".ajax_submit");
	ajax_submit_selecter.unbind('change').unbind('focus').unbind('blur');
	
	ajax_submit_selecter.change(function(){
		var submit_elem = this;
		$(submit_elem).nextAll('.submit_editing').remove();
		$('<span></span>').attr('class', 'submit_saving').insertAfter(this);
		
		var val = $.trim($(this).val());
		if ( val == '' ) return;
		
        if ($(this).is('input:checkbox')) {
			val = $(this).attr('checked') == true ? '1' : '0';
		}
		
		var target = $(this).attr('name').split('.');
		var id;
		
		if (target[0] == 'character') id = chara_now;
		if (target[0] == 'back') id = back_now;
		if (target[0] == 'book') id = book.data_now;
		
		jQuery.post('/' + target[0] + '/' + target[1] + '/',
		            { 'key'  : target[2],
					  'data' : val,
					  'id'   : id
					}, function(data){
						pageRedirect(data);
						
						//ngwordで引っかかった場合
						var finish_selecter = 'submit_finish';
						if (data == 'result=ng') {
							finish_selecter = 'submit_fail';
						} else if (data.substr(0, 17) == 'result=wordcheck_') {
                            data = data.substr(17);
							finish_selecter = 'submit_fail';
						}	
						
						if (target[0] == 'profile' && data != 'result=ng') {
							profileSubmitCallback(target[2], data);
						}
						if (target[0] == 'book' && data != 'result=ng') {
							book.submitCallback(id, target[2], data);
						}
						if (target[0] == 'back' && data != 'result=ng') {
							backSubmitCallback(id, target[2], data);
						}
						if (target[0] == 'character' && data != 'result=ng') {
							charaSubmitCallback(id, target[2], data);
                        }
						
						$(submit_elem).next('.submit_saving').remove();
                        $('<span></span>').attr('class', finish_selecter).insertAfter(submit_elem);
                        setTimeout(function(){
                            $(submit_elem).next('.'+finish_selecter).fadeOut('fast', function(){
								$(this).remove();
								$(submit_elem).blur();
							});
                        }, 1000);
						
					});
	});
	
	ajax_submit_selecter.focus(function () {
		$(this).next('.submit_saving').remove();
		$(this).next('.submit_finish').remove();
        $(this).next('.submit_fail').remove();
		$('<span></span>').attr('class', 'submit_editing').insertAfter(this);
	}).blur(function () {
		$(this).next('.submit_editing').remove();
	});
}

function setCloseAction() {
	$('.close_button, .panel_pointer').live('click', function(){
		var target = $(this).attr('id').substr(6);
		if (target == 'pop_window' || $('#pop_window:visible').size() > 0) {
			
			clearPopWindow();
			
		} else if (target == 'second_frame') {
            
			hideSecondFrame('fast');
			
		} else if (target == 'my_folder') {
            
			$('#my_folder').hide('fast', function() {
				$(this).html(myFolderLoadHtml());
			});
			
			if ($('#allow_list:visible').size() > 0) {
		        if ( isIE7() ) {
		            $('#allow_list').hide();
		        } else {
		            $('#allow_list').slideUp('fast');
		        }
		    }
			
		} else {
			
			$('#' + target).hide('fast');
			
		}
		
	});
	
	$(".close_button").live('mouseover',
        function () {
            $(this).attr('src', '/img/icon_panel02_close_h.png');
        }
	).live('mouseout',
        function () {
			$(this).attr('src', '/img/icon_panel02_close.png');
		}
	);
	
}

//広場とチャットの大きさ制御
function setCenterFrameSize(){
	
    window_height = $(window).height();
	var frame_width = $(window).width() - 195;
	var frame_height = window_height - $('#header').outerHeight();
	var ratio;
	var ratio_now;
	
	//スクロールバー対策
    if (!$.isDisplayScrollBar($('html'), 'y')) { frame_width -= 18; }

	if ( $('#top_frame:visible').size() > 0) {
		frame_height -= 58;
		var search_height = $('#top_search').height();
		
		ratio = TOP_FLASH_WIDTH / TOP_FLASH_HEIGHT;
        ratio_now = frame_width / (frame_height - search_height);
		if (ratio_now < ratio) {
			frame_height = frame_width / ratio + search_height;
		}
		
		$('#index').css('width', frame_width + 'px')
                   .css('height', (frame_height - search_height) + 'px');
		$('#top_frame').css('width', frame_width + 'px')
                       .css('height', frame_height + 'px');
	}
	
	if ( $('#chat_frame:visible').size() > 0 && $('#chat_frame').css('visibility') == 'visible') {
        
		ratio = CHAT_FLASH_WIDTH / CHAT_FLASH_HEIGHT;
		ratio_now = frame_width / (frame_height - 55);
		
		if (ratio_now > ratio) {
            var input_top = 0;
            var input_left = (frame_width - ratio * (frame_height - 55)) / 2;
        } else {
			frame_height = frame_width / ratio + 55;
            var input_left = 0;
        }
		
		$('#chatroom').css('height', (frame_height) + 'px')
                      .css('width', frame_width + 'px');
		
        $('#chat_frame').css('width', frame_width + 'px')
                        .css('height', (frame_height + 14) + 'px');
        
		if ($('#book_noaccess_contents_block:visible').size() > 0) {
			var block_height = $('#book_noaccess_contents_block').outerHeight();
			$('#book_noaccess_contents_block').css('top', (frame_height-block_height)/2 + 'px');
		}
		
		if ( isIE7() ) {
			$('#chatroom_input').css('top',  '-32px')
                                .css('left', (input_left + 181) + 'px');
		} else {
			$('#chatroom_input').css('top',  '-25px')
                                .css('left', (input_left + 181) + 'px');
		}
        
    }
	
	if ( $('#qa_frame:visible').size() > 0) {
        $('#qa_frame').css('width', frame_width + 'px');
    }
	
	$('#info_frame').css('width', frame_width + 'px');
	
}

//画面中心に画面を表示
function setPopFramePosition() {
	
	if ($('#pop_window:visible').size() == 0) return;
	
	$('#pop_window').height($(document).height());
	
	var width = $("#pop_frame").children('div').outerWidth() || 0;
    var height = $("#pop_frame").children('div').outerHeight() || 0;
	
    var left = ( $(window).width() - width ) / 2;
    var top = ( $(window).height() - height ) / 2;
    
	$("#pop_frame").css("width", width + "px")
	               .css("height", height + "px")
	               .css("top", top + "px")
                   .css("left", left + "px");
	
}

//画面中心に画面を表示
function setPopPagePosition() {
    
    if ($('#pop_window:visible').size() == 0) return;
    
    $('#pop_window').height($(document).height());
    
    var width = $("#pop_page").children('div').outerWidth() || 0;
    var height = $("#pop_page").children('div').outerHeight() || 0;
    
    var left = ( $(window).width() - width ) / 2;
    
	if (height > $(document).height()) {
		var top = 0;
	} else {
		var top = ( $(document).height() - height ) / 2;
	}
	
    $("#pop_page").css("width", width + "px")
                  .css("height", height + "px")
                  .css("top", top + "px")
                  .css("left", left + "px");
}

function showPopWindow() {
	$('#pop_page').hide();
	$('#pop_window').show();
	$('#pop_frame').show();
	
	setPopFramePosition();
//	$(window).scrollTop($('#pop_frame').offset().top);
    $('#pop_frame').hide().show(20);
}

function showPopPage() {
	
    $('#pop_frame').hide();
    $('#pop_window').show();
    $('#pop_page').show();
    setPopPagePosition();
	
	$(window).scrollTop($('#pop_page').offset().top);
    $('#pop_page').hide().show(10);
}

function clearPopWindow() {
	
	if ($('#pop_frame:visible').size() > 0) {
		$('#pop_frame').slideUp('fast', function () {
	        $(this).width(0).height(0).css('top', '0px').css('left', '0px').html('');
	        $('#pop_window').height(0).hide();
	    });
	}
	if ($('#pop_page:visible').size() > 0) {
        $('#pop_page').slideUp('fast', function () {
            $(this).width(0).height(0).css('top', '0px').css('left', '0px').html('');
            $('#pop_window').height(0).hide();
        });
    }
}

//確認パネル出力
function showConfirm(title, contents, url, params, beforeFunc, callback) {
	if (beforeFunc != '') {
		ajaxFunc(beforeFunc);
	}
    
    var html = '';
	html += '<div class="config"><p class="lb_book_ti">' + title + '</p><div class="comf">' + contents + '</div>'
	     +  '<div class="bgimg_btns"><p class="bgimg_btn_ac" id="confirm_ok">　続行</p><p class="bgimg_btn_nega" id="confirm_ng">キャンセル</p></div><span clear="all"></span></div>'
    
    $('#pop_frame').html(html);
    $('#confirm_ok').click(function(){
        jQuery.post(url, params,
                    function (data){
                        pageRedirect(data);
                        clearPopWindow('fast');
                        ajaxFunc(callback, data);
                    }, 'html');
        return false;
    });
    $('#confirm_ng').click(function(){
        clearPopWindow('fast');
    });
    $('#pop_frame').ready(function(){showPopWindow();});
}

//キャラクター画像URL作成
function charaImgUrl(img_name, user) {
	if (user) {
        var id = ("0000000" + user).substr( ("0000000" + user).length - 7 );
    } else {
        var id = ("0000000" + user_id).substr( ("0000000" + user_id).length - 7 );
    }
    var img_dir = id.substr(5, 2); 
    
    return 'http://' + IMAGE_HOST + '/chara/' + img_dir + '/' + img_name;
}

//キャラクター表情のサムネ画像URL作成
function charaThumbUrl(chara_num, face_num, face_dir, user) {
	if (user) {
		var id = ("0000000" + user).substr( ("0000000" + user).length - 7 );
	} else {
		var id = ("0000000" + user_id).substr( ("0000000" + user_id).length - 7 );
	}
	chara_num = ("000" + chara_num).substr( ("000" + chara_num).length - 3 );
	var img_dir = id.substr(5, 2); 
	
	return 'http://' + IMAGE_HOST + '/chara/' + img_dir + '/' + id + '_' + chara_num + '_' + face_num + '_' + face_dir + '.png';
}

//背景画像URL作成
function backImgUrl(img_name, user) {
    if (user) {
        var id = ("0000000" + user).substr( ("0000000" + user).length - 7 );
    } else {
        var id = ("0000000" + user_id).substr( ("0000000" + user_id).length - 7 );
    }
    var img_dir = id.substr(5, 2); 
    
    return 'http://' + IMAGE_HOST + '/bg/' + img_dir + '/' + img_name;
}

//背景サムネ画像URL作成
function backThumbUrl(set_num, back_num, user) {
    if (user) {
        var id = ("0000000" + user).substr( ("0000000" + user).length - 7 );
    } else {
        var id = ("0000000" + user_id).substr( ("0000000" + user_id).length - 7 );
    }
	var img_dir = id.substr(5, 2);
	set_num = ("000" + set_num).substr( ("000" + set_num).length - 3 );
	
	if (back_num) {
		back_num = back_num ? ("00" + back_num).substr( ("00" + back_num).length - 2 ) : '00';
		var url = 'http://' + IMAGE_HOST + '/bg/' + img_dir + '/' + id + '_' + set_num + '_' + back_num + '.png';
	} else {
		var url = 'http://' + IMAGE_HOST + '/bg/' + img_dir + '/' + id + '_' + set_num + '.png';
	}
	
    return url;
}

function secondFrameLoadHtml() {
	var html = '';
	html += '<div class="second_frame_body">'
	      + '<div class="second_frame_head"></div>'
		  + '<img id="close_second_frame" class="close_button" src="/img/icon_panel02_close.png" alt="close" />'
		  + '<img id="point_second_frame" class="panel_pointer" src="/img/r_con01_arrow.png" alt="point" />'
		  + '<div class="second_frame_load"><p class="loading"><img src="/img/ajax_loader.gif" alt="ajax_loader" /></p></div>'
		  + '<div class="second_frame_foot"></div></div>';
	
	return html;
}

function ctrlLoadHtml() {
	var html = '';
    html += '<div class="ctrl_panel_head"></div>'
	      + '<img id="close_mylist_ctrlpanel" class="close_button" src="/img/icon_panel02_close.png"/>'
		  + '<img id="point_mylist_ctrlpanel" class="panel_pointer" src="/img/r_con01_arrow.png"/>'
		  + '<div class="ctrl_load"><p class="loading"><img src="/img/ajax_loader.gif" alt="ajax_loader" /></p></div>'
		  + '<div class="ctrl_panel_foot"></div></div>';
	
	return html;
}

function myFolderLoadHtml() {
	var html = '';
    html += '<div class="mybook_title_wrap"><div class="mybook_title"></div></div>'
	      + '<img id="close_my_folder" class="close_button" src="/img/icon_panel02_close.png" alt="close"/>'
		  + '<img id="point_my_folder" class="panel_pointer" src="/img/r_con01_arrow.png" alt="point" style="top:30px;"/>'
		  + '<div class="myf_block">'
		  + '<p class="mybook_infotxt"></p>'
		  + '<div class="my_chara_load"><p class="loading"><img src="/img/ajax_loader.gif" alt="ajax_loader" /></p></div>'
		  + '</div></div>';
	
	return html;
}

function charadetailLoadHtml() {
	var html = '';
	html += '<div class="chara_detail_load"><p class="loading"><img src="/img/ajax_loader.gif" alt="ajax_loader" /></p></div>';
	
	return html;
}

function bookdetailLoadHtml() {
    var html = '';
    html += '<div class="book_detail_load"><p class="loading"><img src="/img/ajax_loader.gif" alt="ajax_loader" /></p></div>';
    
    return html;
}

function backdetailLoadHtml() {
    var html = '';
    html += '<div class="back_detail_load"><p class="loading"><img src="/img/ajax_loader.gif" alt="ajax_loader" /></p></div>';
    
    return html;
}

//ページリダイレクトさせる
function pageRedirect(data) {
	if (data && data.substr(0, 8) == 'redirect') {
        window.location.href = data.substr(9);
    } else {
        return false;
    }
}

function showSecondFrame(speed, move) {
	if ( isIE7() ) {
		$('#my_folder').hide();
	} else {
		$('#my_folder').hide('fast');
	}
	
	if (speed && !isIE7() ) {
		$('#second_frame').show(speed);
		if(move) {
            var pos = getSecondFramePos('#second_frame', second_frame_pointer_y);
            $('#second_frame').css('top', pos + 'px');
        }
	}else {
		$('#second_frame').show();
		if (move) {
			var pos = getSecondFramePos('#second_frame', second_frame_pointer_y);
            $('#second_frame').css('top', pos + 'px');
		}
	}
}

function hideSecondFrame(speed, noclear) {
	
	if (speed && !isIE7()) {
		$('#second_frame').hide(speed);
	}else{
		
		$('#second_frame').hide();
	}
	
	if ($('#allow_list:visible').size() > 0) {
		if ( isIE7() ) {
			$('#allow_list').hide();
		} else {
			$('#allow_list').slideUp('fast');
		}
	}
	
	if (noclear != true) {
		var param = $('#second_frame .second_frame_body').attr('id').split('_');
		
		var no_mess_icon_user = false;
		var no_mess_icon_chara = false;
		if ($('#temp_list #user_' + param[2] + '_0' + ' .message_icon:visible').size() == 0
            && $('#temp_list #user_' + param[2] + '_0' + ' .message_icon_old:visible').size() == 0) {
			no_mess_icon_user = true;
		}
		if ($('#temp_list #user_' + param[2] + '_1' + ' .message_icon:visible').size() == 0
            && $('#temp_list #user_' + param[2] + '_1' + ' .message_icon_old:visible').size() == 0) {
            no_mess_icon_chara = true;
        }
		
	    if (param.length == 4 && no_mess_icon_user) {
	        $('#temp_list #user_' + param[2] + '_0').remove();
	    }else if (param.length == 5 && no_mess_icon_chara) {
	        $('#temp_list #user_' + param[2] + '_1').remove();
	    }
	}
	
	$('#point_second_frame_sp').hide();
	$('#third_frame').hide();
}

function isMac() {
	if(navigator.userAgent.indexOf("Mac") != -1 ){
        return true;
    }
	return false;
}

function isIE() {
//	return navigator.appName.indexOf("Microsoft") != -1;
	return jQuery.browser['msie'];
}

function isUnsupportOpera() {
    var browser = jQuery.browser;
	var version = new Number(browser['version']);
	
	if (browser['opera'] && version < 10.63) {
		return true;
	}
    return false;
}

//レンダリング状態が７ベースかどうか判断
function isIE7() {
    var browser = jQuery.browser;
	
	if (browser['msie'] && browser['version'] == '7.0' && !document.documentMode) {
		return true;
	}
	else if (document.documentMode == 7 && browser['msie']) {
		return true;
	}
    return false;
}

function isFirefox() {
	return jQuery.browser['mozilla'];
}

function isUnsupportIE() {
	var browser = jQuery.browser;
	
	if (!browser['msie']) {
		return false;
	}
	else if (browser['version'] != '7.0' && !document.documentMode) {
        return true;
    }
	return false;
}

function isFlashWork() {
	
	if ($('#header object').size() == 0) {
		return false;
	}
	return true;
}

function checkNeadUpgrade() {
	var upgrade_flag = false;
	var param = new Array();
	
	var ie = isUnsupportIE();
	var opera = isUnsupportOpera();
//	var flash = !isFlashWork();
    var flash = false;
	
	if ( (ie || opera) && flash) {
		window.location.href = '/upgrade?all';
	} else if (ie || opera) {
		window.location.href = '/upgrade?ie';
	} else if (flash) {
		window.location.href = '/upgrade?flash';
	}
}

function getMovieName(movieName) {
    
    if (isIE()) {
        return window[movieName];
    }
    else {
        return document[movieName];
    }
}

var flash = new Array();
function jsFunc(func, params) {
	return flash[func](params);
}

var ajax = new Array();
function ajaxFunc(func, data, param) {
	if (!pageRedirect(data)) {
		return ajax[func](data, param);
	}
}

//リアルタイムプッシュデータの待受
flash.webPush = function (params) {
	
	if (params['target'] == 'message' ) {
		
		newMessage(params);
	}
}

flash.logoAction = function (param) {
	switch (param) {
		case 'top' :
            $('#chat_frame, #chatroom').css('visibility', 'hidden');
			$('#chat_frame').css('height', '0px');
			$('#qa_frame').hide();
            $('#top_frame').show();
            setCenterFrameSize();
			
            break;
		
		case 'book' :
            $('#top_frame, #qa_frame').hide();
			$('#chat_frame, #chatroom').css('visibility', 'visible');
			setCenterFrameSize();
			
            break;
			
		case 'qa' :
			$.post('/help/qa',{},
			       function(data){
				   	   $('#chat_frame, #chatroom').css('visibility', 'hidden');
					   $('#chat_frame').css('height', '0px');
                       $('#top_frame').hide();
                       $('#qa_frame').html(data).show();
					   setCenterFrameSize();
				   });
            break;
	}
	
}


flash.initFlashFunc = function () {
//	console.log(getMovieName("logo_navi").swfFunc('test', 'Message from flash!'));
}


