
/***********************************
SUB MENU

서브메뉴
***********************************/

 function view() {
textFade.style.display="";
textFade1.style.display="none";
textFade2.style.display="none";
textFade3.style.display="none";
}
 function view2() {
textFade2.style.display="";
textFade.style.display="none";
textFade1.style.display="none";
textFade3.style.display="none";
}

 function view3() {
textFade3.style.display="";
textFade.style.display="none";
textFade1.style.display="none";
textFade2.style.display="none";
}

function view1() {
textFade1.style.display="";
textFade.style.display="none";
textFade2.style.display="none";
textFade3.style.display="none";
//textFade1.style.visibility = "visible"
}
function closed() {
textFade.style.display = 'none';}
function closed1() {
textFade1.style.display = 'none';}
function closed2() {
textFade2.style.display = 'none';}
function closed3() {
textFade3.style.display = 'none';}

/***********************************
ASK a Question, Free.

상담 새창
***********************************/

function new_ask() { 
window.open('ask.asp','','location=no, directories=no,resizable=no,status=no,toolbar=no,menubar=no, width=670,height=432,left=0, top=0, scrollbars=yes'); } 


function new_letter() { 
window.open('letter.asp','','location=no, directories=no,resizable=no,status=no,toolbar=no,menubar=no, width=650,height=300,left=0, top=0, scrollbars=no'); } 

/***********************************
Site Change

베트남어/영어
***********************************/

 function schange(site) {
  if(site == '2') url = "http://www.kornova.com/kornova_t/index.asp";
  if(site == '1') url = "http://www.kornova-viet.com";
  location.href = url;
 }

 /***********************************
Main  Image Change

메인 이미지 효과
***********************************/

 var _dropinslideshowcount=0

function dropinslideshow(imgarray, w, h, delay){
    this.id="_dropslide"+(++_dropinslideshowcount) //Generate unique ID for this slideshow instance (automated)
    this.createcontainer(parseInt(w), parseInt(h))
    this.delay=delay
    this.imgarray=imgarray
    var preloadimages=[]
    for (var i=0; i<imgarray.length; i++){
        preloadimages[i]=new Image()
        preloadimages[i].src=imgarray[i][0]
    }
    this.animatestartpos=parseInt(h)*(-1) //Starting "top" position of an image before it drops in
    this.slidedegree=10 //Slide degree (> is faster)
    this.slidedelay=30 //Delay between slide animation (< is faster)
    this.activecanvasindex=0 //Current "active" canvas- Two canvas DIVs in total
    this.curimageindex=0
    this.zindex=100
    this.isMouseover=0
    this.init()
}


dropinslideshow.prototype.createcontainer=function(w, h){
document.write('<div id="'+this.id+'" style="position:relative; width:'+w+'px; height:'+h+'px; overflow:hidden">')
    document.write('<div style="position:absolute; width:'+w+'px; height:'+h+'px; top:0;"></div>')
    document.write('<div style="position:absolute; width:'+w+'px; height:'+h+'px; top:-'+h+'px;"></div>')
    document.write('</div>')
    this.slideshowref=document.getElementById(this.id)
    this.canvases=[]
    this.canvases[0]=this.slideshowref.childNodes[0]
    this.canvases[1]=this.slideshowref.childNodes[1]
}

dropinslideshow.prototype.populatecanvas=function(canvas, imageindex){
    var imageHTML='<img src="'+this.imgarray[imageindex][0]+'" style="border: 0" />'
    if (this.imgarray[imageindex][1]!="")
        imageHTML='<a href="'+this.imgarray[imageindex][1]+'" target="'+this.imgarray[imageindex][2]+'">'+imageHTML+'</a>'
    canvas.innerHTML=imageHTML
}


dropinslideshow.prototype.animateslide=function(){
    if (this.curimagepos<0){ //if image hasn't fully dropped in yet
        this.curimagepos=this.curimagepos+this.slidedegree
        this.activecanvas.style.top=this.curimagepos+"px"
    }
    else{
        clearInterval(this.animatetimer)
        this.activecanvas.style.top=0
        this.setupnextslide()
        var slideshow=this
        setTimeout(function(){slideshow.rotateslide()}, this.delay)
    }
}


dropinslideshow.prototype.setupnextslide=function(){
    this.activecanvasindex=(this.activecanvasindex==0)? 1 : 0
    this.activecanvas=this.canvases[this.activecanvasindex]
    this.activecanvas.style.top=this.animatestartpos+"px"
    this.curimagepos=this.animatestartpos
    this.activecanvas.style.zIndex=(++this.zindex)
    this.curimageindex=(this.curimageindex<this.imgarray.length-1)? this.curimageindex+1 : 0
    this.populatecanvas(this.activecanvas, this.curimageindex)
}

dropinslideshow.prototype.rotateslide=function(){
    var slideshow=this
    if (this.isMouseover)
        setTimeout(function(){slideshow.rotateslide()}, 50)
    else
        this.animatetimer=setInterval(function(){slideshow.animateslide()}, this.slidedelay)
}

dropinslideshow.prototype.init=function(){
    var slideshow=this
    this.populatecanvas(this.canvases[this.activecanvasindex], 0)
    this.setupnextslide()
    this.slideshowref.onmouseover=function(){slideshow.isMouseover=1}
    this.slideshowref.onmouseout=function(){slideshow.isMouseover=0}
    setTimeout(function(){slideshow.rotateslide()}, this.delay)
}

 /***********************************
Quick Menu

***********************************/

var stmnLEFT = 0; // 왼쪽 여백 (메뉴가 왼쪽에서 10픽셀 떨어진 곳에 보여집니다) 
var stmnGAP1 = 0; // 위쪽 여백 (메뉴가 위에서 10픽셀 떨어진 곳에 보여집니다) 
var stmnGAP2 = 0; // 스크롤시 브라우저 위쪽과 떨어지는 거리 
var stmnBASE = 0; // 스크롤 시작위치 
var stmnActivateSpeed = 200; 
var stmnScrollSpeed = 10; 

var stmnTimer; 

function ReadCookie(name) 
{ 
var label = name + "="; 
var labelLen = label.length; 
var cLen = document.cookie.length; 
var i = 0; 

while (i < cLen) { 
                var j = i + labelLen; 

                if (document.cookie.substring(i, j) == label) { 
                                var cEnd = document.cookie.indexOf(";", j); 
                                if (cEnd == -1) cEnd = document.cookie.length; 

                                return unescape(document.cookie.substring(j, cEnd)); 
                } 

                i++; 
} 

return ""; 
} 

function SaveCookie(name, value, expire) 
{ 
var eDate = new Date(); 
eDate.setDate(eDate.getDate() + expire); 
document.cookie = name + "=" + value + "; expires=" +  eDate.toGMTString()+ "; path=/"; 
} 

function RefreshStaticMenu() 
{ 
var stmnStartPoint, stmnEndPoint, stmnRefreshTimer; 

stmnStartPoint = parseInt(document.getElementById("STATICMENU").style.top, 10); 
stmnEndPoint = document.body.scrollTop + stmnGAP2; 
if (stmnEndPoint < stmnGAP1) stmnEndPoint = stmnGAP1; 

stmnRefreshTimer = stmnActivateSpeed; 

if ( stmnStartPoint != stmnEndPoint ) { 
                stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 15 ); 
                document.getElementById("STATICMENU").style.top = parseInt(document.getElementById("STATICMENU").style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount ); 
                stmnRefreshTimer = stmnScrollSpeed; 
} 

stmnTimer = setTimeout ("RefreshStaticMenu();", stmnRefreshTimer); 
} 

function ToggleAnimate() 
{ 
if (ANIMATE.checked) { 
                RefreshStaticMenu(); 
                SaveCookie("ANIMATE", "true", 300); 
} 
else { 
                clearTimeout(stmnTimer); 
                document.getElementById("STATICMENU").style.top = stmnGAP1 + "px"; 
                SaveCookie("ANIMATE", "false", 300); 
} 
} 

function InitializeStaticMenu() 
{ 
STATICMENU.style.left = stmnLEFT; 

         if (ReadCookie("ANIMATE") == "false") { 
                ANIMATE.checked = false; 
                document.getElementById("STATICMENU").style.top = document.body.scrollTop + stmnGAP1 + "px"; 
} 
else { 
                ANIMATE.checked = true; 
                document.getElementById("STATICMENU").style.top = document.body.scrollTop + stmnBASE + "px"; 
                RefreshStaticMenu(); 
} 
} 



 /***********************************
IFRAME 높이 자동조절

***********************************/

function calcHeight(FrameName) 
{ 
  
  var the_height= document.getElementById(FrameName).contentWindow.document.body.scrollHeight; 
document.getElementById(FrameName).height=the_height; 
} 


 /***********************************
New Window 1

***********************************/

function vex() { 
window.open('vkornova_pop.html','','location=no, directories=no,resizable=no,status=no,toolbar=no,menubar=no, width=600,height=610,left=0, top=0, scrollbars=yes'); } 

function vex1() { 
window.open('vex_a.asp','','location=no, directories=no,resizable=no,status=no,toolbar=no,menubar=no, width=600,height=610,left=0, top=0, scrollbars=yes'); } 

function vex2() { 
window.open('vex_b.asp','','location=no, directories=no,resizable=no,status=no,toolbar=no,menubar=no, width=600,height=610,left=0, top=0, scrollbars=yes'); } 

function vex2() { 
window.open('vex_b.asp','','location=no, directories=no,resizable=no,status=no,toolbar=no,menubar=no, width=600,height=610,left=0, top=0, scrollbars=yes'); } 

function s_feb() { 
window.open('s_feb.html','','location=no, directories=no,resizable=no,status=no,toolbar=no,menubar=no, width=532,height=680,left=0, top=0, scrollbars=yes'); } 

function s_feb1() { 
window.open('s_feb1.html','','location=no, directories=no,resizable=no,status=no,toolbar=no,menubar=no, width=517,height=700,left=540, top=0, scrollbars=yes'); } 

function s_apr1() { 
window.open('s_Apr1.html','','location=no, directories=no,resizable=no,status=no,toolbar=no,menubar=no, width=517,height=700,left=0, top=0, scrollbars=yes'); } 

function b1() { 
window.open('http://www.cic.gc.ca/english/immigrate/skilled/apply-who-instructions.asp#list','','location=yes, directories=yes,resizable=yes,status=yes,toolbar=yes,menubar=yes, width=600,height=600,left=0, top=0, scrollbars=yes'); } 

function b2() { 
window.open('http://www5.hrsdc.gc.ca/NOC/English/NOC/2006/Welcome.aspx ','','location=yes, directories=yes,resizable=yes,status=yes,toolbar=yes,menubar=yes, width=600,height=600,left=0, top=0, scrollbars=yes'); } 


//Webcam
function nbweb() { 
window.open('kornova_Immigration_canada_a1w.asp','','location=no, directories=no,resizable=no,status=no,toolbar=no,menubar=no, width=570,height=650,left=0, top=0, scrollbars=yes'); } 




 /***********************************
NB, MA, SK 홈페이지 내용 게시판 최신글 3개

***********************************/

var enablepersist="on" //쿠키사용 on 미사용 off
var collapseprevious="yes" //yes : 하나 확장되면 다른건 확장 안됨, no : 전체 다 확장할 수 있슴..

var contractsymbol='- ' //확장시 기호 (이미지 대체 가능)
var expandsymbol='+ ' //미확장시 기호 (이미지 대체 가능)


if (document.getElementById){
    document.write('<style type="text/css">')
    document.write('.switchcontent{display:none;padding-left:12px;}')
    document.write('</style>')
}

function getElementbyClass(rootobj, classname){
    var temparray=new Array()
    var inc=0
    for (i=0; i<rootobj.length; i++){
    if (rootobj[i].className==classname)
        temparray[inc++]=rootobj[i]
    }
    return temparray
}


function contractcontent(omit){
    var inc=0
    while (ccollect[inc]){
    if (ccollect[inc].id!=omit)
        ccollect[inc].style.display="none"
        inc++
    }
}

function expandcontent(curobj, cid){
    var spantags=curobj.getElementsByTagName("SPAN")
    var showstateobj=getElementbyClass(spantags, "showstate")
    if (ccollect.length>0){
    if (collapseprevious=="yes")
        contractcontent(cid)
        document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
    if (showstateobj.length>0){ //if "showstate" span exists in header
    if (collapseprevious=="no")
        showstateobj[0].innerHTML=(document.getElementById(cid).style.display=="block")? contractsymbol : expandsymbol
    else
        revivestatus()
        }
    }
}

function revivecontent(){
    contractcontent("omitnothing")
    selectedItem=getselectedItem()
    selectedComponents=selectedItem.split("|")
    for (i=0; i<selectedComponents.length-1; i++)
        document.getElementById(selectedComponents[i]).style.display="block"
}

function revivestatus(){
    var inc=0
    while (statecollect[inc]){
    if (ccollect[inc].style.display=="block")
        statecollect[inc].innerHTML=contractsymbol
    else
        statecollect[inc].innerHTML=expandsymbol
        inc++
    }
}

function get_cookie(Name) { 
    var search = Name + "="
    var returnvalue = "";
    if (document.cookie.length > 0) {
        offset = document.cookie.indexOf(search)
    if (offset != -1) { 
        offset += search.length
        end = document.cookie.indexOf(";", offset);
    if (end == -1) end = document.cookie.length;
        returnvalue=unescape(document.cookie.substring(offset, end))
        }
    }
    return returnvalue;
}

function getselectedItem(){
    if (get_cookie(window.location.pathname) != ""){
        selectedItem=get_cookie(window.location.pathname)
    return selectedItem
    }
    else
    return ""
}

function saveswitchstate(){
    var inc=0, selectedItem=""
    while (ccollect[inc]){
    if (ccollect[inc].style.display=="block")
        selectedItem+=ccollect[inc].id+"|"
        inc++
    }
document.cookie=window.location.pathname+"="+selectedItem
}

function do_onload(){
    uniqueidn=window.location.pathname+"firsttimeload"
    var alltags=document.all? document.all : document.getElementsByTagName("*")
        ccollect=getElementbyClass(alltags, "switchcontent")
        statecollect=getElementbyClass(alltags, "showstate")
    if (enablepersist=="on" && ccollect.length>0){
        document.cookie=(get_cookie(uniqueidn)=="")? uniqueidn+"=1" : uniqueidn+"=0" 
        firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load
    if (!firsttimeload)
        revivecontent()
    }
    if (ccollect.length>0 && statecollect.length>0)
        revivestatus()
    }

    if (window.addEventListener)
        window.addEventListener("load", do_onload, false)
    else if (window.attachEvent)
        window.attachEvent("onload", do_onload)
    else if (document.getElementById)
        window.onload=do_onload

    if (enablepersist=="on" && document.getElementById)
        window.onunload=saveswitchstate


 /***********************************
Add another Job 

***********************************/


function addToPIC()
{
 nameToDiv.insertAdjacentHTML("BeforeEnd", "<li>Nghề Nghiệp : <input type='text' name='occupation' size='55' class='box2'></li>");
 nameToDiv.insertAdjacentHTML("BeforeEnd", "<li>Thời Gian :&nbsp;&nbsp;&nbsp;<input type='text' name='duration' size='23' class='box2'><input type='radio' name='fp_time' value='f' style='border: 0px solid #CE659C;' checked> Toàn thời gian&nbsp;&nbsp;&nbsp;<input type='radio' name='fp_time' value='p' style='border: 0px solid #CE659C;'> Bán thời gian</li>");
 nameToDiv.insertAdjacentHTML("BeforeEnd", "<li>Địa Điểm : <input type='text' name='vlocation' size='72' class='box2'></li><hr>");
}

 /***********************************
Login  Form

***********************************/


function idpw_c()
{	var wid_c=document.form.wid.value;
    var wpw_c=document.form.wpw.value;
	
	if(wid_c==""){ 
			alert('Check ID!');
			return false;
	}
	else if(wpw_c==""){ 
			alert('Check Password!');
			return false;
	}
	else{return true;}
}

function idpw_c1()
{	var wid_c=document.form2.wid1.value;
    var wpw_c=document.form2.wpw1.value;
	
	if(wid_c==""){ 
			alert('Check ID!');
			return false;
	}
	else if(wpw_c==""){ 
			alert('Check Password!');
			return false;
	}
	else{return true;}
}

function wemail_c()
{	
    var wemail_c=document.form.wemail.value;
	  if(document.form.wemail.value==0) {
	   alert('Insert E-mail Address!');
	   document.form.wemail.focus(); 
            return; 
	  }
	  
	else{
location.replace('wemail_check.asp?wemail='+wemail_c+'')
	}
}



  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-20230348-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();


