/* Paging_RollOver */
function comic_paging_rollover(obj, img, type) {
	var imgurl = "http://image.daum-img.net/hanmail/s_img/comic5/";
	var tmp
	if (type == "on") {
		obj.src = imgurl + img + "_over.gif";
	} else {
		obj.src = imgurl + img + ".gif";
	}
}

/* Right Tab RollOver*/
var num ='';

function hcomic(num){
	if (num == 1){
		document.getElementById('hc_1').src = "http://image.comic.daum-img.net/comic5/2009/tab_update_on.gif";
		document.getElementById('hc_2').src = "http://image.comic.daum-img.net/comic5/2009/tab_series.gif";
	}else {
		document.getElementById('hc_1').src = "http://image.comic.daum-img.net/comic5/2009/tab_update.gif";
		document.getElementById('hc_2').src = "http://image.comic.daum-img.net/comic5/2009/tab_series_on.gif";
	}
}

function mncomic(num2){
	var img_url = new Array();
	img_url[0] = "http://image.comic.daum-img.net/comic5/2009/tab_all";
	img_url[1] = "http://image.comic.daum-img.net/comic5/2009/tab_romance";
	img_url[2] = "http://image.comic.daum-img.net/comic5/2009/tab_hero";
	img_url[3] = "http://image.comic.daum-img.net/comic5/2009/tab_serial";
	img_url[4] = "http://image.comic.daum-img.net/comic5/2009/tab_all";
	img_url[5] = "http://image.comic.daum-img.net/comic5/2009/tab_japan";
	img_url[6] = "http://image.comic.daum-img.net/comic5/2009/tab_drama";
	img_url[7] = "http://image.comic.daum-img.net/comic5/2009/tab_action";

	for (i=0;i<=7;i++){
		if( i == num2 ){
			document.getElementById('mn_'+i).src = img_url[i]+"_on.gif" ;
//			document.getElementById('MComic_'+i).style.display = "block"
		}else{
			document.getElementById('mn_'+i).src = img_url[i]+".gif" ;
//			document.getElementById('MComic_'+i).style.display = "none"
		}
	}
	
}

/* Call Viwer */
function executeViewer(dest, ck){ 
	if( navigator.userAgent.indexOf("MS") != -1 ) {
		if(screen.height > 800)	Comic_PopUp(dest + "?has_bigsize=T&ck=" + ck, 'viewWin', 480, 300, 0, 0);
		else Comic_PopUp(dest + "?has_bigsize=F&ck=" + ck, 'viewWin', 480, 300, 0, 0);
	}else {
		alert("현재 브라우저에서는 뷰어를 실행할 수 없습니다.");
	}
}

function executeBookMarkViewer(dest, ck){
                if(screen.height > 800) Comic_PopUp(dest + "has_bigsize=T&ck=" + ck, 'viewWin', 480, 300, 0, 0);
                else Comic_PopUp(dest + "?has_bigsize=F&ck=" + ck, 'viewWin', 480, 300, 0, 0);
}

/* PopUp Add IE7 FF2 */
function Comic_PopUp(url, winname, width, height, scrollbars, resizable) {
	msgWindow = window.open(url, winname, 'scrollbars='+scrollbars+', resizable='+resizable+', width='+width+' ,height='+height+' ,left=0, top=0');
	msgWindow.focus();
}

function resizePopup(Wwidth, Wheight) {
var h=0;
if (navigator.userAgent.indexOf("SV1") > 0){  h=29; } 
else if(navigator.userAgent.indexOf("MSIE 7")>0) { h=45; }
else if(navigator.userAgent.indexOf("Gecko")>0 && navigator.userAgent.indexOf("Firefox") <= 0 && navigator.userAgent.indexOf("Netscape") <= 0 ){ h=22; } 
else if(navigator.userAgent.indexOf("Firefox") >0 ){  h=55; } 
else if(navigator.userAgent.indexOf("Netscape") >0 ){ h=-2; }
else { h=0;} 
window.resizeTo(Wwidth, Wheight + h);
}

function openAgreement(){
        window.open('/inc/d_agree.html','agreement','width=610,height=620').focus();
}

/* Random */ 
function rand_number(n) {
	var x;

	x=Math.round(Math.random()*100);
	x%=n;
	return x;
}

/* Ajax Loader Image */
var ajaxLoaderImage = "<div style='width:100%; text-align:center;'><div style='margin:0 auto; width:32px; height:32px; background:url(http://image.comic.daum-img.net/comic5/2009/ajax-loader.gif) no-repeat 0 0;'></div></div>";
var ajaxLoaderImage1 = "<table border='0' cellpadding='0' cellspacing='0' width='100%'><tr height='170'><td align='center' style='background:url(http://image.comic.daum-img.net/comic5/2009/ajax-loader.gif) no-repeat 50% 50%;'></td></tr></table>";