﻿displayNoneHTML();

$(document).ready(function() {

    // logo Click
    $("#header h1 a").click(function() {
        setInstantCookie("jumboWall_KR", 0);
    });

    // cookie logIn or logOut Check
    $.fe_logInOut();

    if ( $("#gnbp3").length ) $("#gnbp3").fe_gnb();

    // layerPopup
    if ( $(".layPopOpener").length ) {
        $.fe_lay({
            triggerClass : ".layPopOpener",
            targetClass : ".layPop",
            type : "overlay",
            overLay_Center : false,
            overLay_animationSpeed : 100
        });
    }
    
    // bandWidth
    checkBandWidth();

    // feedBack
    $.fe_feedBack();


    /********************************/

    navigation();


    if ( !isMobile && checkBandWidthVar != "Low" ) {

        sectionInit();

        expandTooltip();
        //theLatest();        //div id='theLatest'를 제어함 
        //mobileDevices();
		
        A_type("theLatest",{effect:"top",flash:"kv1"});
        mobileDevice("mobileDevices",{effect:"top",flash:"kv2"});
        A_type("tvAudioVideo",{effect:"left",flash:"kv3"});        
        notebooks("notebooksDisplay",{effect:"top",flash:"kv4"});
        camera("cameraCamcorder",{effect:"top",flash:"kv5"});
        A_type("printSolutions",{effect:"top",flash:"kv6"});
        A_type("homeAppliances",{effect:"top",flash:"kv7"});
        
        //telephone();
        //tvAudioVideo();
        //photoCamescope();
        //informatique();
        //electro();

        smallWall();

    } else {
        lowBandWidth();
    }

    if ( isMobile ) {
        $("#jumboWall").addClass("mobileFix");
    }

    learnMore();

    indexTab();

    section0();

    twitterInit();

    // IE6 NOT SUPPORT
    $.fe_ie6NotSupport();

		//************ 공지사항 롤링 ***************

	var Handler = {
		elements : {
			$mNotice : $( 'div.mNotice ' ),		//공지사항 영역
			$timer : null,
			$timerDirection : 'upper',
			$intervalTimer : 5000				//롤링시간 설정
		},
		popup : function( set ){
			var loadHTML = $( set.col ).attr( 'href' );
			var obj = window.open( loadHTML, 'opn', 'width=625, height=532, resizable=yes, menuvar=no, toolbar=no, location=no' );
			obj.focus();
		},
		init : function(){
			var self = this;
			self.elements;
			self.addEvent();
			//setTimeout( function(){
				self.rolling_upper();
			//}, self.elements.$inervalTimer );
		},
		rolling_upper : function( set ){
			var self = this;
			self.elements.$timerDirection = null;
			clearTimeout( self.elements.$timer );
	
			var obj = self.elements.$mNotice;
			var obj = obj.find( 'ul' );
			obj.css( {'position':''} );
	
			var cell = obj.find( 'li' );
			var cell_height = cell.eq( 0 ).height();
	
			obj.animate( {
				'top' : cell_height*-1
			}, 100, function(){
				obj.append( cell.eq( 0 ).clone() );
				cell.eq( 0 ).remove();
				obj.css( {'top':0} );
	
				self.elements.$timer = setTimeout( function(){
					self.rolling_upper();
				}, self.elements.$intervalTimer );
				self.elements.$timerDirection = 'upper';
			} );
	       },
		rolling_lower : function( set ){
			var self = this;
			self.elements.$timerDirection = null;
			clearTimeout( self.elements.$timer );
	
			var obj = self.elements.$mNotice;
			var obj = obj.find( 'ul' );
			obj.css( {'position':''} );
	
			var cell = obj.find( 'li' );
			var cell_height = cell.eq( 0 ).height();
	
			obj.prepend( cell.eq( cell.size() - 1 ).clone() );
			cell.eq( cell.size() - 1).remove();
			obj.css( {'top':cell_height*-1} );
	
			obj.animate( {
				'top' : 0
			}, 100, function(){
				self.elements.$timer = setTimeout( function(){
					//self.rolling_lower();
					self.rolling_upper();
				}, self.elements.$intervalTimer );
				self.elements.$timerDirection = 'lower';
			} );
		},
		addEvent : function(){
			var self = this;
			var btn = $( 'div.btn' ).find( 'img' );
			var up = btn.eq( 0 );
			var down = btn.eq( 1 );
			
			up.unbind().click( function(){		
				//if( self.elements.$timerDirection !=null && self.elements.$timerDirection != 'upper' ){
				if( self.elements.$timerDirection !=null){
					self.rolling_lower();
				}
			} );
			
			down.unbind().click( function(){
				//if( self.elements.$timerDirection !=null && self.elements.$timerDirection != 'lower' ){
				if( self.elements.$timerDirection !=null){
                    self.rolling_upper();
					
				}
				//}
			} );
			
	/*		var obj = self.elements.$mNotice.find( 'ul' );
			obj.unbind().bind( 'mouseenter', function(){
				clearTimeout( self.elements.$timer );
			} ).bind( 'mouseleave', function(){
				self.elements.$timer = setTimeout( function(){
					if( self.elements.$timerDirection == 'lower' ){
						self.rolling_lower();
					}else{
						self.rolling_upper();
					}
				} , 3000 );
			} );*/
		}
	};
	
	//공지사항 임시 하드코딩
	var summ = $("#notice");
	var summHtml = "<ul style='border:0px solid gray;' >";
	     summHtml += "<li><a href=\"javascript:;\" onclick=\"window.open( '/sec/notice/0203_notice_MS.html', 'opn1', 'width=700, height=630, menu=no, toolbar=no, location=no, scrollbars=yes' );\">삼성전자 제품에 설치된 Internet Explorer 업데이트 안내</a></li>";
	     summHtml += "<li><a href=\"javascript:;\" onclick=\"window.open( '/sec/notice/0119_notice_popup.html', 'opn2', 'width=647, height=750, menu=no, toolbar=no, location=no, scrollbars=yes' );\">[1/19] 메뉴 명칭 변경에 대해 알려드립니다.</a></li>";
		summHtml += "<li><a href=\"javascript:;\" onclick=\"window.open( 'http://local.sec.samsung.com/comLocal/Et2.1P.html', 'opn3', 'width=1060, height=1181, menu=no, toolbar=no, location=no, scrollbars=yes' );\">삼성전자 대표 사이트 통합 및 개편안내</a></li>";
		
	    summHtml += "</ul>";
	    
	    summ.html(summHtml);
	    
	    Handler.init();
	    
	
	//공지사항 
/*	$.ajax({
		  type: "GET",
		  //url: "/sec/main/event.xml",
		  url: "/sec/api/model/xml/feedback/getevent/00000000/00000000?eventTypeId=14",
		  dataType: "xml",
		  error: function(){
		   alert("Error Loading XML Document");
		  },
		  success: function(xml) {
		   var $summ = $("#notice");
		   var summHTML = "<ul style='border:0px solid gray;' >";
		   //alert($(xml).find("eventList").find("event").find("eventId") +"//");
		   $(xml).find("eventList").find("event").each(function(i){
		    var id = $(this).find("eventId").text();
		    var type = $(this).find("eventTp").text();
		    var title = $(this).find("eventTitle").text();
		    var stDt = $(this).find("eventStDt").text();
		    var endDt = $(this).find("eventEndDt").text();
		    var url = $(this).find("eventLinkUrl").text();

			summHTML += "<li><a href=\"/" + url + "\" onClick='Handler.popup( {col:this} ); return false;'>" + (i+1) + ". " + title + "</a></li>";

			
			});	
		   summHTML += "</ul>";
		   $summ.html(summHTML);
		   
		   Handler.init();
		}
	});
*/	
	//리뷰
	$.ajax({
		  type: "GET",
		  url: "/sec/api/model/xml/feedback/getreviews",
		  dataType: "html",
		  error: function(){
		  //alert("Error Loading XML Document");
		  },
		  success: function(html) {
		   var $summ = $("#reviews");
		   
		   $summ.html(html);
		  }
	});

});



	

recentlyViewedText = "최근 본 제품";

var flashKV = new Object();
var flashReady = "collapse";

function flContentOnReady( id, success ) {
    flashKV[id] = document.getElementById(success);
    flashKV[id].setCondition( flashReady, 0);
}

function displayNoneHTML() {
    var displayNoneHTML = '<style type="text/css">'
                                + '#gnbp3 .menu { display:none;}'
                                + '.con #gnbp3 ul { margin:0; padding:0;}'
                                + '.con #gnbp3 ul li a {height:41px; padding:37px 22px 2px 22px;}'
                                + '.con #gnbp3 ul li.gnb1,'
                                + '.con #gnbp3 ul li.gnb2,'
                                + '.con #gnbp3 ul li.gnb3,'
                                + '.con #gnbp3 ul li.gnb4 {float:left;}'
                                + '.con #gnbp3 ul li.gnb1 {margin:0 0 0 38px;}'
                                + '</style>';
    document.write(displayNoneHTML);
}

function learnMore() {
    var $section = $(".visualArea").find(".section").filter(function() {
        if ( !$(this).hasClass(".section0") ) {
            return $(this);
        }
    });

    $section.each(function() {
        $(this).bind({
            mouseenter : function() {
                $(this).find(".btnLearnMore").stop(true, true).delay(150).animate({
                    "left" : 0
                }, 300);
            }
        });
    });

    $section.each(function() {
        $(this).bind({
            mouseleave : function() {
                $(this).find(".btnLearnMore").stop(true, true).animate({
                    "left" : "-125px"
                }, 300);
            }
        });
    });
}

function lowBandWidth() {
    var $section = $(".visualArea").find(".section0");

    $section.each(function() {

        $(this).find(".textLayer").hide();
        
        var desc1_Text = $(this).find(".description01").html();
        var Alink = $(this).find(".link").find("a").attr("href");
        var Atarget = $(this).find(".link").find("a").attr("target");
        var descHTML = '<a href="' + Alink + '">' + desc1_Text + '</a>';

        $(this).find(".description01").html(descHTML);
        if ( Atarget ) $(this).find(".description01").find("a").attr("target", Atarget);

        $(this).find(".title02").remove();
        $(this).find(".description02").remove();
        $(this).find(".link").remove();

    });

    // smallWall
    var $wall = $("#jumboWall").find(".section");

    $wall.each(function() {

        var $link = $(this).find("a").filter(function() {
            if ( !$(this).parent().hasClass("btnClose") ) {
                return $(this);
            }
        });

        $link.each(function() {
            if ( $(this).parent().hasClass("btnLearnMore") ) {
                $("<img />", {
                    "class" : "endArrow",
                    "src" : "/sec/main/common/img/index/ico_endarrow2.png"
                }).appendTo($(this));
            } else {
                $("<img />", {
                    "class" : "endArrow",
                    "src" : "/sec/main/common/img/index/ico_endarrow.png"
                }).appendTo($(this));
            }
        });

        if ( !isMobile ) {

            $(this).bind({
                click : function() {
                    if ( !$(this).find("a").length ) return false;
                    if ( $(this).find("a").attr("target") == "_blank" ) {
                        window.open($(this).find("a").attr("href"));
                        return false;
                    } else {
                        location.href = $(this).find("a").attr("href");
                    }

                },
                mouseover : function() {
                    if ( !$(this).find("a").length ) return false;
                    $(this).css({
                        "cursor" : "pointer"
                    });
                    if ( $(this).find("a").hasClass("noColor") ) return false;
                    $(this).find(".textStyle03").find("a").css({
                        "color" : "#0c4da2"
                    });
                    $(this).find(".description").find("a").css({
                        "color" : "#0c4da2"
                    });
                    $link.find(".endArrow").show();
                },
                mouseout : function() {
                    if ( !$(this).find("a").length ) return false;
                    if ( $(this).find("a").hasClass("noColor") ) return false;
                    $(this).find(".textStyle03").find("a").css({
                        "color" : "#000"
                    });
                    $(this).find(".description").find("a").css({
                        "color" : "#000"
                    });
                    $link.find(".endArrow").hide();
                }
            });

        } else {

            $(this).bind({
                click : function() {
                    if ( !$(this).find("a").length ) return false;
                    if ( $(this).find("a").attr("target") == "_blank" ) {
                        window.open($(this).find("a").attr("href"));
                        return false;
                    } else {
                        location.href = $(this).find("a").attr("href");
                    }

                }
            });
        }


    });

}

function smallWall() {

    var $wall = $("#jumboWall").find(".section");

    $wall.each(function() {

        var $link = $(this).find("a").filter(function() {
            if ( !$(this).parent().hasClass("btnClose") && !$(this).parent().hasClass("link") ) {
                return $(this);
            }
        });
        var $desc = $(this).find(".description01");

        $(this).find(".link").each(function() {
            $("<img />", {
                "class" : "endArrow",
                "src" : "/sec/main/common/img/index/ico_endarrow3.png"
            }).appendTo($(this).find("a")).show();
        });

        $link.each(function() {
            if ( $(this).parent().hasClass("btnLearnMore") ) {
                $("<img />", {
                    "class" : "endArrow",
                    "src" : "/sec/main/common/img/index/ico_endarrow2.png"
                }).appendTo($(this));
            } else {
                $("<img />", {
                    "class" : "endArrow",
                    "src" : "/sec/main/common/img/index/ico_endarrow.png"
                }).appendTo($(this));
            }
        });
        $desc.each(function() {
            $("<img />", {
                "class" : "endArrow",
                "src" : "/sec/main/common/img/index/ico_endarrow.png"
            }).appendTo($(this));
        });


        $(this).bind({
            click : function() {
                if ( !$(this).find("a").length ) return false;
                if ( !$(this).hasClass("section0") ) {
                    if ( $(this).find("a").attr("target") == "_blank" ) {
                        window.open($(this).find("a").attr("href"));
                    } else {
                        location.href = $(this).find("a").attr("href");
                    }
                    return false;
                }
            },
            mouseover : function() {
                if ( !$(this).find("a").length ) return false;
                $(this).css({
                    "cursor" : "pointer"
                });
                if ( $(this).find("a").hasClass("noColor") ) return false;
                $(this).find(".textStyle03").find("a").css({
                    "color" : "#0c4da2"
                });
                $link.find(".endArrow").show();
                $desc.find(".endArrow").show();

            },
            mouseout : function() {
                if ( !$(this).find("a").length ) return false;
                if ( $(this).find("a").hasClass("noColor") ) return false;
                $(this).find(".textStyle03").find("a").css({
                    "color" : "#000"
                });
                $link.find(".endArrow").hide();
                $desc.find(".endArrow").hide();
            }
        });


    });
}

function section0() {

    var $section = $("#jumboWall").find(".section0");

    $section.each(function(i) {
        $(this).bind({
            mouseover : function() {
                $(this).find(".description01").css({
                    "color" : "#0c4da2"
                });

            },
            mouseout : function() {
                $(this).find(".description01").css({
                    "color" : "#000"
                });
            }
        });
    });

}

function sectionInit() {

    var $section = $("#jumboWall").find(".section0");
    var $close = $("#jumboWall").find(".btnClose");
    var $animating = $("#jumboWall").find("*:animated");

    $section.removeClass("open").removeClass("expanded");
    $close.hide();
    $animating.stop(true, true);

    flashReady = "collapse";
    // lesNouveau
    $section.eq(0).css({
        "width" : "575px"
    });

    $section.eq(0).find(".title").eq(1).css({
		"top" : "-800px",
        "bottom" : "-400px"
    });
    $section.eq(0).find(".description").eq(1).css({
		"top" : "-800px",
        "bottom" : "-400px"
    });
    $section.eq(0).find(".link").css({
		"top" : "-800px",
        "bottom" : "-400px"
    });

    $section.eq(0).find(".title").eq(0).css({
        "display" : "block",
        "left" : "30px"
    });
    $section.eq(0).find(".description").eq(0).css({
        "display" : "block",
        "left" : "33px"
    });
    
    // telephone
    $section.eq(1).css({
        "width" : "575px",
        "left" : "193px"
    });
    $section.eq(1).find(".image").css({
        "top"  : "0px",
        "height" : "488px",
        "left" : "-193px"
    });
    
    $section.eq(1).find(".title").eq(1).css({
        "top" : "-800px",
        "bottom" : "-400px"
    });

    $section.eq(1).find(".title").eq(0).css({
        "display" : "block",
        "left" : "30px"
    });
    
    $section.eq(1).find(".description").eq(0).css({
        "display" : "block",
        "left" : "33px"
    });
    
    $section.eq(1).find(".description").eq(1).css({
        "top" : "-800px"
    });
    
    $section.eq(1).find(".link").css({
        "top" : "-800px"
    });

    // tvAudioVideo
    $section.eq(2).css({
        "width" : "575px"
    });
    $section.eq(2).find(".title").eq(1).css({
        "left" : "-800px"
    });
    $section.eq(2).find(".description").eq(1).css({
        "left" : "-800px"
    });
    $section.eq(2).find(".link").css({
        "left" : "-800px"
    });

    $section.eq(2).find(".title").eq(0).css({
        "display" : "block",
        "left" : "30px"
    });
    $section.eq(2).find(".description").eq(0).css({
        "display" : "block",
        "left" : "33px"
    });

    // IT
    $section.eq(3).css({
		"left" : "193px",
        "width" : "575px"
    });

	
	$section.eq(3).find(".image").eq(0).css({
		"left" : "-193px"
	});

	//alert($section.eq(3).find(".image").length);

    $section.eq(3).find(".title").eq(1).css({
        "left" : "-800px"
    });
    $section.eq(3).find(".description").eq(1).css({
        "left" : "-800px"
    });
    $section.eq(3).find(".link").css({
        "left" : "-800px"
    });

    $section.eq(3).find(".title").eq(0).css({
        "display" : "block",
        "left" : "30px"
    });
    $section.eq(3).find(".description").eq(0).css({
        "display" : "block",
        "left" : "31px"
    });

    // IT Mobile
    $section.eq(4).css({		
      "width" : "575px",
        "left" : "193px"
    });

	/*$section.eq(4).find('.section0').eq(0).css({
		"width" : "575px"
	});*/

    $section.eq(4).find(".image").eq(0).css({        
        "left" : "-193px"
    });
    $section.eq(4).find(".title").eq(1).css({
        "top" : "-600px"
    });
    $section.eq(4).find(".description").eq(1).css({
        "top" : "-600px"
    });
    $section.eq(4).find(".link").css({
        "top" : "-600px"
    });

    $section.eq(4).find(".title").eq(0).css({
        "display" : "block",
        "left" : "20px"
    });
    $section.eq(4).find(".description").eq(0).css({
        "display" : "block",
        "left" : "22px"
    });

    // electro
    $section.eq(5).css({
        "width" : "575px"
    });

    $section.eq(5).find(".title").eq(1).css({
        "left" : "-800px"
    });
    $section.eq(5).find(".description").eq(1).css({
        "left" : "-800px"
    });
    $section.eq(5).find(".link").css({
        "left" : "-800px"
    });

    $section.eq(5).find(".title").eq(0).css({
        "display" : "block",
        "left" : "30px"
    });
    $section.eq(5).find(".description").eq(0).css({
        "display" : "block",
        "left" : "33px"
    });
	
	// 생활가전
	$section.eq(6).css({
        "width" : "575px"
    });

    $section.eq(6).find(".title").eq(1).css({
		"top" : "-800px",
        "bottom" : "-400px"
    });

    $section.eq(6).find(".description").eq(1).css({
		"top" : "-800px",
        "bottom" : "-400px"
    });
    $section.eq(6).find(".link").css({
		"top" : "-800px",
        "bottom" : "-400px"
    });

    $section.eq(6).find(".title").eq(0).css({
        "display" : "block",
        "left" : "30px"
    });
    $section.eq(6).find(".description").eq(0).css({
        "display" : "block",
        "left" : "33px"
    });


}

function navigation() {
    var $jumboWall = $("#jumboWall, #header");
    var $navi = $("#jumboWall .navigation");
    var $depth1 = $navi.find("ul.depth1");
    var $trigger = $navi.find("li.depth1");
    var $depth2 = $trigger.find("ul.depth2");
    var $arrow = $navi.find(".hoverArrow");
    var $visualArea = $("#jumboWall .visualArea").css("z-index","160");		// IE7 에서는 z-index 문제로 보이지 않음
    var thisIdx = getCookie("jumboWall_KR");
    var rollTimer;
    var autoRollDelay = 8000;
    
    if ( thisIdx == "" || thisIdx == "NaN"  ) {
        thisIdx = 0;
    } else {
        thisIdx = parseInt(thisIdx, 10);
    }
    $visualArea.hide();
    $visualArea.eq(thisIdx).show().addClass("nowPlaying");
    //alert(thisIdx);
	if (typeof(thisIdx) != "Number")
	{
		thisIdx = parseInt(thisIdx,10);
	}

	if (thisIdx > 6)
	{
		thisIdx = 0;
	}
    wallBGInit(thisIdx);
    
    setInstantCookie("jumboWall_KR", thisIdx);

    $depth1.removeClass().addClass("depth1 hoverMenu" + thisIdx);
    $depth2.hide();
    $trigger.eq(thisIdx).next().show();
    $arrow.removeClass().addClass("hoverArrow hoverMenu"+thisIdx);
    $trigger.eq(thisIdx).find("ul.depth2").show();
    
    if ( rollTimer ) clearInterval(rollTimer);
    rollTimer = setInterval(rolling, autoRollDelay);

    $jumboWall.bind({
        mouseover : function() {
            clearInterval(rollTimer);
        },
        mouseout : function() {
            if ( rollTimer ) clearInterval(rollTimer);
            rollTimer = setInterval(rolling, autoRollDelay);
        }
    });
    
    
    $trigger.each(function(i) {
        $(this).children("a").bind({
            mouseenter : function() {
                $navi.removeClass().addClass("navigation hoverMenu"+i);
            },
            mouseleave : function() {
                $navi.removeClass().addClass("navigation");
            },
            click : function() {
                
                if ( rollTimer ) clearInterval(rollTimer);

                setInstantCookie("jumboWall_KR", i);
                //alert(i);
                wallBGInit(i);

                var $content = $($(this).attr("href"));

                if ( $content.hasClass("nowPlaying") ) {
                    return false;
                } else {
                    $visualArea.removeClass("nowPlaying");
                    $content.addClass("nowPlaying");
                }

                if ( !isMobile && checkBandWidthVar != "Low" ) sectionInit();

                $depth1.removeClass().addClass("depth1");
                $(this).parent().parent().addClass("hoverMenu"+i);
                $depth2.hide();
                $(this).next().show();
                $arrow.removeClass().addClass("hoverArrow hoverMenu"+i);

                $visualArea.hide();
                $content.show();

                return false;
            }
        });
    });
    
    function rolling () {
        
        var thisIdx = getCookie("jumboWall_KR");
        thisIdx = parseInt(thisIdx, 10);
        thisIdx = thisIdx + 1;
        
        //console.log(thisIdx);

        if ( thisIdx > 6 ) thisIdx = 0;

        setInstantCookie("jumboWall_KR", thisIdx);
        
        wallBGInit(thisIdx);

        var $content = $($trigger.eq(thisIdx).children("a").attr("href"));

        if ( $content.hasClass("nowPlaying") ) {
            return false;
        } else {
            $visualArea.removeClass("nowPlaying");
            $content.addClass("nowPlaying");
        }

        if ( !isMobile && checkBandWidthVar != "Low" ) sectionInit();

        $depth1.removeClass().addClass("depth1");
        $trigger.eq(thisIdx).children("a").parent().parent().addClass("hoverMenu"+thisIdx);
        $depth2.hide();
        $trigger.eq(thisIdx).children("a").next().show();
        $arrow.removeClass().addClass("hoverArrow hoverMenu"+thisIdx);

        /*
        $content.show().css({
            "opacity" : 1,
            "z-index" : 100
        });

        $visualArea.eq(nowIdx-1).animate({
            "opacity" : 0
        }, 1000, function() {
            $(this).hide().css({
                "z-index" : 100
            });
            $content.css("z-index",150);
        });
        */
       

        $visualArea.hide();
        $content.show();

        //window.location.hash = hashWord[thisIdx];

    }
}

function wallBGInit(idx) {
    
    //idx = 2;      //임시로 설정함
    
    var flashIdx = parseInt(idx, 10) + 1;
    //var flashIdx = parseInt(idx, 10);
    var flashFileName = "";
    var $visualArea = $("#jumboWall .visualArea");

    $visualArea.eq(idx).find(".section").each(function(i) {
        if ( i != 0 ) {
            if ( !$(this).hasClass("bg_Section" + i) ) {
                $(this).addClass("bg_Section"+i);
            }
        }
    });
    
    //alert(flashIdx);
     switch ( flashIdx ) {
        case 1 :
            flashFileName = "01_latest";
            break;
        case 2 :
            flashFileName = "02_phone";
            break;
        case 3 :
            flashFileName = "03_tv_av";
            break;
        case 4 :
            flashFileName = "04_it";
            break;
        case 5 :        
            flashFileName = "05_it_mobile";
            break;
        case 6 :
            flashFileName = "06_kitchen";
            break;
        case 7 :
            flashFileName = "07_appliances";
            break;
//      case 8 :
//          flashFileName = "tv_av";
//          break;
    }
    
    //alert(flashFileName + flashIdx);
    var flashLoader = '/sec/main/common/img/index/contents/kv_loader.swf';
    var flashFile = '/sec/main/common/img/index/contents/kv_' + flashFileName + '.swf';
    
    var flashHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="961" height="489" name="kv_loader_ie' + flashIdx +'" id="kv_loader_ie' + flashIdx + '" align="middle">'
                        +   '<param name="movie" value="/sec/main/common/img/index/contents/kv_loader.swf" />'
                        +   '<param name="quality" value="high" />'
                        +   '<param name="bgcolor" value="#ffffff" />'
                        +   '<param name="play" value="true" />'
                        +   '<param name="loop" value="true" />'
                        +   '<param name="wmode" value="opaque" />'
                        +   '<param name="scale" value="showall" />'
                        +   '<param name="menu" value="true" />'
                        +   '<param name="devicefont" value="false" />'
                        +   '<param name="salign" value="" />'
                        +   '<param name="flashvars" value="id=kv' + flashIdx + '&swf=/sec/main/common/img/index/contents/kv_' + flashFileName + '.swf" />'
                        +   '<param name="allowScriptAccess" value="always" />'
                        +   '<!--[if !IE]>-->'
                        +   '<object type="application/x-shockwave-flash" data="/sec/main/common/img/index/contents/kv_loader.swf" width="961" height="489" name="kv_loader' + flashIdx + '" id="kv_loader' + flashIdx + '">'
                        +       '<param name="movie" value="/sec/main/common/img/index/contents/kv_loader.swf" />'
                        +       '<param name="quality" value="high" />'
                        +       '<param name="bgcolor" value="#ffffff" />'
                        +       '<param name="play" value="true" />'
                        +       '<param name="loop" value="true" />'
                        +       '<param name="wmode" value="opaque" />'
                        +       '<param name="scale" value="showall" />'
                        +       '<param name="menu" value="true" />'
                        +       '<param name="devicefont" value="false" />'
                        +       '<param name="salign" value="" />'
                        +       '<param name="flashvars" value="id=kv' + flashIdx +'&swf=/sec/main/common/img/index/contents/kv_' + flashFileName + '.swf" />'
                        +       '<param name="allowScriptAccess" value="always" />'
                        +   '<!--<![endif]-->'
                        +       '<a href="http://www.adobe.com/go/getflash">'
                        +           '<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />'
                        +       '</a>'
                        +   '<!--[if !IE]>-->'
                        +   '</object>'
                        +   '<!--<![endif]-->'
                        +'</object>';
                        
    
    
    //alert(flashFileName + flashIdx);
    //var flashFile = '/sec/main/common/img/index/contents/kv_' + flashFileName + '.swf';
   // console.log( flashIdx, '\n', flashLoader, '\n', flashFile );
                        
    /*var flashHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="961" height="489" name="kv_loader_ie' + flashIdx +'" id="kv_loader_ie' + flashIdx + '" align="middle">'
                        +   '<param name="movie" value="'+ flashLoader +'" />'
                        +   '<param name="quality" value="high" />'
                        +   '<param name="bgcolor" value="#ffffff" />'
                        +   '<param name="play" value="true" />'
                        +   '<param name="loop" value="true" />'
                        +   '<param name="wmode" value="opaque" />'
                        +   '<param name="scale" value="showall" />'
                        +   '<param name="menu" value="true" />'
                        +   '<param name="devicefont" value="false" />'
                        +   '<param name="salign" value="" />'
                        +   '<param name="flashvars" value="id=kv' + flashIdx + '&swf='+ flashFile +'" />'
                        +   '<param name="allowScriptAccess" value="always" />'
                        +   '<!--[if !IE]>-->'
                        +   '<object type="application/x-shockwave-flash" data="'+flashLoader+'" width="961" height="489" name="kv_loader' + flashIdx + '" id="kv_loader' + flashIdx + '">'
                        +       '<param name="movie" value="'+ flashLoader+'" />'
                        +       '<param name="quality" value="high" />'
                        +       '<param name="bgcolor" value="#ffffff" />'
                        +       '<param name="play" value="true" />'
                        +       '<param name="loop" value="true" />'
                        +       '<param name="wmode" value="opaque" />'
                        +       '<param name="scale" value="showall" />'
                        +       '<param name="menu" value="true" />'
                        +       '<param name="devicefont" value="false" />'
                        +       '<param name="salign" value="" />'
                        +       '<param name="flashvars" value="id=kv' + flashIdx +'&swf='+ flashFile +'" />'
                        +       '<param name="allowScriptAccess" value="always" />'
                        +   '<!--<![endif]-->'
                        +       '<a href="http://www.adobe.com/go/getflash">'
                        +           '<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />'
                        +       '</a>'
                        +   '<!--[if !IE]>-->'
                        +   '</object>'
                        +   '<!--<![endif]-->'
                        +'</object>'; */

        if ( isMobile || checkBandWidthVar == "Low" ) {
            if ( !$visualArea.eq(idx).find(".image").hasClass("bg_lowband") ) {
                $visualArea.eq(idx).find(".image").html("");
                $visualArea.eq(idx).find(".image").addClass("bg_lowband");
            }
        } else {
            //alert(flashFileName + flashIdx);
            $visualArea.eq(idx).find(".image").html( flashHTML );
            //console.log( $visualArea.eq(idx).find(".image") );
        }
}

function expandTooltip() {
    var $expand = $("<div />", { "id" : "expandTooltip"});
    $expand.prependTo($("body"));
    $expand.html('<p style="font-size:14px;">자세히 보기</p>').hide();
    
    $("#jumboWall .section0").each(function() {
        $(this).bind({
            mousemove : function(e) {
                var xPos = e.pageX + 10;
                var yPos = e.pageY + 20;
                $expand.animate({
                    "left" : xPos + "px",
                    "top" : yPos + "px"
                }, 0);
            }
        });
    });

    $("#jumboWall .section").not(".section0").each(function() {
        $(this).bind({
            mouseover : function() {
                $expand.hide();
            }
        });
    });

}




function A_type(id,option) {
    var $section = $("#"+id).find(".section");
    var $btnClose = $section.eq(0).find(".btnClose");
    var $h4 = $section.eq(0).find("h4");
    var $desc = $section.eq(0).find(".description");
    var $link = $section.eq(0).find(".link");
    var $learnMore = $("#lesNouveau").find("p.btnLearnMore");
    var expandable = true;
    var clickable = true;
    var $expand = $("#expandTooltip");

    $section.eq(0).mouseover(function() {
        $(this).css("cursor","pointer");
    });

    $btnClose.find("a").click(function(e) {
        e.stopPropagation();
        $btnClose.fadeOut(50);
        if (option.effect){
            textHide(option.effect);
        }
        
        $expand.show();
        $section.eq(0)
            .animate({
                "width" : "575px"
            }, {
                duration: 1100,
                easing: "easeOutExpo"
            })
            .removeClass("open");
        flashReady = "collapse";
        if (option.flash){
            flashKV[option.flash].setCondition(flashReady);
        }
        //flashKV.kv1.setCondition("collapse");
        return false;
    });

    $section.eq(0).bind({
        mouseenter : function() {
            if ( !$(this).hasClass("open") ) {
                $expand.show();
            }
            if ( !$(this).hasClass("expanded") ) {
                if ( !$(this).hasClass("open") ) {
                    $(this).stop(true, true).animate({
                        "width" : "600px"
                    }, 200, function() {
                    });
                    $(this).addClass("expanded");
                    flashReady = "over";
                    if (option.flash){
                        flashKV[option.flash].setCondition(flashReady);
                    }
                    //flashKV.kv1.setCondition("over");
                }
            }
        },
        mouseleave : function() {
            if ( $(this).hasClass("expanded") ) {
                if ( !$(this).hasClass("open") ) {
                    $(this).animate({
                        "width" : "575px"
                    }, 200, function() {

                    });
                    $(this).removeClass("expanded");
                    flashReady = "collapse";
                    if (option.flash){
                        flashKV[option.flash].setCondition(flashReady);
                    }
                    //flashKV.kv1.setCondition("collapse");
                }
            }
            $expand.hide();
        },
        click : function(e) {
            if ( clickable ) {
                clickable = false;
                if ( !$(this).hasClass("open") ) {
                    if (option.effect){
                        textShow(option.effect);
                    }
                    
                    $expand.hide();
                    $section.eq(0).animate({
                        "width" : "961px"
                    }, {
                        duration: 1100,
                        easing: "easeOutExpo",
                        complete : function() {
                            $btnClose.fadeIn(50);
                            expandable = false;
                        }
                    })
                    .addClass("open");
                    flashReady = "expand";
                    if (option.flash){
                        flashKV[option.flash].setCondition(flashReady);
                    }
                    //flashKV.kv1.setCondition("expand");
                } else {
                    $btnClose.fadeOut(50);
                    if (option.effect){
                        textHide(option.effect);
                    }
                    
                    $expand.show();
                    $section.eq(0)
                        .animate({
                            "width" : "575px"
                        }, {
                            duration: 1100,
                            easing: "easeOutExpo"
                        })
                        .removeClass("open");
                    flashReady = "collapse";
                    if (option.flash){
                        flashKV[option.flash].setCondition(flashReady);
                    }
                    //flashKV.kv1.setCondition("collapse");
                }
            }
        }
    });

    function textShow(effect) {
        if (effect == "top"){
            
            $h4.eq(1).css({
                top : "-800px",
                left : "0px"
            });
            
            $desc.eq(1).css({
                top : "-800px",
                left : "0px"
            });
            
            $link.css({
                top : "-800px",
                left : "0px"
            });
            
        } 
        
        if (effect == "left"){
            
            $h4.eq(1).css({
                top : "0px",
                left : "-800px"
            });
            
            $desc.eq(1).css({
                top : "0px",
                left : "-800px"
            });
            
            $link.css({
                top : "0px",
                left : "-800px"
            });
            
        }
                
        $desc.eq(0).stop(true, true).fadeOut(150);
        
        $h4.eq(0).stop(true, true).fadeOut(150, function() {
            $h4.eq(1).stop(true, true).delay(150).animate({
                top : "0px",
                left : "0px",
                bottom : "121px"
            }, {
                duration: 800,
                easing: "easeOutExpo"
            });

            $desc.eq(1).stop(true, true).animate({
                top : "0px",
                left : "0px",
                bottom : "87px"
            }, {
                duration: 1200,
                easing: "easeOutExpo",
                complete : function() {

                }
            });

            $link.stop(true, true).animate({
                top : "0px",
                left : "0px",
                bottom : "58px"
            }, {
                duration: 1500,
                easing: "easeOutExpo",
                complete : function() {
                    clickable = true;
                }
            });

        });

    }

    function textHide(effect) {
        if (effect == "top"){
            var top_px = "-800px";
            var left_px = "0px";
        }
        
        if (effect == "left"){
            var top_px = "0px";
            var left_px = "-800px";
        }
        

        $desc.eq(1).stop(true, true).animate({
            top : top_px,
            left : left_px
            //"bottom" : "-400px"
        },{
            duration: 700,
            easing: "easeOutExpo"
        });

        $link.stop(true, true).animate({
            top : top_px,
            left : left_px
            //"bottom" : "-400px"
        },{
            duration: 700,
            easing: "easeOutExpo"
        });

        $h4.eq(1).stop(true, true).animate({
            top : top_px,
            left : left_px
            //"bottom" : "-400px"
        }, {
            duration: 700,
            easing: "easeOutExpo",
            complete : function() {
                $desc.eq(0).fadeIn(350);
                $h4.eq(0).fadeIn(350, function() {
                    expandable = true;
                    clickable = true;
                });
            }
        });

    }

}


function mobileDevice(id,option){
    var $section = $("#"+id).find(".section");
    var $btnClose = $section.eq(0).find(".btnClose");
    var $h4 = $section.eq(0).find("h4");
    var $desc = $section.eq(0).find(".description");
    var $link = $section.eq(0).find(".link");
    var $learnMore = $("#"+id).find("p.btnLearnMore");
    var expandable = true;
    var clickable = true;
    var $expand = $("#expandTooltip");

    $section.eq(0).mouseover(function() {
        $(this).css("cursor","pointer");
    });

    $btnClose.find("a").click(function(e) {
        e.stopPropagation();
        $btnClose.fadeOut(50);
        if (option.effect){
            textHide(option.effect);
        }
        $expand.show();
        var image = $section.eq(0).find('.image');
                    $(image[0]).animate({
                        left : "-193px"
                    },{
                        duration: 1100,
                        easing: "easeOutExpo"
                    });
        $section.eq(0).animate({
                        left : "193px",
                        width : "575px"
                    },{
                        duration: 1100,
                        easing: "easeOutExpo"
                    }).removeClass("open");
        flashReady = "collapse";
        if (option.flash){
            flashKV[option.flash].setCondition(flashReady);
        }
        return false;
    });

    $section.eq(0).bind({
        mouseenter : function() {
            if ( !$(this).hasClass("open") ) {
                $expand.show();
            }
            if ( !$(this).hasClass("expanded") ) {
                if ( !$(this).hasClass("open") ) {
                    $(this).stop(true, true).animate({
                        "width" : "620px",
						"left" : "173px"
                    }, 200, function() {
                    });
                    $(this).addClass("expanded");
                    flashReady = "over";
                    if (option.flash){
                        flashKV[option.flash].setCondition(flashReady);
                    }
                }
            }
        },
        mouseleave : function() {
            if ( $(this).hasClass("expanded") ) {
                if ( !$(this).hasClass("open") ) {
                    $(this).animate({
                       "width" : "575px",
						"left" : "193px"
                     }, 200, function() {

                    });
                    $(this).removeClass("expanded");
                    flashReady = "collapse";
                    if (option.flash){
                        flashKV[option.flash].setCondition(flashReady);
                    }
                }
            }
            $expand.hide();
        },
        click : function(e) {
            if ( clickable ) {
                clickable = false;
                if ( !$(this).hasClass("open") ) {
                    if (option.effect){
                        textShow(option.effect);
                    }
                    
                    $expand.hide();
                    var image = $section.eq(0).find('.image');
                    $(image[0]).animate({
                        left : "0px"
                    },{
                        duration: 1100,
                        easing: "easeOutExpo"
                    });
                    $section.eq(0).animate({
                        left : "0px",
                        width : "961px"
                    }, {
                        duration: 1100,
                        easing: "easeOutExpo",
                        complete : function() {
                            $btnClose.fadeIn(50);
                            expandable = false;
                        }
                    })
                    .addClass("open");
                    flashReady = "expand";
                    if (option.flash){
                        flashKV[option.flash].setCondition(flashReady);
                    }
                } else {
                    $btnClose.fadeOut(50);
                    if (option.effect){
                        textHide(option.effect);
                    }
                    $expand.show();
                    var image = $section.eq(0).find('.image');
                    $(image[0]).animate({
                        left : "-193px"
                    },{
                        duration: 1100,
                        easing: "easeOutExpo"
                    });
                    $section.eq(0)
                        .animate({
                            left : "193px",
                            width : "575px"
                        }, {
                            duration: 1100,
                            easing: "easeOutExpo"
                        })
                        .removeClass("open");
                    flashReady = "collapse";
                    if (option.flash){
                        flashKV[option.flash].setCondition(flashReady);
                    }
                }
            }
        }
    });

    function textShow(effect) {
        if (effect == "top"){
            
            $h4.eq(1).css({
                top : "-800px",
                left : "0px"
            });
            
            $desc.eq(1).css({
                top : "-800px",
                left : "0px"
            });
            
            $link.css({
                top : "-800px",
                left : "0px"
            });
            
        } 
        
        if (effect == "left"){
            
            $h4.eq(1).css({
                top : "0px",
                left : "-800px"
            });
            
            $desc.eq(1).css({
                top : "0px",
                left : "-800px"
            });
            
            $link.css({
                top : "0px",
                left : "-800px"
            });
            
        }
                
        $desc.eq(0).stop(true, true).fadeOut(150);
        
        $h4.eq(0).stop(true, true).fadeOut(150, function() {
            $h4.eq(1).stop(true, true).delay(150).animate({
                top : "0px",
                left : "0px",
                bottom : "121px"
            }, {
                duration: 800,
                easing: "easeOutExpo"
            });

            $desc.eq(1).stop(true, true).animate({
                top : "0px",
                left : "0px",
                bottom : "87px"
            }, {
                duration: 1200,
                easing: "easeOutExpo",
                complete : function() {

                }
            });

            $link.stop(true, true).animate({
                top : "0px",
                left : "0px",
                bottom : "58px"
            }, {
                duration: 1500,
                easing: "easeOutExpo",
                complete : function() {
                    clickable = true;
                }
            });

        });

    }

    function textHide(effect) {
        if (effect == "top"){
            var top_px = "-800px";
            var left_px = "0px";
        }
        
        if (effect == "left"){
            var top_px = "0px";
            var left_px = "-800px";
        }
        

        $desc.eq(1).stop(true, true).animate({
            top : top_px,
            left : left_px
            //"bottom" : "-400px"
        },{
            duration: 700,
            easing: "easeOutExpo"
        });

        $link.stop(true, true).animate({
            top : top_px,
            left : left_px
            //"bottom" : "-400px"
        },{
            duration: 700,
            easing: "easeOutExpo"
        });

        $h4.eq(1).stop(true, true).animate({
            top : top_px,
            left : left_px
            //"bottom" : "-400px"
        }, {
            duration: 700,
            easing: "easeOutExpo",
            complete : function() {
                $desc.eq(0).fadeIn(350);
                $h4.eq(0).fadeIn(350, function() {
                    expandable = true;
                    clickable = true;
                });
            }
        });

    }
}


function B_type(id,option){
    var $section = $("#"+id).find(".section");
    var $btnClose = $section.eq(0).find(".btnClose");
    var $h4 = $section.eq(0).find("h4");
    var $desc = $section.eq(0).find(".description");
    var $link = $section.eq(0).find(".link");
    var $learnMore = $("#"+id).find("p.btnLearnMore");
    var expandable = true;
    var clickable = true;
    var $expand = $("#expandTooltip");

    $section.eq(0).mouseover(function() {
        $(this).css("cursor","pointer");
    });

    $btnClose.find("a").click(function(e) {
        e.stopPropagation();
        $btnClose.fadeOut(50);
        if (option.effect){
            textHide(option.effect);
        }
        $expand.show();
        var image = $section.eq(0).find('.image');
                    $(image[0]).animate({
                        left : "-193px"
                    },{
                        duration: 1100,
                        easing: "easeOutExpo"
                    });
        $section.eq(0).animate({
                        left : "193px",
                        width : "575px"
                    },{
                        duration: 1100,
                        easing: "easeOutExpo"
                    }).removeClass("open");
        flashReady = "collapse";
        if (option.flash){
            flashKV[option.flash].setCondition(flashReady);
        }
        return false;
    });

    $section.eq(0).bind({
        mouseenter : function() {
            if ( !$(this).hasClass("open") ) {
                $expand.show();
            }
            if ( !$(this).hasClass("expanded") ) {
                if ( !$(this).hasClass("open") ) {
                    $(this).stop(true, true).animate({
                        "width" : "600px"
                    }, 200, function() {
                    });
                    $(this).addClass("expanded");
                    flashReady = "over";
                    if (option.flash){
                        flashKV[option.flash].setCondition(flashReady);
                    }
                }
            }
        },
        mouseleave : function() {
            if ( $(this).hasClass("expanded") ) {
                if ( !$(this).hasClass("open") ) {
                    $(this).animate({
                        "width" : "574px"
                    }, 200, function() {

                    });
                    $(this).removeClass("expanded");
                    flashReady = "collapse";
                    if (option.flash){
                        flashKV[option.flash].setCondition(flashReady);
                    }
                }
            }
            $expand.hide();
        },
        click : function(e) {
            if ( clickable ) {
                clickable = false;
                if ( !$(this).hasClass("open") ) {
                    if (option.effect){
                        textShow(option.effect);
                    }
                    
                    $expand.hide();
                    var image = $section.eq(0).find('.image');
                    $(image[0]).animate({
                        left : "0px"
                    },{
                        duration: 1100,
                        easing: "easeOutExpo"
                    });
                    $section.eq(0).animate({
                        left : "0px",
                        width : "961px"
                    }, {
                        duration: 1100,
                        easing: "easeOutExpo",
                        complete : function() {
                            $btnClose.fadeIn(50);
                            expandable = false;
                        }
                    })
                    .addClass("open");
                    flashReady = "expand";
                    if (option.flash){
                        flashKV[option.flash].setCondition(flashReady);
                    }
                } else {
                    $btnClose.fadeOut(50);
                    if (option.effect){
                        textHide(option.effect);
                    }
                    $expand.show();
                    var image = $section.eq(0).find('.image');
                    $(image[0]).animate({
                        left : "-193px"
                    },{
                        duration: 1100,
                        easing: "easeOutExpo"
                    });
                    $section.eq(0)
                        .animate({
                            left : "193px",
                            width : "575px"
                        }, {
                            duration: 1100,
                            easing: "easeOutExpo"
                        })
                        .removeClass("open");
                    flashReady = "collapse";
                    if (option.flash){
                        flashKV[option.flash].setCondition(flashReady);
                    }
                }
            }
        }
    });

    function textShow(effect) {
        if (effect == "top"){
            
            $h4.eq(1).css({
                top : "-800px",
                left : "0px"
            });
            
            $desc.eq(1).css({
                top : "-800px",
                left : "0px"
            });
            
            $link.css({
                top : "-800px",
                left : "0px"
            });
            
        } 
        
        if (effect == "left"){
            
            $h4.eq(1).css({
                top : "0px",
                left : "-800px"
            });
            
            $desc.eq(1).css({
                top : "0px",
                left : "-800px"
            });
            
            $link.css({
                top : "0px",
                left : "-800px"
            });
            
        }
                
        $desc.eq(0).stop(true, true).fadeOut(150);
        
        $h4.eq(0).stop(true, true).fadeOut(150, function() {
            $h4.eq(1).stop(true, true).delay(150).animate({
                top : "0px",
                left : "0px",
                bottom : "121px"
            }, {
                duration: 800,
                easing: "easeOutExpo"
            });

            $desc.eq(1).stop(true, true).animate({
                top : "0px",
                left : "0px",
                bottom : "87px"
            }, {
                duration: 1200,
                easing: "easeOutExpo",
                complete : function() {

                }
            });

            $link.stop(true, true).animate({
                top : "0px",
                left : "0px",
                bottom : "58px"
            }, {
                duration: 1500,
                easing: "easeOutExpo",
                complete : function() {
                    clickable = true;
                }
            });

        });

    }

    function textHide(effect) {
        if (effect == "top"){
            var top_px = "-800px";
            var left_px = "0px";
        }
        
        if (effect == "left"){
            var top_px = "0px";
            var left_px = "-800px";
        }
        

        $desc.eq(1).stop(true, true).animate({
            top : top_px,
            left : left_px
            //"bottom" : "-400px"
        },{
            duration: 700,
            easing: "easeOutExpo"
        });

        $link.stop(true, true).animate({
            top : top_px,
            left : left_px
            //"bottom" : "-400px"
        },{
            duration: 700,
            easing: "easeOutExpo"
        });

        $h4.eq(1).stop(true, true).animate({
            top : top_px,
            left : left_px
            //"bottom" : "-400px"
        }, {
            duration: 700,
            easing: "easeOutExpo",
            complete : function() {
                $desc.eq(0).fadeIn(350);
                $h4.eq(0).fadeIn(350, function() {
                    expandable = true;
                    clickable = true;
                });
            }
        });

    }
}

function camera(id,option){
    var $section = $("#"+id).find(".section");
    var $btnClose = $section.eq(0).find(".btnClose");
    var $h4 = $section.eq(0).find("h4");
    var $desc = $section.eq(0).find(".description");
    var $link = $section.eq(0).find(".link");
    var $learnMore = $("#"+id).find("p.btnLearnMore");
    var expandable = true;
    var clickable = true;
    var $expand = $("#expandTooltip");

    $section.eq(0).mouseover(function() {
        $(this).css("cursor","pointer");
    });

    $btnClose.find("a").click(function(e) {
        e.stopPropagation();
        $btnClose.fadeOut(50);
        if (option.effect){
            textHide(option.effect);
        }
        $expand.show();
        var image = $section.eq(0).find('.image');
                    $(image[0]).animate({
                        left : "-193px"
                    },{
                        duration: 1100,
                        easing: "easeOutExpo"
                    });
        $section.eq(0).animate({
                        left : "193px",
                        width : "574px"
                    },{
                        duration: 1100,
                        easing: "easeOutExpo"
                    }).removeClass("open");
        flashReady = "collapse";
        if (option.flash){
            flashKV[option.flash].setCondition(flashReady);
        }
        return false;
    });

    $section.eq(0).bind({
        mouseenter : function() {
            if ( !$(this).hasClass("open") ) {
                $expand.show();
            }
            if ( !$(this).hasClass("expanded") ) {
                if ( !$(this).hasClass("open") ) {
                    $(this).stop(true, true).animate({
                        "width" : "620px",
						"left" : "173px"
                    }, 200, function() {
                    });
                    $(this).addClass("expanded");
                    flashReady = "over";
                    if (option.flash){
                        flashKV[option.flash].setCondition(flashReady);
                    }
                }
            }
        },
        mouseleave : function() {
            if ( $(this).hasClass("expanded") ) {
                if ( !$(this).hasClass("open") ) {
                    $(this).animate({
                       "width" : "575px",
						"left" : "193px"
                    }, 200, function() {

                    });
                    $(this).removeClass("expanded");
                    flashReady = "collapse";
                    if (option.flash){
                        flashKV[option.flash].setCondition(flashReady);
                    }
                }
            }
            $expand.hide();
        },
        click : function(e) {
            if ( clickable ) {
                clickable = false;
                if ( !$(this).hasClass("open") ) {
                    if (option.effect){
                        textShow(option.effect);
                    }
                    
                    $expand.hide();
                    var image = $section.eq(0).find('.image');
                    $(image[0]).animate({
                        left : "0px"
                    },{
                        duration: 1100,
                        easing: "easeOutExpo"
                    });
                    $section.eq(0).animate({
                        left : "0px",
                        width : "961px"
                    }, {
                        duration: 1100,
                        easing: "easeOutExpo",
                        complete : function() {
                            $btnClose.fadeIn(50);
                            expandable = false;
                        }
                    })
                    .addClass("open");
                    flashReady = "expand";
                    if (option.flash){
                        flashKV[option.flash].setCondition(flashReady);
                    }
                } else {
                    $btnClose.fadeOut(50);
                    if (option.effect){
                        textHide(option.effect);
                    }
                    $expand.show();
                    var image = $section.eq(0).find('.image');
                    $(image[0]).animate({
                        left : "-173px"
                    },{
                        duration: 1100,
                        easing: "easeOutExpo"
                    });
                    $section.eq(0)
                        .animate({
                            left : "193px",
                            width : "575px"
                        }, {
                            duration: 1100,
                            easing: "easeOutExpo"
                        })
                        .removeClass("open");
                    flashReady = "collapse";
                    if (option.flash){
                        flashKV[option.flash].setCondition(flashReady);
                    }
                }
            }
        }
    });

    function textShow(effect) {
        if (effect == "top"){
            
            $h4.eq(1).css({
                top : "-800px",
                left : "0px"
            });
            
            $desc.eq(1).css({
                top : "-800px",
                left : "0px"
            });
            
            $link.css({
                top : "-800px",
                left : "0px"
            });
            
        } 
        
        if (effect == "left"){
            
            $h4.eq(1).css({
                top : "0px",
                left : "-800px"
            });
            
            $desc.eq(1).css({
                top : "0px",
                left : "-800px"
            });
            
            $link.css({
                top : "0px",
                left : "-800px"
            });
            
        }
                
        $desc.eq(0).stop(true, true).fadeOut(150);
        
        $h4.eq(0).stop(true, true).fadeOut(150, function() {
            $h4.eq(1).stop(true, true).delay(150).animate({
                top : "0px",
                left : "0px",
                bottom : "121px"
            }, {
                duration: 800,
                easing: "easeOutExpo"
            });

            $desc.eq(1).stop(true, true).animate({
                top : "0px",
                left : "0px",
                bottom : "87px"
            }, {
                duration: 1200,
                easing: "easeOutExpo",
                complete : function() {

                }
            });

            $link.stop(true, true).animate({
                top : "0px",
                left : "0px",
                bottom : "58px"
            }, {
                duration: 1500,
                easing: "easeOutExpo",
                complete : function() {
                    clickable = true;
                }
            });

        });

    }

    function textHide(effect) {
        if (effect == "top"){
            var top_px = "-800px";
            var left_px = "0px";
        }
        
        if (effect == "left"){
            var top_px = "0px";
            var left_px = "-800px";
        }
        

        $desc.eq(1).stop(true, true).animate({
            top : top_px,
            left : left_px
            //"bottom" : "-400px"
        },{
            duration: 700,
            easing: "easeOutExpo"
        });

        $link.stop(true, true).animate({
            top : top_px,
            left : left_px
            //"bottom" : "-400px"
        },{
            duration: 700,
            easing: "easeOutExpo"
        });

        $h4.eq(1).stop(true, true).animate({
            top : top_px,
            left : left_px
            //"bottom" : "-400px"
        }, {
            duration: 700,
            easing: "easeOutExpo",
            complete : function() {
                $desc.eq(0).fadeIn(350);
                $h4.eq(0).fadeIn(350, function() {
                    expandable = true;
                    clickable = true;
                });
            }
        });

    }
}



function notebooks(id,option){
    var $section = $("#"+id).find(".section");
    var $btnClose = $section.eq(0).find(".btnClose");
    var $h4 = $section.eq(0).find("h4");
    var $desc = $section.eq(0).find(".description");
    var $link = $section.eq(0).find(".link");
    var $learnMore = $("#"+id).find("p.btnLearnMore");
    var expandable = true;
    var clickable = true;
    var $expand = $("#expandTooltip");

    $section.eq(0).mouseover(function() {
        $(this).css("cursor","pointer");
    });

    $btnClose.find("a").click(function(e) {
        e.stopPropagation();
        $btnClose.fadeOut(50);
        if (option.effect){
            textHide(option.effect);
        }
        $expand.show();
        var image = $section.eq(0).find('.image');
                    $(image[0]).animate({
                        left : "-193px"
                    },{
                        duration: 1100,
                        easing: "easeOutExpo"
                    });
        $section.eq(0).animate({
                        left : "193px",
                        width : "575px"
                    },{
                        duration: 1100,
                        easing: "easeOutExpo"
                    }).removeClass("open");
        flashReady = "collapse";
        if (option.flash){
            flashKV[option.flash].setCondition(flashReady);
        }
        return false;
    });

    $section.eq(0).bind({
        mouseenter : function() {
            if ( !$(this).hasClass("open") ) {
                $expand.show();
            }
            if ( !$(this).hasClass("expanded") ) {
                if ( !$(this).hasClass("open") ) {
                    $(this).stop(true, true).animate({
                       "width" : "620px",
							"left" : "173px"
                    }, 200, function() {
                    });
                    $(this).addClass("expanded");
                    flashReady = "over";
                    if (option.flash){
                        flashKV[option.flash].setCondition(flashReady);
                    }
                }
            }
        },
        mouseleave : function() {
            if ( $(this).hasClass("expanded") ) {
                if ( !$(this).hasClass("open") ) {
                    $(this).animate({
                         "width" : "575px",
							"left" : "193px"
                    }, 200, function() {

                    });
                    $(this).removeClass("expanded");
                    flashReady = "collapse";
                    if (option.flash){
                        flashKV[option.flash].setCondition(flashReady);
                    }
                }
            }
            $expand.hide();
        },
        click : function(e) {
            if ( clickable ) {
                clickable = false;
                if ( !$(this).hasClass("open") ) {
                    if (option.effect){
                        textShow(option.effect);
                    }
                    
                    $expand.hide();
                    var image = $section.eq(0).find('.image');
                    $(image[0]).animate({
                        left : "0px"
                    },{
                        duration: 1100,
                        easing: "easeOutExpo"
                    });
                    $section.eq(0).animate({
                        left : "0px",
                        width : "961px"
                    }, {
                        duration: 1100,
                        easing: "easeOutExpo",
                        complete : function() {
                            $btnClose.fadeIn(50);
                            expandable = false;
                        }
                    })
                    .addClass("open");
                    flashReady = "expand";
                    if (option.flash){
                        flashKV[option.flash].setCondition(flashReady);
                    }
                } else {
                    $btnClose.fadeOut(50);
                    if (option.effect){
                        textHide(option.effect);
                    }
                    $expand.show();
                    var image = $section.eq(0).find('.image');
                    $(image[0]).animate({
                        left : "-193px"
                    },{
                        duration: 1100,
                        easing: "easeOutExpo"
                    });
                    $section.eq(0)
                        .animate({
                            left : "193px",
                            width : "575px"
                        }, {
                            duration: 1100,
                            easing: "easeOutExpo"
                        })
                        .removeClass("open");
                    flashReady = "collapse";
                    if (option.flash){
                        flashKV[option.flash].setCondition(flashReady);
                    }
                }
            }
        }
    });

    function textShow(effect) {
        if (effect == "top"){
            
            $h4.eq(1).css({
                top : "-800px",
                left : "0px"
            });
            
            $desc.eq(1).css({
                top : "-800px",
                left : "0px"
            });
            
            $link.css({
                top : "-800px",
                left : "0px"
            });
            
        } 
        
        if (effect == "left"){
            
            $h4.eq(1).css({
                top : "0px",
                left : "-800px"
            });
            
            $desc.eq(1).css({
                top : "0px",
                left : "-800px"
            });
            
            $link.css({
                top : "0px",
                left : "-800px"
            });
            
        }
                
        $desc.eq(0).stop(true, true).fadeOut(150);
        
        $h4.eq(0).stop(true, true).fadeOut(150, function() {
            $h4.eq(1).stop(true, true).delay(150).animate({
                top : "0px",
                left : "0px",
                bottom : "121px"
            }, {
                duration: 800,
                easing: "easeOutExpo"
            });

            $desc.eq(1).stop(true, true).animate({
                top : "0px",
                left : "0px",
                bottom : "87px"
            }, {
                duration: 1200,
                easing: "easeOutExpo",
                complete : function() {

                }
            });

            $link.stop(true, true).animate({
                top : "0px",
                left : "0px",
                bottom : "58px"
            }, {
                duration: 1500,
                easing: "easeOutExpo",
                complete : function() {
                    clickable = true;
                }
            });

        });

    }

    function textHide(effect) {
        if (effect == "top"){
            var top_px = "-800px";
            var left_px = "0px";
        }
        
        if (effect == "left"){
            var top_px = "0px";
            var left_px = "-800px";
        }
        

        $desc.eq(1).stop(true, true).animate({
            top : top_px,
            left : left_px
            //"bottom" : "-400px"
        },{
            duration: 700,
            easing: "easeOutExpo"
        });

        $link.stop(true, true).animate({
            top : top_px,
            left : left_px
            //"bottom" : "-400px"
        },{
            duration: 700,
            easing: "easeOutExpo"
        });

        $h4.eq(1).stop(true, true).animate({
            top : top_px,
            left : left_px
            //"bottom" : "-400px"
        }, {
            duration: 700,
            easing: "easeOutExpo",
            complete : function() {
                $desc.eq(0).fadeIn(350);
                $h4.eq(0).fadeIn(350, function() {
                    expandable = true;
                    clickable = true;
                });
            }
        });

    }
}






function mobileDevices(){
    var $section = $("#mobileDevices").find(".section");
    var $btnClose = $section.eq(0).find(".btnClose");
    var $h4 = $section.eq(0).find("h4");
    var $desc = $section.eq(0).find(".description");
    var $link = $section.eq(0).find(".link");
    var $learnMore = $("#mobileDevices").find("p.btnLearnMore");
    var expandable = true;
    var clickable = true;
    var $expand = $("#expandTooltip");

    $section.eq(0).mouseover(function() {
        $(this).css("cursor","pointer");
    });

    $btnClose.find("a").click(function(e) {
        e.stopPropagation();
        $btnClose.fadeOut(50);
        textHide();
        $expand.show();
        $section.eq(0)
            .animate({
                "width" : "575px"
            }, {
                duration: 1100,
                easing: "easeOutExpo"
            })
            .removeClass("open");
        flashReady = "collapse";
        flashKV.kv1.setCondition("collapse");
        return false;
    });

    $section.eq(0).bind({
        mouseenter : function() {
            if ( !$(this).hasClass("open") ) {
                $expand.show();
            }
            if ( !$(this).hasClass("expanded") ) {
                if ( !$(this).hasClass("open") ) {
                    $(this).stop(true, true).animate({
                        "width" : "600px"
                    }, 200, function() {
                    });
                    $(this).addClass("expanded");
                    flashReady = "over";
                    flashKV.kv1.setCondition("over");
                }
            }
        },
        mouseleave : function() {
            if ( $(this).hasClass("expanded") ) {
                if ( !$(this).hasClass("open") ) {
                    $(this).animate({
                        "width" : "575px"
                    }, 200, function() {

                    });
                    $(this).removeClass("expanded");
                    flashReady = "collapse";
                    flashKV.kv1.setCondition("collapse");
                }
            }
            $expand.hide();
        },
        click : function(e) {
            if ( clickable ) {
                clickable = false;
                if ( !$(this).hasClass("open") ) {
                    textShow();
                    $expand.hide();
                    var image = $section.eq(0).find('.image');
                    $(image[0]).animate({
                        left : "0px"
                    },{
                        duration: 1100,
                        easing: "easeOutExpo"
                    });
                    $section.eq(0).animate({
                        left : "0px",
                        width : "961px"
                    }, {
                        duration: 1100,
                        easing: "easeOutExpo",
                        complete : function() {
                            $btnClose.fadeIn(50);
                            expandable = false;
                        }
                    })
                    .addClass("open");
                    flashReady = "expand";
                    flashKV.kv1.setCondition("expand");
                } else {
                    $btnClose.fadeOut(50);
                    textHide();
                    $expand.show();
                    var image = $section.eq(0).find('.image');
                    $(image[0]).animate({
                        left : "-193px"
                    },{
                        duration: 1100,
                        easing: "easeOutExpo"
                    });
                    $section.eq(0)
                        .animate({
                            left : "193px",
                            width : "575px"
                        }, {
                            duration: 1100,
                            easing: "easeOutExpo"
                        })
                        .removeClass("open");
                    flashReady = "collapse";
                    flashKV.kv1.setCondition("collapse");
                }
            }
        }
    });

    function textShow() {
        $h4.eq(1).css({
            left : "0px"
        });
        $desc.eq(1).css({
            left : "0px"
        });
        $link.css({
            left : "0px"
        });
        
        
        
        $desc.eq(0).stop(true, true).fadeOut(150);
        
        $h4.eq(0).stop(true, true).fadeOut(150, function() {
            $h4.eq(1).stop(true, true).delay(150).animate({
                top : "20px",
                //left : "0px",
                bottom : "121px"
            }, {
                duration: 800,
                easing: "easeOutExpo"
            });

            $desc.eq(1).stop(true, true).animate({
                top : "100px",
                //left : "0px",
                bottom : "87px"
            }, {
                duration: 1200,
                easing: "easeOutExpo",
                complete : function() {

                }
            });

            $link.stop(true, true).animate({
                top : "160px",
                //left : "0px",
                bottom : "58px"
            }, {
                duration: 1500,
                easing: "easeOutExpo",
                complete : function() {
                    clickable = true;
                }
            });

        });

    }

    function textHide() {

        $desc.eq(1).stop(true, true).animate({
            top : "-800px"
            //"bottom" : "-400px"
        },{
            duration: 700,
            easing: "easeOutExpo"
        });

        $link.stop(true, true).animate({
            top : "-800px"
            //"bottom" : "-400px"
        },{
            duration: 700,
            easing: "easeOutExpo"
        });

        $h4.eq(1).stop(true, true).animate({
            top : "-800px"
            //"bottom" : "-400px"
        }, {
            duration: 700,
            easing: "easeOutExpo",
            complete : function() {
                $desc.eq(0).fadeIn(350);
                $h4.eq(0).fadeIn(350, function() {
                    expandable = true;
                    clickable = true;
                });
            }
        });

    }
}

function theLatest() {
    var $section = $("#theLatest").find(".section");
    var $btnClose = $section.eq(0).find(".btnClose");
    var $h4 = $section.eq(0).find("h4");
    var $desc = $section.eq(0).find(".description");
    var $link = $section.eq(0).find(".link");
    var $learnMore = $("#lesNouveau").find("p.btnLearnMore");
    var expandable = true;
    var clickable = true;
    var $expand = $("#expandTooltip");

    $section.eq(0).mouseover(function() {
        $(this).css("cursor","pointer");
    });

    $btnClose.find("a").click(function(e) {
        e.stopPropagation();
        $btnClose.fadeOut(50);
        textHide();
        $expand.show();
        $section.eq(0)
            .animate({
                "width" : "575px"
            }, {
                duration: 1100,
                easing: "easeOutExpo"
            })
            .removeClass("open");
        flashReady = "collapse";
        flashKV.kv1.setCondition("collapse");
        return false;
    });

    $section.eq(0).bind({
        mouseenter : function() {
            if ( !$(this).hasClass("open") ) {
                $expand.show();
            }
            if ( !$(this).hasClass("expanded") ) {
                if ( !$(this).hasClass("open") ) {
                    $(this).stop(true, true).animate({
                        "width" : "600px"
                    }, 200, function() {
                    });
                    $(this).addClass("expanded");
                    flashReady = "over";
                    flashKV.kv1.setCondition("over");
                }
            }
        },
        mouseleave : function() {
            if ( $(this).hasClass("expanded") ) {
                if ( !$(this).hasClass("open") ) {
                    $(this).animate({
                        "width" : "575px"
                    }, 200, function() {

                    });
                    $(this).removeClass("expanded");
                    flashReady = "collapse";
                    flashKV.kv1.setCondition("collapse");
                }
            }
            $expand.hide();
        },
        click : function(e) {
            if ( clickable ) {
                clickable = false;
                if ( !$(this).hasClass("open") ) {
                    textShow();
                    $expand.hide();
                    $section.eq(0).animate({
                        "width" : "961px"
                    }, {
                        duration: 1100,
                        easing: "easeOutExpo",
                        complete : function() {
                            $btnClose.fadeIn(50);
                            expandable = false;
                        }
                    })
                    .addClass("open");
                    flashReady = "expand";
                    flashKV.kv1.setCondition("expand");
                } else {
                    $btnClose.fadeOut(50);
                    textHide();
                    $expand.show();
                    $section.eq(0)
                        .animate({
                            "width" : "575px"
                        }, {
                            duration: 1100,
                            easing: "easeOutExpo"
                        })
                        .removeClass("open");
                    flashReady = "collapse";
                    flashKV.kv1.setCondition("collapse");
                }
            }
        }
    });

    function textShow() {

        $desc.eq(0).stop(true, true).fadeOut(150);

        $h4.eq(0).stop(true, true).fadeOut(150, function() {
            $h4.eq(1).stop(true, true).delay(150).animate({
                "bottom" : "121px"
            }, {
                duration: 800,
                easing: "easeOutExpo"
            });

            $desc.eq(1).stop(true, true).animate({
                "bottom" : "87px"
            }, {
                duration: 1200,
                easing: "easeOutExpo",
                complete : function() {

                }
            });

            $link.stop(true, true).animate({
                "bottom" : "58px"
            }, {
                duration: 1500,
                easing: "easeOutExpo",
                complete : function() {
                    clickable = true;
                }
            });

        });

    }

    function textHide() {

        $desc.eq(1).stop(true, true).animate({
            "bottom" : "-400px"
        },{
            duration: 700,
            easing: "easeOutExpo"
        });

        $link.stop(true, true).animate({
            "bottom" : "-400px"
        },{
            duration: 700,
            easing: "easeOutExpo"
        });

        $h4.eq(1).stop(true, true).animate({
            "bottom" : "-400px"
        }, {
            duration: 700,
            easing: "easeOutExpo",
            complete : function() {
                $desc.eq(0).fadeIn(350);
                $h4.eq(0).fadeIn(350, function() {
                    expandable = true;
                    clickable = true;
                });
            }
        });

    }

}

function telephone() {

    var $section = $("#telephone").find(".section");
    var $btnClose = $section.eq(0).find(".btnClose");
    var $h4 = $section.eq(0).find("h4");
    var $desc = $section.eq(0).find(".description");
    var $link = $section.eq(0).find(".link");
    var $learnMore = $("#telephone").find("p.btnLearnMore");
    var expandable = true;
    var clickable = true;
    var $expand = $("#expandTooltip");

    $section.eq(0).mouseover(function() {
        $(this).css("cursor","pointer");
    });

    $btnClose.find("a").click(function(e) {
        e.stopPropagation();
        $btnClose.fadeOut(50);
        textHide();
        $expand.show();
        $section.eq(0)
            .animate({
                "width" : "574px",
                "left" : "193px"
            }, {
                duration: 1100,
                easing: "easeOutExpo"
            })
            .removeClass("open");
        $section.eq(0).find(".image").animate({
            "left" : "-192px"
        }, {
            duration: 1100,
            easing: "easeOutExpo"
        });
        flashReady = "collapse";
        flashKV.kv2.setCondition("collapse");
        return false;
    });

    $section.eq(0).bind({
        mouseenter : function() {
            if ( !$(this).hasClass("open") ) {
                $expand.show();
            }
            if ( !$(this).hasClass("expanded") ) {
                if ( !$(this).hasClass("open") ) {
                    $(this).stop(true, true).animate({
                        "width" : "620px",
                        "left" : "173px"
                    }, 200, function() {
                    });
                    $(this).addClass("expanded");
                    //flashKV.kv2.setCondition("over");
                }
            }
        },
        mouseleave : function() {
            if ( $(this).hasClass("expanded") ) {
                if ( !$(this).hasClass("open") ) {
                    $(this).animate({
                        "width" : "574px",
                        "left" : "193px"
                    }, 200);
                    $(this).removeClass("expanded");
                    //flashKV.kv2.setCondition("collapse");
                }
            }
            $expand.hide();
        },
        click : function() {
            if ( clickable ) {
                clickable = false;
                if ( !$(this).hasClass("open") ) {
                    textShow();
                    $expand.hide();
                    $section.eq(0).animate({
                        "left" : "0px",
                        "width" : "100%"
                    }, {
                        duration: 1100,
                        easing: "easeOutExpo",
                        complete : function() {
                            $btnClose.fadeIn(50);
                            expandable = false;
                        }
                    })
                    .addClass("open");
                    $section.eq(0).find(".image").animate({
                        "left" : 0
                    },{
                        duration: 1100,
                        easing: "easeOutExpo"
                    });
                    flashReady = "expand";
                    flashKV.kv2.setCondition("expand");
                } else {
                    $btnClose.fadeOut(50);
                    textHide();
                    $expand.show();
                    $section.eq(0)
                        .animate({
                            "width" : "574px",
                            "left" : "193px"
                        }, {
                            duration: 700
                            //easing: "easeOutExpo"
                        })
                        .removeClass("open");
                    $section.eq(0).find(".image").animate({
                        "left" : "-192px"
                    }, {
                        duration: 700
                        //easing: "easeOutExpo"
                    });
                    flashReady = "collapse";
                    flashKV.kv2.setCondition("collapse");

                }
            }
        }
    });

    function textShow() {

        $h4.eq(0).stop(true, true).fadeOut(150);
        $desc.eq(0).stop(true, true).fadeOut(150, function() {
            $h4.eq(1).stop(true, true).animate({
                "top" : "130px"
            }, {
                duration: 800,
                easing: "easeOutExpo"
            });

            $desc.eq(1).stop(true, true).animate({
                "top" : "225px"
            }, {
                duration: 1000,
                easing: "easeOutExpo"
            });

            $link.eq(0).stop(true, true).animate({
                "top" : "255px"
            }, {
                duration: 1200,
                easing: "easeOutExpo",
                complete : function() {
                    clickable = true;
                }
            });

        });



    }

    function textHide() {

        $h4.eq(1).animate({
            "top" : "-800px"
        }, {
            duration: 700,
            easing: "easeOutExpo"
        });

        $desc.eq(1).animate({
            "top" : "-800px"
        }, {
            duration: 700,
            easing: "easeOutExpo"
        });

        $link.eq(0).animate({
            "top" : "-800px"
        }, {
            duration: 900,
            easing: "easeOutExpo",
            complete : function() {
                $h4.eq(0).fadeIn(150);
                $desc.eq(0).fadeIn(150);
                expandable = true;
                clickable = true;
            }
        });

    }

}

function tvAudioVideo() {

    var $section = $("#tvAudioVideo").find(".section");
    var $btnClose = $section.eq(0).find(".btnClose");
    var $h4 = $section.eq(0).find("h4");
    var $desc = $section.eq(0).find(".description");
    var $link = $section.eq(0).find(".link");
    var $learnMore = $("#tvAudioVideo").find("p.btnLearnMore");
    var expandable = true;
    var clickable = true;
    var $expand = $("#expandTooltip");

    $section.eq(0).mouseover(function() {
        $(this).css("cursor","pointer");
    });

    $btnClose.find("a").click(function(e) {
        e.stopPropagation();
        $btnClose.fadeOut(50);
        textHide();
        $expand.show();
        $section.eq(0)
            .animate({
                "width" : "575px"
            }, {
                duration: 1100,
                easing: "easeOutExpo"
            })
            .removeClass("open");
        flashReady = "collapse";
        flashKV.kv3.setCondition("collapse");
        return false;
    });

    $section.eq(0).bind({
        mouseenter : function() {
            if ( !$(this).hasClass("open") ) {
                $expand.show();
            }
            if ( !$(this).hasClass("expanded") ) {
                if ( !$(this).hasClass("open") ) {
                    $(this).stop(true, true).animate({
                        "width" : "600px"
                    }, 200, function() {
                    });
                    $(this).addClass("expanded");
                    flashReady = "over";
                    flashKV.kv3.setCondition("over");
                }
            }
        },
        mouseleave : function() {
            if ( $(this).hasClass("expanded") ) {
                if ( !$(this).hasClass("open") ) {
                    $(this).animate({
                        "width" : "575px"
                    }, 200, function() {
                    });
                    $(this).removeClass("expanded");
                    flashKV.kv3.setCondition("collapse");
                }
            }
            $expand.hide();
        },
        click : function(e) {
            if ( clickable ) {
                clickable = false;
                if ( !$(this).hasClass("open") ) {
                    textShow();
                    $expand.hide();
                    $(this).animate({
                        "width" : "961px"
                    }, {
                        duration: 1100,
                        easing: "easeOutExpo",
                        complete : function() {
                            $btnClose.fadeIn(50);
                            expandable = false;
                        }
                    })
                    .addClass("open");
                    flashReady = "expand";
                    flashKV.kv3.setCondition("expand");
                } else {
                    $btnClose.fadeOut(50);
                    textHide();
                    $expand.show();
                    $section.eq(0)
                        .animate({
                            "width" : "575px"
                        }, {
                            duration: 1100,
                            easing: "easeOutExpo"
                        })
                        .removeClass("open");
                    flashReady = "collapse";
                    flashKV.kv3.setCondition("collapse");
                }
            }
        }
    });

    function textShow() {

        $desc.eq(0).stop(true, true).fadeOut(150);

        $h4.eq(0).stop(true, true).fadeOut(150, function() {
            $h4.eq(1).stop(true, true).delay(150).animate({
                "left" : "30px"
            }, {
                duration: 1100,
                easing: "easeOutExpo"
            });

            $desc.eq(1).stop(true, true).animate({
                "left" : "33px"
            }, {
                duration: 1100,
                easing: "easeOutExpo",
                complete : function() {

                }
            });

            $link.stop(true, true).animate({
                "left" : "33px"
            }, {
                duration: 1100,
                easing: "easeOutExpo",
                complete : function() {
                    clickable = true;
                }
            });

        });

    }

    function textHide() {

        $desc.eq(1).stop(true, true).animate({
            "left" : "-800px"
        },{
            duration: 700,
            easing: "easeOutExpo"
        });

        $link.stop(true, true).animate({
            "left" : "-800px"
        },{
            duration: 700,
            easing: "easeOutExpo"
        });

        $h4.eq(1).stop(true, true).animate({
            "left" : "-800px"
        }, {
            duration: 700,
            easing: "easeOutExpo",
            complete : function() {
                $desc.eq(0).fadeIn(350);
                $h4.eq(0).fadeIn(350, function() {
                    expandable = true;
                    clickable = true;
                });
            }
        });

    }

}


function photoCamescope() {

    var $section = $("#photoCamescope").find(".section");
    var $btnClose = $section.eq(0).find(".btnClose");
    var $h4 = $section.eq(0).find("h4");
    var $desc = $section.eq(0).find(".description");
    var $link = $section.eq(0).find(".link");
    var $learnMore = $("#photoCamescope").find("p.btnLearnMore");
    var expandable = true;
    var clickable = true;
    var $expand = $("#expandTooltip");

    $section.eq(0).mouseover(function() {
        $(this).css("cursor","pointer");
    });

    $btnClose.find("a").click(function(e) {
        e.stopPropagation();
        $btnClose.fadeOut(50);
        textHide();
        $expand.show();
        $section.eq(0)
            .animate({
                "width" : "383px"
            }, {
                duration: 1100,
                easing: "easeOutExpo"
            })
            .removeClass("open");
        flashReady = "collapse";
        flashKV.kv4.setCondition("collapse");
        return false;
    });

    $section.eq(0).bind({
        mouseenter : function() {
            if ( !$(this).hasClass("open") ) {
                $expand.show();
            }
            if ( !$(this).hasClass("expanded") ) {
                if ( !$(this).hasClass("open") ) {
                    $(this).stop(true, true).animate({
                        "width" : "420px"
                    }, 200, function() {
                    });
                    $(this).addClass("expanded");
                    flashReady = "over";
                    flashKV.kv4.setCondition("over");
                }
            }
        },
        mouseleave : function() {
            if ( $(this).hasClass("expanded") ) {
                if ( !$(this).hasClass("open") ) {
                    $(this).animate({
                        "width" : "383px"
                    }, 200, function() {
                    });
                    $(this).removeClass("expanded");
                    flashKV.kv4.setCondition("collapse");
                }
            }
            $expand.hide();
        },
        click : function(e) {
            if ( clickable ) {
                clickable = false;
                if ( !$(this).hasClass("open") ) {
                    textShow();
                    $expand.hide();
                    $(this).animate({
                        "width" : "961px"
                    }, {
                        duration: 1100,
                        easing: "easeOutExpo",
                        complete : function() {
                            $btnClose.fadeIn(50);
                            expandable = false;
                        }
                    })
                    .addClass("open");
                    flashReady = "expand";
                    flashKV.kv4.setCondition("expand");
                } else {
                    $btnClose.fadeOut(50);
                    textHide();
                    $expand.show();
                    $section.eq(0)
                        .animate({
                            "width" : "383px"
                        }, {
                            duration: 1100,
                            easing: "easeOutExpo"
                        })
                        .removeClass("open");
                    flashReady = "collapse";
                    flashKV.kv4.setCondition("collapse");
                }
            }
        }
    });

    function textShow() {

        $desc.eq(0).stop(true, true).animate({
            "left" : "-600px"
        }, 700);

        $h4.eq(0).stop(true, true).animate({
            "left" : "-600px"
        },500, function() {
            $h4.eq(1).stop(true, true).delay(150).animate({
                "left" : "30px"
            }, {
                duration: 1100,
                easing: "easeOutExpo"
            });

            $desc.eq(1).stop(true, true).animate({
                "left" : "33px"
            }, {
                duration: 1100,
                easing: "easeOutExpo",
                complete : function() {

                }
            });

            $link.stop(true, true).animate({
                "left" : "33px"
            }, {
                duration: 1100,
                easing: "easeOutExpo",
                complete : function() {
                    clickable = true;
                }
            });

        });

    }

    function textHide() {

        $desc.eq(1).stop(true, true).animate({
            "left" : "-800px"
        },{
            duration: 1000,
            easing: "easeOutExpo"
        });

        $link.stop(true, true).animate({
            "left" : "-800px"
        },{
            duration: 1000,
            easing: "easeOutExpo"
        });

        $h4.eq(1).stop(true, true).animate({
            "left" : "-800px"
        }, {
            duration: 700,
            easing: "easeOutExpo",
            complete : function() {
                $desc.eq(0).stop(true, true).animate({
                    "left" : "33px"
                }, 700);

                $h4.eq(0).stop(true, true).animate({
                    "left" : "30px"
                },500, function() {
                    expandable = true;
                    clickable = true;
                });
            }

        });

    }
}

function informatique() {

    var $section = $("#informatique").find(".section");
    var $btnClose = $section.eq(0).find(".btnClose");
    var $h4 = $section.eq(0).find("h4");
    var $desc = $section.eq(0).find(".description");
    var $link = $section.eq(0).find(".link");
    var $learnMore = $("#informatique").find("p.btnLearnMore");
    var expandable = true;
    var clickable = true;
    var $expand = $("#expandTooltip");

    $section.eq(0).mouseover(function() {
        $(this).css("cursor","pointer");
    });

    $btnClose.find("a").click(function(e) {
        e.stopPropagation();
        $btnClose.fadeOut(50);
        textHide();
        $expand.show();
        $section.eq(0)
            .animate({
                "width" : "382px",
                "left" : "385px"
            }, {
                duration: 1100,
                easing: "easeOutExpo"
            })
            .removeClass("open");
        $section.eq(0).find(".image").animate({
            "left" : "-384px"
        }, {
            duration: 1100,
            easing: "easeOutExpo"
        });
        flashReady = "collapse";
        flashKV.kv5.setCondition("collapse");
        return false;
    });

    $section.eq(0).bind({
        mouseenter : function() {
            if ( !$(this).hasClass("open") ) {
                $expand.show();
            }
            if ( !$(this).hasClass("expanded") ) {
                if ( !$(this).hasClass("open") ) {
                    $(this).stop(true, true).animate({
                        "width" : "423px",
                        "left" : "365px"
                    }, 200, function() {
                    });
                    $(this).addClass("expanded");
                    //flashKV.kv5.setCondition("over");
                }
            }
        },
        mouseleave : function() {
            if ( $(this).hasClass("expanded") ) {
                if ( !$(this).hasClass("open") ) {
                    $(this).animate({
                        "width" : "382px",
                        "left" : "385px"
                    }, 200, function() {
                    });
                    $(this).removeClass("expanded");
                    //flashKV.kv5.setCondition("collapse");
                }
            }
            $expand.hide();
        },
        click : function() {
            if ( clickable ) {
                clickable = false;
                if ( !$(this).hasClass("open") ) {
                    textShow();
                    $expand.hide();
                    $section.eq(0).animate({
                        "left" : "0px",
                        "width" : "961px"
                    }, {
                        duration: 1100,
                        easing: "easeOutExpo",
                        complete : function() {
                            $btnClose.fadeIn(50);
                            expandable = false;
                        }
                    })
                    .addClass("open");
                    $section.eq(0).find(".image").animate({
                        "left" : 0
                    }, {
                        duration: 1100,
                        easing: "easeOutExpo"
                    });
                    flashReady = "expand";
                    flashKV.kv5.setCondition("expand");
                } else {
                    $btnClose.fadeOut(50);
                    textHide();
                    $expand.show();
                    $section.eq(0)
                        .animate({
                            "width" : "382px",
                            "left" : "385px"
                        }, {
                            duration: 1100,
                            easing: "easeOutExpo"
                        })
                        .removeClass("open");
                    $section.eq(0).find(".image").animate({
                        "left" : "-384px"
                    }, {
                        duration: 1100,
                        easing: "easeOutExpo"
                    });
                    flashReady = "collapse";
                    flashKV.kv5.setCondition("collapse");

                }
            }
        }
    });

    function textShow() {

        $h4.eq(0).stop(true, true).fadeOut(150);
        $desc.eq(0).stop(true, true).fadeOut(150, function() {
            $h4.eq(1).stop(true, true).animate({
                "top" : "132px"
            }, {
                duration: 800,
                easing: "easeOutExpo"
            });

            $desc.eq(1).stop(true, true).animate({
                "top" : "227px"
            }, {
                duration: 1000,
                easing: "easeOutExpo"
            });

            $link.eq(0).stop(true, true).animate({
                "top" : "333px"
            }, {
                duration: 1200,
                easing: "easeOutExpo",
                complete : function() {
                    clickable = true;
                }
            });

        });



    }

    function textHide() {

        $h4.eq(1).stop(true, true).animate({
            "top" : "-600px"
        }, {
            duration: 300,
            easing: "easeOutExpo"
        });

        $desc.eq(1).stop(true, true).animate({
            "top" : "-600px"
        }, {
            duration: 300,
            easing: "easeOutExpo"
        });

        $link.eq(0).stop(true, true).animate({
            "top" : "-600px"
        }, {
            duration: 300,
            easing: "easeOutExpo",
            complete : function() {
                $h4.eq(0).stop(true, true).fadeIn(150);
                $desc.eq(0).stop(true, true).fadeIn(150, function() {
                    expandable = true;
                    clickable = true;
                });
            }
        });

    }


}

function electro() {

    var $section = $("#electro").find(".section");
    var $btnClose = $section.eq(0).find(".btnClose");
    var $h4 = $section.eq(0).find("h4");
    var $desc = $section.eq(0).find(".description");
    var $link = $section.eq(0).find(".link");
    var $learnMore = $("#electro").find("p.btnLearnMore");
    var expandable = true;
    var clickable = true;
    var $expand = $("#expandTooltip");

    $section.eq(0).mouseover(function() {
        $(this).css("cursor","pointer");
    });

    $btnClose.find("a").click(function(e) {
        e.stopPropagation();
        $btnClose.fadeOut(50);
        textHide();
        $expand.show();
        $section.eq(0)
            .animate({
                "width" : "575px"
            }, {
                duration: 1100,
                easing: "easeOutExpo"
            })
            .removeClass("open");
        flashReady = "collapse";
        flashKV.kv6.setCondition("collapse");
        return false;
    });

    $section.eq(0).bind({
        mouseenter : function() {
            if ( !$(this).hasClass("open") ) {
                $expand.show();
            }
            if ( !$(this).hasClass("expanded") ) {
                if ( !$(this).hasClass("open") ) {
                    $(this).stop(true, true).animate({
                        "width" : "600px"
                    }, 200, function() {
                    });
                    $(this).addClass("expanded");
                    flashReady = "over";
                    flashKV.kv6.setCondition("over");
                }
            }
        },
        mouseleave : function() {
            if ( $(this).hasClass("expanded") ) {
                if ( !$(this).hasClass("open") ) {
                    $(this).animate({
                        "width" : "575px"
                    }, 200, function() {

                    });
                    $(this).removeClass("expanded");
                    flashReady = "collapse";
                    flashKV.kv6.setCondition("collapse");
                }
            }
            $expand.hide();
        },
        click : function(e) {
            if ( clickable ) {
                clickable = false;
                if ( !$(this).hasClass("open") ) {
                    textShow();
                    $expand.hide();
                    $section.eq(0).animate({
                        "width" : "961px"
                    }, {
                        duration: 1100,
                        easing: "easeOutExpo",
                        complete : function() {
                            $btnClose.fadeIn(50);
                            expandable = false;
                        }
                    })
                    .addClass("open");
                    flashReady = "expand";
                    flashKV.kv6.setCondition("expand");
                } else {
                    $btnClose.fadeOut(50);
                    textHide();
                    $expand.show();
                    $section.eq(0)
                        .animate({
                            "width" : "575px"
                        }, {
                            duration: 1100,
                            easing: "easeOutExpo"
                        })
                        .removeClass("open");
                    flashReady = "collapse";
                    flashKV.kv6.setCondition("collapse");
                }
            }
        }
    });

    function textShow() {

        $desc.eq(0).stop(true, true).fadeOut(150);

        $h4.eq(0).stop(true, true).fadeOut(150, function() {
            $h4.eq(1).stop(true, true).delay(150).animate({
                "left" : "30px"
            }, {
                duration: 1100,
                easing: "easeOutExpo"
            });

            $desc.eq(1).stop(true, true).animate({
                "left" : "33px"
            }, {
                duration: 1100,
                easing: "easeOutExpo",
                complete : function() {

                }
            });

            $link.stop(true, true).animate({
                "left" : "33px"
            }, {
                duration: 1100,
                easing: "easeOutExpo",
                complete : function() {
                    clickable = true;
                }
            });

        });

    }

    function textHide() {

        $desc.eq(1).stop(true, true).animate({
            "left" : "-800px"
        },{
            duration: 700,
            easing: "easeOutExpo"
        });

        $link.stop(true, true).animate({
            "left" : "-800px"
        },{
            duration: 700,
            easing: "easeOutExpo"
        });

        $h4.eq(1).stop(true, true).animate({
            "left" : "-800px"
        }, {
            duration: 700,
            easing: "easeOutExpo",
            complete : function() {
                $desc.eq(0).fadeIn(350);
                $h4.eq(0).fadeIn(350, function() {
                    expandable = true;
                    clickable = true;
                });
            }
        });

    }

}

function indexTab() {

    var $tab = $("#indexTab");
    var $trigger = $tab.find("li");
    var $cont = $(".homeContent").children("div");

    var p = parameters();

    $cont.hide();

    if(p.brightcove) {
        $trigger.find("a.videos").addClass("activator").parent().addClass("activator");
        $($trigger.find("a.videos").attr("href")).show();
    }
    else {
        $trigger.eq(0).addClass("activator").find("a").addClass("activator");
        $cont.eq(0).show();
    }

    $trigger.each(function(i) {
        $(this).find("a").bind({
            click : function() {
                var $thisCont = $($(this).attr("href"));
                $trigger.each(function() {
                    $(this).removeClass("activator");
                    $(this).find("a").removeClass("activator");
                });
                $(this).addClass("activator");
                $(this).parent().addClass("activator");
                $cont.hide();
                $thisCont.fadeIn(250);

                switch($thisCont.attr('id')) {
	                case 'twitter' :
						if($('#twitter .tweetArea li').length == 0) {
							var script = $("<script>", { "type" : "text/javascript", "src" : "http://twitter.com/statuses/user_timeline/"+twitterScreenName+".json?callback=twitterCallback&count=3"});
							script.appendTo($('#twitter .tweetArea'));
						}
						if($('#twitter .tweetArea iframe').length == 0) {
							tweetBoxRender();
						}
						break;
                    case 'videos' :
                        try{indexBC();} catch(e){};
                        break;
                    default:
                        break;
                }
                if($thisCont.attr('id') != 'videos') $('#videos .bc').html('');

                return false;
            }
        });
    });
}

var twitterScreenName = 'samsungtomorrow';

function twitterInit() {
  $('#twitter .tweetArea').text('Loading...');
  $('#twitter .btnArea').html('<a href="#none" class="btnStyle tw" id="btnCTW"><span><strong>트위터</strong> 연동하기</span></a>');

  twttr.anywhere(function (T) {

    tweetBoxRender();

    twitterConnect(T);

    if(!isMobile) T('#twitter').hovercards();

    T.bind("authComplete", function (e, user) {
      twitterConnect(T);
    });

    T.bind("signOut", function (e) {
      twitterConnect(T);
    });

  });
}


function twitterConnect(T) {
	var currentUser, screenName, profileImage, profileImageTag;

	if (T.isConnected()) {
		currentUser = T.currentUser;
		screenName = currentUser.data('screen_name');
		profileImage = currentUser.data('profile_image_url');
		profileImageTag = "<img width='20' height='20' src='" + profileImage + "'/>";
		$('#twitter .btnArea').html(profileImageTag + " Logged in as " + screenName + " ( <a href='#none' onclick='twttr.anywhere.signOut();'>Sign out</a> )");
	} else {
		$('#twitter .btnArea').html('<a href="#none" class="btnStyle tw" id="btnCTW"><span><strong>트위터</strong> 연동하기</span></a>');
		$('#btnCTW').click(function () {
			s_control_click('events,eVar17', 'event15', 'event15,home:twitter', 'o', 'social media click');
			T.signIn();
			return false;
		});
	}
}

function tweetBoxRender() {
	twttr.anywhere(function (T) {
		$("#twitter .tweetBox").html('');
		T("#twitter .tweetBox").tweetBox({
			counter: false,
			width: 711,
			height: 80,
			label: '&nbsp;',
			defaultContent: '@'+twitterScreenName,
			onTweet : function(plaintext, html) {
				s_control_click('events,eVar17', 'event15', 'event15,home:twitter', 'o', 'social media click');
				alert('Your tweet was submitted. Thanks!');
				tweetBoxRender();
			}
		});
	});
}

function twitterCallback(twitters) {
	var statusHTML = [];

	for (var i=0; i<twitters.length; i++){
		var username = twitters[i].user.screen_name;
		var status = twitters[i].text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g, function(url) {
			return '<a href="'+url+'" target="_blank">'+url+'</a>';
		}).replace(/\B@([_a-z0-9]+)/ig, function(reply) {
			return  reply.charAt(0)+'<a href="http://twitter.com/'+reply.substring(1)+'" target="_blank">'+reply.substring(1)+'</a>';
		});
		statusHTML.push('<li' + ((i+1)==twitters.length?' class="last"':'') + '>'+status+'</li>');
	}
	$('#twitter .tweetArea').html('<ul>' + statusHTML.join('') + '</ul>');
}
