window.name = "Bux_home";

function buxMenu(type) {
	
	var URL;
	
	switch(type){
	
	// ¸ÞÀÎ¸Þ´º
	case "M0" : URL = "/home/"; break;
	case "M1" : URL = "/movie_korea/main.asp"; break;
	case "M2" : URL = "/movie_foreign/main.asp"; break;
	case "M3" : URL = "/series/index.asp"; break;
	case "M4" : URL = "/movie_heroism/index.asp?tgb=MU"; break;
	case "M5" : URL = "/adult/"; break;
	case "M6" : URL = "/cinezine/index.asp"; break;
	case "M7" : URL = "/movie_free/movie_index.asp?tgb=NO"; break;
	case "M8" : URL = "/my/modify.asp"; break;
	case "M9" : URL = "/my/join.asp"; break;
	case "M10" : URL = "/down/main.asp"; break;
	
	// ¼­ºê¸Þ´º(È¸¿ø°¡ÀÔ)
	case "M0S1" : URL = "/mybux/login.php"; break;
	case "M0S2" : URL = "/mybux/join.php"; break;
	case "M0S3" : URL = "/mybux/agreement.php"; break;
	case "M0S4" : URL = "/mybux/private.php"; break;
	
	// ¼­ºê¸Þ´º(ÇÑ±¹¿µÈ­)
	case "M1S1" : URL = "/movie/korea_list.php"; break;
	case "M1S2" : URL = "/movie/korea_list.php?genre=drama"; break;
	case "M1S3" : URL = "/movie/korea_list.php?genre=comedy"; break;
	case "M1S4" : URL = "/movie/korea_list.php?genre=action|sf"; break;
	case "M1S5" : URL = "/movie/korea_list.php?genre=thriller|horror"; break;
	
	// ¼­ºê¸Þ´º(¿Ü±¹¿µÈ­)
	case "M2S1" : URL = "/movie/foreign_list.php"; break;
	case "M2S2" : URL = "/movie/foreign_list.php?genre=drama"; break;
	case "M2S3" : URL = "/movie/foreign_list.php?genre=action|sf"; break;
	case "M2S4" : URL = "/movie/foreign_list.php?genre=thriller|horror"; break;
	case "M2S5" : URL = "/movie/foreign_list.php?genre=comedy"; break;
	case "M2S6" : URL = "/heroism/"; break;
	
	// ¼­ºê¸Þ´º(¹«·á¿µÈ­)
	case "M3S1" : URL = "/movie/free.php"; break;
	case "M3S2" : URL = "/movie/free_yoga.php"; break;
	case "M3S3" : URL = "/movie/free_dog.php"; break;
	case "M3S4" : URL = "/movie/free_bast.php"; break;
	
	// ¼­ºê¸Þ´º(¾Ö´Ï¸¸È­)
	case "M4S1" : URL = "/movie/ani_cartoon_list.php"; break;
	case "M4S2" : URL = "/movie/ani_cartoon_list.php?class=adult_animation"; break;
	case "M4S3" : URL = "/movie/ani_cartoon_list.php?class=adult_cartoon"; break;
	
	// ¼­ºê¸Þ´º(¹÷½º½Ã³×Áø)
	case "M5S1" : URL = "/buxzine/cinema_news.php"; break;
	case "M5S2" : URL = "/buxzine/theater_movie.php"; break;
	case "M5S3" : URL = "/buxzine/making_film.php"; break;
	case "M5S4" : URL = "/buxzine/movie_ost.php"; break;
	case "M5S5" : URL = "/buxzine/movie_review.php"; break;
	
	// ¼­ºê¸Þ´º(¸¶ÀÌ¹÷½º)
	case "M9S1" : URL = "/mybux/my_account.php"; break;
	case "M9S2" : URL = "/mybux/my_movie.php"; break;
	case "M9S3" : URL = "/mybux/my_modify.php"; break;
	case "M9S4" : URL = "/mybux/my_unjoin.php"; break;
	case "M9S5" : URL = "/mybux/account.php"; break;

	// ¼­ºê¸Þ´º(ÀÌ¿ë¾È³»)
	case "M10S1" : URL = "/information/information.php"; break;
	case "M10S2" : URL = "/information/faq.php"; break;
	case "M10S3" : URL = "/information/ad.php"; break;
	case "M10S4" : URL = ""; break;
	case "M10S5" : URL = "/information/question.php"; break;
	
	// ¼­ºê¸Þ´º(¹«·á¸¸È­)
	case "M11S1" : URL = "/movie/free_cartoon.php"; break;
	case "M11S2" : URL = "/movie/free_cartoon.php?genre=normal"; break;
	case "M11S3" : URL = "/movie/free_cartoon.php?genre=adult"; break;
	
	// ¼­ºê¸Þ´º(ÇÑ±¹Æ¯¼±¿µÈ­)
	case "M12S1" : URL = "/movie/korea2_list.php"; break;
	case "M12S2" : URL = "/movie/korea2_list.php?genre=drama"; break;
	case "M12S3" : URL = "/movie/korea2_list.php?genre=comedy"; break;
	case "M12S4" : URL = "/movie/korea2_list.php?genre=action|sf|thriller|horror"; break;
	
	// ¼ºÀÎ¸Þ´º
	case "A0" : URL = "/adult/"; break;
	case "A1" : URL = "/adult/adulttv_list.php"; break;
	case "A2" : URL = "/adult/adultav_list.php?class=koreanew"; break;
	case "A3" : URL = "/adult/adultav_list.php?class=japan"; break;
	case "A4" : URL = "/adult/adultvideo_list.php"; break;
	case "A5" : URL = "/adult/adultero_list.php?class=yadong"; break;
	case "A6" : URL = "/adult/adultero_list.php?class=realamature"; break;
	case "A7" : URL = "/adult/adultero_list.php?class=erotv"; break;
	case "A8" : URL = "/adult/adultav_list.php?class=western"; break;
	case "A9" : URL = "/adult_drama/"; break;
	case "A10" : URL = "/adult/adultav_list.php?class=catchon"; break;
	
	}
	
	document.location.href = URL;
	
}

function checkSearch(form) {

      if(!form.sc.value) { alert('ÁË¼ÛÇÕ´Ï´Ù. °Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼Å¾ß µË´Ï´Ù.'); form.sc.focus(); return false; }
      return true;
      
}

function checkLogin(form) {
 
      if (!form.lg_id.value) { alert('ÁË¼ÛÇÕ´Ï´Ù. ¾ÆÀÌµð´Â ÇÊ¼öÇ×¸ñÀÌ¹Ç·Î ¹Ýµå½Ã ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.'); form.lg_id.focus(); return false; }
      if (!form.lg_pw.value) { alert('ÁË¼ÛÇÕ´Ï´Ù. ºñ¹Ð¹øÈ£´Â ÇÊ¼öÇ×¸ñÀÌ¹Ç·Î ¹Ýµå½Ã ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.'); form.lg_pw.focus(); return false; }
      if (form.secu.value == 1) form.action = 'https://www.buxmovie.com/login.php';
      else form.action = '/login.php';
      form.submit();
      return true;
      
}

function viewMovie(type, stream, no) {

	if(stream == "D"){
		var move_url = "/movie/view_dvd.php?type=" + type + "&stream=" + stream + "&no=" + no;
		var str_width = 822;
		var str_height = 588;
	}else{
		var move_url = "/movie/view_movie.php?type=" + type + "&stream=" + stream + "&no=" + no;
		var str_width = 960;
		var str_height = 560;
		if(stream == "N"){
			str_width = 541;
			str_height = 338;
		}
	}
	Bux_player = window.open(move_url,"Bux_player" ,"left=0, top=0,width=" + str_width + ",height=" + str_height + ",scrollbars=0,toolbar=0,status=1,resizable=1,menubar=0");
	
}

function viewSample(stream) {
	
	if(stream == "D"){
		var move_url = "/movie/sample_dvd.php";
		var str_width = 822;
		var str_height = 650;
		Bux_player = window.open(move_url,"Bux_player" ,"left=0, top=0,width=" + str_width + ",height=" + str_height + ",scrollbars=0,toolbar=0,status=1,resizable=1,menubar=0");
	}
	
}


function viewdvd() {
		var move_url = "/movie/dvd_popup.php";
		var str_width = 614;
		var str_height = 330;
		Bux_player = window.open(move_url,"Bux_dvd" ,"left=0, top=0,width=" + str_width + ",height=" + str_height + ",scrollbars=0,toolbar=0,status=1,resizable=1,menubar=0");	
}


function viewMovieP(type, stream, no) {

	var move_url = "/movie/view_movie_preview.php?type=" + type + "&stream=" + stream + "&no=" + no;
	var str_width = 960;
	var str_height = 560;
	if(stream == "N"){
		str_width -= 419;
		str_height -= 222;
	}
	Bux_player = window.open(move_url,"Bux_player" ,"left=0, top=0,width=" + str_width + ",height=" + str_height + ",scrollbars=0,toolbar=0,status=1,resizable=1,menubar=0");
	
}

function viewMovieB(type, stream, no, best_no) {

	var move_url = "/movie/view_movie_bestcut.php?type=" + type + "&stream=" + stream + "&no=" + no + "&bestcut=" + best_no;
	var str_width = 960;
	var str_height = 560;
	if(stream == "N"){
		str_width -= 419;
		str_height -= 222;
	}
	Bux_player = window.open(move_url,"Bux_player" ,"left=0, top=0,width=" + str_width + ",height=" + str_height + ",scrollbars=0,toolbar=0,status=1,resizable=1,menubar=0");
	
}

function viewMovieC(type, no) {

	var move_url = "/buxzine/view_movie.php?type=" + type + "&no=" + no;
	Bux_player = window.open(move_url,"Bux_playerC" ,"left=0, top=0,width=640,height=480,scrollbars=0,toolbar=0,status=1,resizable=1,menubar=0");
	
}

function viewMovieE(type, stream, no) {

	var move_url = "/movie/view_movie_event.php?type=" + type + "&stream=" + stream + "&no=" + no;
	var str_width = 960;
	var str_height = 560;
	if(stream == "N"){
		str_width = 541;
		str_height = 338;
	}
	Bux_player = window.open(move_url,"Bux_player" ,"left=0, top=0,width=" + str_width + ",height=" + str_height + ",scrollbars=0,toolbar=0,status=1,resizable=1,menubar=0");
	
}

function viewMoviefree(type,no) {

	var move_url = "/movie/view_movie_free.php?type=" + type + "&no=" + no;
	Bux_player = window.open(move_url,"Bux_player" ,"left=30, top=30,width=960,height=640,scrollbars=0,toolbar=0,status=0,resizable=0,menubar=0");
	
}

function viewAdultLive() {

	var move_url = "/movie/view_adult_live.php";
	Bux_player = window.open(move_url,"Bux_player" ,"left=0, top=0,width=1000,height=640,scrollbars=0,toolbar=0,status=0,resizable=0,menubar=0");
	
}

function viewAnimation(type, no) {
	
	var move_url = "/movie/view_animation.php?type=" + type + "&no=" + no;
	Bux_player = window.open(move_url,"Bux_player" ,"left=0, top=0,width=840,height=520,scrollbars=0,toolbar=0,status=0,resizable=0,menubar=0");
	
}

function viewCartoon(type, no) {
	
	var move_url = "/movie/view_cartoon.php?type=" + type + "&no=" + no;
	Bux_player = window.open(move_url,"Bux_player" ,"left=0, top=0,width=670,height=705,scrollbars=0,toolbar=0,status=0,resizable=0,menubar=0");
	
}

function viewCartoon_free(type, no, vol) {
	
	var URL = "/movie/view_cartoon_free.php?type=" + type + "&no=" + no + "&vol=" + vol;
	Bux_player = window.open(URL,"Bux_player" ,"left=0, top=0,width=1000,height=720,scrollbars=0,toolbar=0,status=0,resizable=0,menubar=0");
	
}

function viewPoster(type, no) {

	var move_url = "/movie/view_poster.php?type=" + type + "&no=" + no;
	sizeW = 800;
	sizeH = screen.availHeight - 30;
	Bux_poster = window.open (move_url,"Bux_poster","left=0, top=0, width=" + sizeW  + ", height=" + sizeH + ", toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no");
	
}

function viewPosterC(type, no) {

	var move_url = "/buxzine/view_poster.php?type=" + type + "&no=" + no;
	Bux_poster = window.open (move_url,"Bux_posterC","left=0, top=0, width=" + screen.availWidth  + ", height=" + screen.availHeight + ", toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no");
	
}




function viewStill(type, no, img) {

	var move_url = "/movie/view_still.php?type=" + type + "&no=" + no + "&img=" + img;
	Bux_still = window.open (move_url,"Bux_still","left=30, top=30, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=1000, height=700");
	
}

function viewStillC(type, no) {

	var move_url = "/buxzine/view_still.php?type=" + type + "&no=" + no;
	Bux_still = window.open (move_url,"Bux_stillC","left=30, top=30, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=1000, height=700");
	
}

function listenMusic(type,no) {

	var move_url = "/ost/player.php?type=" + type + "&no=" + no;
	Bux_music = window.open (move_url,"Bux_music","left=300,top=40,toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=400, height=600");
	
}

function viewReview(type,no) {

	if(type == "buxzine_review_view") move_url = "/buxzine/movie_review_detail.php?no=" + no;
	if(type == "buxzine_review_write") move_url = "/buxzine/movie_review_write.php?movie=" + no;
	Bux_player = window.open(move_url,"Bux_review" ,"left=30, top=30,width=635,height=480,scrollbars=1,toolbar=0,status=0,resizable=0,menubar=0");
	
}

function sendEmail(tomail) {
	
	var url = '/information/send_email.php?tomail=' + tomail;
	window.open(url, 'send_email', 'width=480, height=550');
	
}

function collectEmail() {
	
	var url = '/information/collect_email.php';
	window.open(url, 'collect_email', 'width=500, height=182');
	
}

function speedCheck() {
	
	var url = '/information/speed_check.php';
	window.open(url, 'speed_check', 'width=793, height=396');
	
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function getCookie(name) { 
	var nameOfCookie = name + '='; 
	var x = 0; 
	while ( x <= document.cookie.length ) { 
		var y = (x+nameOfCookie.length); 
		if ( document.cookie.substring( x, y ) == nameOfCookie ) { 
			if ( (endOfCookie=document.cookie.indexOf( ';', y )) == -1 ) 
				endOfCookie = document.cookie.length; 
			return unescape( document.cookie.substring( y, endOfCookie ) ); 
		} 
		x = document.cookie.indexOf( ' ', x ) + 1; 
		if ( x == 0 ) 
		break; 
	} 
	return ''; 
} 

function setCookie(name, value, expiredays){ 
	
	var todayDate = new Date(); 
	todayDate.setDate( todayDate.getDate() + expiredays ); 
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
       
}





