<!--
function addLoadEvent(func) {  
//  var oldonload = window.onload;  
//  if (typeof window.onload != 'function') {  
//    window.onload = func;  
//  } else {  
//    window.onload = function() {  
//      oldonload();  
//      func();  
//    }  
//  }
	if (navigator.appName.indexOf("Microsoft") != -1) {
		$(window).load(function() {
			eval(func);
		});
	} else {
		window.addEventListener('load', function() {
			eval(func);
		}, false); 
	}
}  

//플래시 호출
function thisMovie(movieName) {
	return document[movieName];
}

/*=====================================================================================
' namespace : CF                                      
' 기     능 : 도요타 TV CF 갤러리 정의 함수 
'-------------------- 변경이력 --------------------------------------------------------
'    작 성 자        소  속         작 성 일               비   고              
'------------------------------------------------------------------------------------
'  1. CVS           CVS           2011.11.01       최초 작성                       
'======================================================================================*/
CF = {
	
	Load: function(swf) {
		if (navigator.appName.indexOf("Microsoft") != -1) {
			CF.Change($("#CF_Tab_ALL li:eq(0) a"), swf);
		} else {
			setTimeout("CF.Change($('#CF_Tab_ALL li:eq(0) a'), '" + swf + "')", 500);
		}
		
	},
	
	Tab: function(ts, id) {
	
		$(".vod_tab").find("img").each(function() {
			$(this).attr("src", $(this).attr("src").replace(/_on/g, "_off"));
		});

		$(ts).children("img").attr("src", $(ts).children("img").attr("src").replace(/_off/g, "_on"));
		$(".vod_list").hide();
		$("#"+id).show();

	},

	Change: function(ts, swf) {

		thisMovie("swfPlayer").mvCall(swf+'.flv');
		var tit = $(ts).children("div").children("h5").html()
		$(".vod_board h4").html(tit).children("span").remove();
		$(".vod_view .btn_area a").attr("href", '/swf/'+ swf + '.flv').attr("target", "_blank");
		$(ts).parent().parent().children("li").children("a").removeClass("on");
		$(ts).addClass("on");
		return url = swf;
	}
},

/*=====================================================================================
' namespace : PA                                      
' 기     능 : 도요타 인쇄광고 갤러리 정의 함수 
'-------------------- 변경이력 --------------------------------------------------------
'    작 성 자        소  속         작 성 일               비   고              
'------------------------------------------------------------------------------------
'  1. CVS           CVS           2011.11.01       최초 작성                       
'======================================================================================*/
PA = {

	//썸네일 클릭
	//ts:this, n1 : 타이틀, n2:날짜, n3:큰이미지, n4:다운로드
	Change: function(ts, n1, n2, n3, n4) {
		$("#model01").html(n1);
		$("#date01").html(n2);
		$("#print_big img").attr("src", n3);
		$(".img_board .btn01 a").eq(0).attr("href", n4).attr("target", "_blank");
		$(".print_list ul li").removeClass("on");
		$(ts).parent().addClass("on");
	}
}

PA2 = {

	//썸네일 클릭
	//ts:this, n1 : 타이틀, n2:날짜, n3:copyright, n4:큰이미지, n5:다운로드
	Change: function(ts, n1, n2, n3, n4, n5) {
		$("#model01").html(n1);
		$("#date01").html(n2);
		$("#copyright01").html(n3);
		$("#print_big img").attr("src", n4);
		$(".img_board .btn01 a").eq(0).attr("href", n5).attr("target", "_blank");
		$(".print_list ul li").removeClass("on");
		$(ts).parent().addClass("on");
	}
}



/*=====================================================================================
' namespace : WP                                      
' 기     능 : 도요타 웰페이퍼 갤러리 정의 함수 
'-------------------- 변경이력 --------------------------------------------------------
'    작 성 자        소  속         작 성 일               비   고              
'------------------------------------------------------------------------------------
'  1. CVS           CVS           2011.11.01       최초 작성                       
'======================================================================================*/
WP = {
	
	//썸네일 클릭
	//ts:this, n1 : 타이틀, n2:날짜, n3:큰이미지, n4:다운로드(800.이미지), n5:다운로드(1024.이미지):, n6:다운로드(1280.이미지):
	Change: function(ts, n1, n2, n3, n4, n5, n6) {
		$("#model01").html(n1);
		$("#date01").html(n2);
		$("#paper_big img").attr("src", n3);
		$(".img_board .btn01 a").eq(0).attr("href", n4).attr("target", "_blank");
		$(".img_board .btn01 a").eq(1).attr("href", n5).attr("target", "_blank");
		$(".img_board .btn01 a").eq(2).attr("href", n6).attr("target", "_blank");
		$(".paper_list ul li").removeClass("on");
		$(ts).parent().addClass("on");
	}
}

/*=====================================================================================
' namespace : SV                                      
' 기     능 : 도요타 스크린세이버 갤러리 정의 함수 
'-------------------- 변경이력 --------------------------------------------------------
'    작 성 자        소  속         작 성 일               비   고              
'------------------------------------------------------------------------------------
'  1. CVS           CVS           2011.11.01       최초 작성                       
'======================================================================================*/
SV = {
	
	Tab: function(ts, id) {
		$(".screen_tab").find("img").each(function() {
			$(this).attr("src", $(this).attr("src").replace(/_on/g, "_off"));
		});

		$(ts).children("img").attr("src", $(ts).children("img").attr("src").replace(/_off/g, "_on"));
		$(".screen_list").hide();
		$("#"+id).show();
	},
	

	//썸네일 클릭
	//ts:this, n1 : 타이틀, n2:날짜, n3:큰이미지, n4:다운로드
	Change: function(ts, n1, n2, n3, n4) {
		$("#model01").html(n1);
		$("#date01").html(n2);
		$("#screen_big img").attr("src", n3);
		if (n1 == "CAMRY") {
			//alert("준비 중입니다.")
			$(".img_board .btn01 a").eq(0).attr("href", "javascript:alert('준비 중입니다.')");
		}
		else {
			$(".img_board .btn01 a").eq(0).attr("href", n4).attr("target", "_blank");
		}
		
		$(".screen_list li").removeClass("on");
		$(ts).parent().addClass("on");
	}
}

/*=====================================================================================
' namespace : AD                                      
' 기     능 : 도요타 홍보영상 갤러리 정의 함수 
'-------------------- 변경이력 --------------------------------------------------------
'    작 성 자        소  속         작 성 일               비   고              
'------------------------------------------------------------------------------------
'  1. CVS           CVS           2011.11.01       최초 작성                       
'======================================================================================*/
AD = {

	Load: function(swf) {
		if (navigator.appName.indexOf("Safari") != -1) {
			AD.Change($("#AD_Tab_ALL li:eq(0) a"), swf);
		} else {
			setTimeout("AD.Change($('#AD_Tab_ALL li:eq(0) a'), '" + swf + "')", 500);
		}
	},
	
	Tab: function(ts, id) {
	
		$(".vod_tab").find("img").each(function() {
			$(this).attr("src", $(this).attr("src").replace(/_on/g, "_off"));
		});

		$(ts).children("img").attr("src", $(ts).children("img").attr("src").replace(/_off/g, "_on"));
		$(".vod_list").hide();
		$("#"+id).show();

	},

	Change: function(ts, swf) {
		thisMovie("swfPlayer").mvCall(swf+'.flv');
		/*var tit = $(ts).children("div").children("h5").filter(function() {
			return $(this).children("span").remove();
		}).html();*/
		var tit = $(ts).children("div").children("h5").html()
		
		//$(".vod_board h4").html(tit);
		$(".vod_board h4").html(tit).children("span").remove();
		
		$(".vod_view .btn_area a").attr("href", '/swf/'+ swf + '.flv').attr("target", "_blank");
		$(ts).parent().parent().children("li").children("a").removeClass("on");
		$(ts).addClass("on");
		return url = swf;
	}
},

/*=====================================================================================
' namespace : HSD                                      
' 기     능 : 도요타 HSD 영상 정의 함수 
'-------------------- 변경이력 --------------------------------------------------------
'    작 성 자        소  속         작 성 일               비   고              
'------------------------------------------------------------------------------------
'  1. CVS           CVS           2011.12.15       최초 작성                       
'======================================================================================*/
HSD = {

	Load: function(swf) {
		if (navigator.appName.indexOf("Safari") != -1) {
			HSD.Change($("#HSD_Tab_ALL li:eq(0) a"), swf);
		} else {
			setTimeout("HSD.Change($('#HSD_Tab_ALL li:eq(0) a'), '" + swf + "')", 500);
		}
	},

	Change: function(ts, swf) {
		thisMovie("swfPlayer").mvCall(swf+'.flv');
		var tit = $(ts).children("div").children("h5").html()
		
		$(".vod_board h4").html(tit).children("span").remove();
		
		$(".vod_view .btn_area a").attr("href", '/swf/'+ swf + '.flv').attr("target", "_blank");
		$(ts).parent().parent().children("li").children("a").removeClass("on");
		$(ts).addClass("on");
		return url = swf;
	}
},

/*=====================================================================================
' namespace : ST                                      
' 기     능 : 도요타 Smile for Tomorrow 정의 함수 
'-------------------- 변경이력 --------------------------------------------------------
'    작 성 자        소  속         작 성 일               비   고              
'------------------------------------------------------------------------------------
'  1. CVS           CVS           2011.11.01       최초 작성                       
'======================================================================================*/
ST = {
	
	//썸네일 클릭
	//ts:this, n1 : 큰이미지
	Change: function(ts, n1) {
		$(".img01 img").attr("src", n1);
		//$(".tab_smile ul li").removeClass("on");
		//$(ts).parent().addClass("on");
		$(".tab_smile").find("img").each(function() {
			$(this).attr("src", $(this).attr("src").replace(/_on/g, "_off"));
		});

		$(ts).children("img").attr("src", $(ts).children("img").attr("src").replace(/_off/g, "_on"));

	}
}



//플래시 생성
function flashWrite(url,w,h,vars,bg,win){
	
	var id=url.split("/")[url.split("/").length-1].split(".")[0]; //id는 파일명으로 설정
	if(vars==null) vars='';
	if(bg==null) bg='#FFFFFF';
	if(win==null) win='transparent';

	// 플래시 코드 정의
	var flashStr= "	<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'";
		flashStr+="		codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,0'";
		flashStr+="		width='"+w+"'";
		flashStr+="		height='"+h+"'";
		flashStr+="		id='"+id+"'";
		flashStr+="		align='middle'>";

		flashStr+="		<param name='allowScriptAccess' value='always' />";
		flashStr+="		<param name='movie' value='"+url+"' />";
		flashStr+="		<param name='FlashVars' value='"+vars+"' />";
		flashStr+="		<param name='wmode' value='"+win+"' />";
		flashStr+="		<param name='menu' value='false' />";
		flashStr+="		<param name='quality' value='high' />";
		flashStr+="		<param name='bgcolor' value='"+bg+"' />";
	
		flashStr+="		<embed src='"+url+"'";
		flashStr+="		       flashVars='"+vars+"'";
		flashStr+="		       wmode='"+win+"'";
		flashStr+="		       menu='false'";
		flashStr+="		       quality='high'";
		flashStr+="		       bgcolor='"+bg+"'";
		flashStr+="		       width='"+w+"'";
		flashStr+="		       height='"+h+"'";
		flashStr+="		       name='"+id+"'";
		flashStr+="		       align='middle'";
		flashStr+="		       allowScriptAccess='always'";
		flashStr+="		       type='application/x-shockwave-flash'";
		flashStr+="		       pluginspage='http://www.macromedia.com/go/getflashplayer' />";
		flashStr+=" </object>";

	// 플래시 코드 출력
	document.write(flashStr);

}
//-->
