// JavaScript Document var posX; var posY; var tmp = 0; var element; var gmap = 0; var thumb_slide_pos = 0; var thumb_slide_count = 6; var btn_thumb_left = 0; var btn_thumb_right = 0; var moving = 0; var sliding = 0; var pressnewspage = 0; var imageready = 0; var imagecnt = 0; var mousedown = 0; var nowimgno = 0; var imgno = 0; var msX = 0; var nowX = 0; var saveX = new Array(); var dragspeed = 18; var direction = 0; var amovecnt = 0; var vrmodel = ''; var vrtimer; // ------------------------------------------------------- Neo Movie St. var nm_params = { allowScriptAccess: "always" }; var nm_atts = { id: "myytplayer" }; //swfobject.embedSWF("http://www.youtube.com/v/NlNse90OreI?enablejsapi=1&playerapiid=ytplayer", "ytapiplayer", "640", "390", "8", null, null, nm_params, nm_atts); function onYouTubePlayerReady(playerId) { ytplayer = document.getElementById("myytplayer"); ytplayer.addEventListener("onStateChange", "onytplayerStateChange"); } function onytplayerStateChange(newState) { switch (newState) { // Video End. case 0: // ytplayer.clearVideo(); // ytplayer.loadVideoById('NlNse90OreI', 0, 'default'); break; // Video cued. case 5: ytplayer.mute(); ytplayer.playVideo(); setTimeout('resetNeoMovie()', 1000); break; } } function resetNeoMovie() { if (ytplayer.getCurrentTime() > 136) ytplayer.seekTo(0, true); setTimeout('resetNeoMovie()', 1000); } // ------------------------------------------------------- Neo Movie Ed. $(window).load(function(){ $("#readmore").click(); $("#preload").hide(); $("#container").show(); $(window).scroll(function(){moveFooter();}); var left_tmp = -109 ; $("#slide_product").css('left', left_tmp); // 상단 슬라이드 << 버튼 $("#thumb_right").click(function(){ if (btn_thumb_left == 1) return false; btn_thumb_left = 1; thumb_slide_pos++; if (thumb_slide_pos >= thumb_slide_count - 4) { $("#slide_product").animate({left:'-=20px'}, 250, function(){$("#slide_product").animate({left:'+=20px'}, 250, function(){btn_thumb_left = 0;})}); thumb_slide_pos--; } else { $("#slide_product").animate({left:'-=116px'}, 500, function(){ btn_thumb_left = 0; if (thumb_slide_pos+1 >= thumb_slide_count - 4) $("#thumb_right").css('visibility','hidden'); $("#thumb_left").css('visibility','visible'); }); } }); // 상단 슬라이드 >> 버튼 $("#thumb_left").click(function(){ if (btn_thumb_right == 1) return false; btn_thumb_right = 1; thumb_slide_pos--; if (thumb_slide_pos == -1) { $("#slide_product").animate({left:'+=20px'}, 250, function(){$("#slide_product").animate({left:'-=20px'}, 250, function(){btn_thumb_right=0})}); thumb_slide_pos++; } else { $("#slide_product").animate({left:'+=116px'}, 500, function(){ btn_thumb_right=0; if (thumb_slide_pos == 0) $("#thumb_left").css('visibility','hidden'); $("#thumb_right").css('visibility','visible'); }); } }); // 하단 슬라이드 > 버튼 $("#thumb_bottom_right").click(function(){ if (sliding == 1) return false; var width = $("#thumb_bottom_slide").css('width').replace('px',''); var tmpnum = width - Math.abs($("#thumb_bottom_slide").css("left").replace('px','')); sliding = 1; if (tmpnum <= 682) { $("#thumb_bottom_slide").animate({left:'-=20px'}, 250, function(){$("#thumb_bottom_slide").animate({left:'+=20px'}, 250, function(){sliding = 0;})}); } else { $("#thumb_bottom_slide").animate({left:'-=116px'}, 500, function(){ $("#thumb_bottom_left").css('visibility','visible'); sliding=0; width = $("#thumb_bottom_slide").css('width').replace('px',''); tmpnum = width - Math.abs($("#thumb_bottom_slide").css("left").replace('px','')); if (tmpnum <= 682) { $("#thumb_bottom_right").css('visibility','hidden'); } }); } }); // 하단 슬라이드 < 버튼 $("#thumb_bottom_left").click(function(){ if (sliding == 1) return false; sliding = 1; if ($("#thumb_bottom_slide").css("left") == "0px") { $("#thumb_bottom_slide").animate({left:'-=20px'}, 250, function(){$("#thumb_bottom_slide").animate({left:'+=20px'}, 250, function(){sliding = 0;})}); } else { $("#thumb_bottom_slide").animate({left:'+=116px'}, 500, function(){ $("#thumb_bottom_right").css('visibility','visible'); sliding=0; if ($("#thumb_bottom_slide").css("left") == "0px") { $("#thumb_bottom_left").css('visibility','hidden'); } }); } }); $('#thumb_a100').click(function(){ vrmodel = ''; $('#thumb_bottom_right').css('visibility','visible'); $('#thumb_bottom_left').css('visibility','visible'); var hash = window.location.hash; var pnum = ''; if ( Right(Left(hash,7),4) != 'a100' ) { window.location.hash = '#p_a100'; } else { if (String(hash).length > 7) { pnum = hash.substring(7); } else { pnum = ''; } } $('#slide_bottom_product').load('/include/thumbs.php?model=a100&key='+pnum); });$('#thumb_b100').click(function(){ vrmodel = ''; $('#thumb_bottom_right').css('visibility','visible'); $('#thumb_bottom_left').css('visibility','visible'); var hash = window.location.hash; var pnum = ''; if ( Right(Left(hash,7),4) != 'b100' ) { window.location.hash = '#p_b100'; } else { if (String(hash).length > 7) { pnum = hash.substring(7); } else { pnum = ''; } } $('#slide_bottom_product').load('/include/thumbs.php?model=b100&key='+pnum); });$('#thumb_c100').click(function(){ vrmodel = ''; $('#thumb_bottom_right').css('visibility','visible'); $('#thumb_bottom_left').css('visibility','visible'); var hash = window.location.hash; var pnum = ''; if ( Right(Left(hash,7),4) != 'c100' ) { window.location.hash = '#p_c100'; } else { if (String(hash).length > 7) { pnum = hash.substring(7); } else { pnum = ''; } } $('#slide_bottom_product').load('/include/thumbs.php?model=c100&key='+pnum); });$('#thumb_d100').click(function(){ vrmodel = ''; $('#thumb_bottom_right').css('visibility','visible'); $('#thumb_bottom_left').css('visibility','visible'); var hash = window.location.hash; var pnum = ''; if ( Right(Left(hash,7),4) != 'd100' ) { window.location.hash = '#p_d100'; } else { if (String(hash).length > 7) { pnum = hash.substring(7); } else { pnum = ''; } } $('#slide_bottom_product').load('/include/thumbs.php?model=d100&key='+pnum); });$('#thumb_h110').click(function(){ vrmodel = ''; $('#thumb_bottom_right').css('visibility','visible'); $('#thumb_bottom_left').css('visibility','visible'); var hash = window.location.hash; var pnum = ''; if ( Right(Left(hash,7),4) != 'h110' ) { window.location.hash = '#p_h110'; } else { if (String(hash).length > 7) { pnum = hash.substring(7); } else { pnum = ''; } } $('#slide_bottom_product').load('/include/thumbs.php?model=h110&key='+pnum); });$('#thumb_tbox').click(function(){ vrmodel = ''; $('#thumb_bottom_right').css('visibility','visible'); $('#thumb_bottom_left').css('visibility','visible'); var hash = window.location.hash; var pnum = ''; if ( Right(Left(hash,7),4) != 'tbox' ) { window.location.hash = '#p_tbox'; } else { if (String(hash).length > 7) { pnum = hash.substring(7); } else { pnum = ''; } } $('#slide_bottom_product').load('/include/thumbs.php?model=tbox&key='+pnum); }); $(".content").each(function(){ var id = $(this).attr('id') if (id != '') { $('#'+id+' .content_detail').hide(); $('#'+id+' .content_title').click(function(){ if (sliding == 1) return false; sliding = 1; // if (Left(window.location.hash,3) != '#p_' && id != 'lineup') window.location.hash = '#c_'+id; if (id != 'lineup') window.location.hash = '#c_'+id; if ($('#'+id+' .content_detail').css('display') == 'none') { // $(window).delay(500).scrollTo('#'+id+' .content_title', 700, {offset: {top:-40} }); $(window).delay(500).scrollTo('#'+id+' .content_title', 700); } $('#'+id+' .content_detail').delay(500).slideToggle('fast', function(){ sliding = 0; if ($('#'+id+' .content_detail').css('display') != 'none') $('#'+id+' .openbtn').attr('src','/images/subpage_close.png'); else $('#'+id+' .openbtn').attr('src','/images/subpage_open.png'); if (id == 'lineup' && $('#'+id+' .content_detail').css('display') == 'block' && $("#slide_product").css('left') != '0px') { if (Left(window.location.hash,3) == '#p_') { $("#thumb_"+Right(Left(window.location.hash,7),4)).click(); } else { $("#thumb_a100").click(); } $("#slide_product").delay(700).animate({left:'0px'}, 1000); } if (id == 'lineup' && $('#'+id+' .content_detail').css('display') == 'none') clearInterval(vrtimer); if (id == 'lineup' && $('#'+id+' .content_detail').css('display') == 'block') { if (vrmodel == 'h110' || vrmodel == 'tbox') vrtimer = setInterval('moveNext()', 60); else vrtimer = setInterval('moveNext()', 20); } if (id == 'contact') gmap_initialize(); if (id == 'company') { swfobject.embedSWF("http://www.youtube.com/v/NlNse90OreI?enablejsapi=1&playerapiid=ytplayer", "ytapiplayer", "640", "390", "8", null, null, nm_params, nm_atts); } moveFooter(); }); }); } }); $(".menu_title").each(function(){ var id = $(this).attr('id'); switch (id) { case 'mn_product': $('#'+id).click(function(){ $("#sub01").slideToggle('fast'); }); break; case 'mn_neolab': $('#'+id).click(function(){ $("#sub02").slideToggle('fast'); }); break; case 'mn_dotcode': $('#'+id).click(function(){ $("#sub03").slideToggle('fast'); }); break; } }); $("#logo").click(function(){ if (moving == 1) return false; moving = 1; $(window).scrollTo(0, 700, function(){ moving=0;window.location.hash = ''; $(".content").each(function(){ var id = $(this).attr('id'); if (id != '') $('#'+id+' .content_detail').slideUp('fast'); }); }); }); /** window hash processing **/ var whash = window.location.hash; var id = whash.replace('#c_', ''); if (id != '') { if (Left(id,3) == '#p_') { $("#lineup .content_title").click(); } else { $("#"+id+" .content_title").click(); } } /* Hover Zoom */ DD_roundies.addRule('#imgview', '10000px', true); function getRatio(x1, x2, x1pos) { return parseInt(x2 * (x1pos / x1)); } $("#dotcode_bg").mousemove(function(e){ var picX = e.pageX - ($("#dotcode_bg").position().left); var picY = e.pageY - ($("#dotcode_bg").position().top); if (picX < 25) picX = 25; if (picX > 570) picX = 570; if (picY < 35) picY = 35; if (picY > 395) picY = 395; $("#imgview").css('left',picX - 57); $("#imgview").css('top',picY - 57); posX = (getRatio(603,1206,picX)-57); posY = (getRatio(430,860,picY)-57); tmp = posX*-1+'px '+ posY *-1+'px '; $("#imgview").css("background-position", tmp); }); // VR Rotation $("#product_imagebox").mousedown(function(e){ if (vrmodel == '') return false; saveX = new Array(); mousedown = 1; msX = e.pageX; nowimgno = imgno; return false; }); $("#product_imagebox").mouseup(function(e){mousedown = 0;getSpeed();if (e.pageX == msX) direction = -1;}); $("#product_imagebox").mouseleave(function(e){mousedown = 0;}); $("#product_imagebox").mouseenter(function(e){mousedown = 0;}); // $(document).mousemove(function(e){ $("#product_imagebox").mousemove(function(e){ nowX = e.pageX; if (mousedown != 1 || imageready != 1 || vrmodel == '') return false; if (e.pageX > msX) direction = 0; else direction = 1; saveX.push(Array(nowX, (new Date()).getTime())); var tmpX; tmpX = (e.pageX - msX); imgno = nowimgno+parseInt(tmpX/5)+1; if (imgno > 180) imgno = imgno % 180; if (imgno < 1) imgno = 180+(imgno % 180); $("#product_detail_image").attr("src", "/images/vr/"+vrmodel+"/"+vrmodel+"_"+imgno+".jpg"); return false; }); }); function getYOffset() { var pageY; if(typeof(window.pageYOffset)=='number') { pageY=window.pageYOffset; } else { pageY=document.documentElement.scrollTop; } return pageY } function moveFooter() { var a=$(document).height(); var b=getYOffset(); var tmp = a + ' / ' + b; var diff = a-b; var diff2 = 1700-diff; if (diff2 > 0) { $("#footer").css("visibility", "hidden"); $("#footer_2").css("display", "block"); } else { $("#footer_2").css("display", "none"); $("#footer").css("visibility", "visible"); } } /* Google Map API */ function gmap_initialize() { if (gmap != 0) return false; gmap = 1; // NeoLAB convergence Inc. (South KOREA) var latlng = new google.maps.LatLng(37.4953674, 127.0164531); var myOptions = { zoom: 16, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); var myLatLng = new google.maps.LatLng(37.4942376, 127.0186818); var contentString = '
NeoLAB convergence Inc.
contact@neolab.kr
'; var infowindow = new google.maps.InfoWindow({ content: contentString }); var marker = new google.maps.Marker({ position: myLatLng, map: map, title:"NeoLAB convergence Inc." }); infowindow.open(map,marker); // NeoLAB Japan var latlng_jp = new google.maps.LatLng(35.697533,139.774666); var myOptions_jp = { zoom: 16, center: latlng_jp, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map_jp = new google.maps.Map(document.getElementById("map_canvas_jp"), myOptions_jp); var myLatLng_jp = new google.maps.LatLng(35.696541,139.771674); var contentString_jp = '
NeoLAB Japan
'; var infowindow_jp = new google.maps.InfoWindow({ content: contentString_jp }); var marker_jp = new google.maps.Marker({ position: myLatLng_jp, map: map_jp, title:"NeoLAB Japan" }); infowindow_jp.open(map_jp,marker_jp); } // VR Image rotation Function. function moveNext() { var model = vrmodel; if (direction == -1 || mousedown != 0 || imageready != 1 || model == '') return false; var spd = Math.abs(parseInt(dragspeed)); if (direction == 0) imgno += spd; else imgno -= spd; if (imgno > 180) imgno = imgno % 180; if (imgno < 1) imgno = 180+(imgno % 180); if (dragspeed > 1) dragspeed = dragspeed * 0.97; if (dragspeed < 1) dragspeed = 1; $("#product_detail_image").attr("src", '/images/vr/'+model+'/'+model+'_'+imgno+'.jpg'); } function getSpeed() { var tmp = new Array; var stime = 0; var etime = 0; var spos = 0; var epos = 0; var mpos; var mtime; var cnt = 0; if ((tmp = saveX.pop()) == null) return false; etime = tmp[1]; epos = tmp[0]; while ((tmp = saveX.pop()) != null) { cnt++; stime = tmp[1]; spos = tmp[0]; if (cnt == 20) break; } mpos = Math.abs(epos - spos); mtime = etime - stime; dragspeed = 50 * ((mpos/5)/mtime); } function Left(str, n){ if (n <= 0) return ""; else if (n > String(str).length) return str; else return String(str).substring(0,n); } function Right(str, n){ if (n <= 0) return ""; else if (n > String(str).length) return str; else { var iLen = String(str).length; return String(str).substring(iLen, iLen - n); } } // 2011-01-20 추가 - Submenu function submenuAction(barid) { // $(document).scrollTo(barid, 700); if (barid.find('.content_detail').css('display') == 'none') { barid.find('.content_title').click(); } else { if (sliding == 1) return false; sliding = 1; $(document).scrollTo(barid, 700, function(){sliding=0}); } }