﻿function winResize() 
{ 
    var Dwidth = parseInt(document.body.scrollWidth); 
    var Dheight = parseInt(document.body.scrollHeight); 
    var divEl = document.createElement("div"); 
    divEl.style.position = "absolute"; 
    divEl.style.left = "0px"; 
    divEl.style.top = "0px"; 
    divEl.style.width = "100%"; 
    divEl.style.height = "100%"; 

    document.body.appendChild(divEl); 

    window.resizeBy(Dwidth-divEl.offsetWidth, Dheight-divEl.offsetHeight); 
    document.body.removeChild(divEl); 
} 



function Go_HeaderURL(typ)
{
	if(typ == "GameMain")
	{
		//window.location.href="/game/game_main.asp";
	}
	else if(typ == "Baby")
	{
		//window.location.href="/game/Baby/main.asp";
		window.location.href="/game/game.asp?typ=Baby";
	}	
	else if(typ == "Bakery")
	{
		//window.location.href="/game/Bakery/main.asp";
		window.location.href="/game/game.asp?typ=Bakery";
	}
	else if(typ == "Puppy")
	{
		//window.location.href="/game/Puppy/main.asp";
		window.location.href="/game/game.asp?typ=Puppy";
	}
	else if(typ == "Salon")
	{
		//window.location.href="/game/Salon/main.asp";
		window.location.href="/game/game.asp?typ=Salon";
	}
	else if(typ == "Pasa")
	{
		window.location.href="/game/Pasa/main.asp";
	}
	else if(typ == "School")
	{
		//window.location.href="/game/School/main.asp";
		window.location.href="/game/game.asp?typ=School";	
	}
	else if(typ == "Rich")
	{
		//window.location.href="/game/Rich/main.asp";
		window.location.href="/game/game.asp?typ=Rich";
	}
	else if(typ == "Food")
	{
		//window.location.href="/game/Food/main.asp";
		window.location.href="/game/game.asp?typ=Food";
	}	
	else if(typ == "Ellejou")
	{
		window.open("http://ellejou.vvvic.com");
	}
	else if(typ == "PomPom")
	{
		window.location.href="/game/PomPom/PomPom_main.asp";
	}
	else if(typ == "sudoku")
	{
		window.location.href="/game/sudoku/main.asp";
	}
	else if(typ == "Shop")
	{
		window.location.href="/Shop/Shop_main.asp";
	}
	else if(typ == "ShopItem")
	{
		window.location.href="/Shop/Shop_main.asp";
	}
	else if(typ == "Mopet")
	{
		window.location.href="/shop2/mp_itemshop.asp?shopid=100&cat=6&page=";
	}
	else if(typ == "Hompy")
	{
		window.location.href="/shop2/hp_itemshop.asp";
	}	
	else if(typ == "Flower")
	{
		window.location.href="/shop2/mp_itemshop.asp?shopid=100&cat=42&page=";
	}
	else if(typ == "Plaza")
	{
		window.location.href="/Plaza/Plaza_main.asp";
	}
	else if(typ == "Bank")
	{
		window.location.href="/Plaza/Plaza_main.asp";
	}
	else if(typ == "Auction")
	{
		window.location.href="/Plaza/Auction/Auction_main.asp";
	}
	else if(typ == "Market")
	{
		window.location.href="/Plaza/Market/Market_main.asp";
	}
	else if(typ == "Rogen")
	{
		window.location.href="/RosenClub/Rosen_Explain.asp";
	}
	else if(typ == "Codi")
	{
		window.location.href="/Codi/Codi_Explain.asp";
	}
	else if(typ == "Commu")
	{
		window.location.href="/Community/comm_main.asp";
	}
	else if(typ == "Huk")
	{
		window.location.href="/Community/vpoll/vpoll.asp";
	}
	else if(typ == "Agony")
	{
		window.location.href="/Community/kin/list.asp";
	}
	else if(typ == "Rank")
	{
		window.location.href="/Community/rank/list.asp";
	}
	else if(typ == "any")
	{
		window.location.href="/Community/cartoon/cartoon_list.asp";
	}
	else if(typ == "evoke")
	{
		window.location.href="/Community/comm_main.asp";
	}
	else if(typ == "content")
	{
		window.location.href="/contents/cont_main.asp";
	}
	else if(typ == "vvvicshop")
	{
		window.location.href="/NewShop/NewShop.asp";
	}
	else if(typ == "king")
	{
		window.location.href="/contents/king/main.asp";
	}
	else if(typ == "beauty")
	{
		window.location.href="/contents/campaign/cartoon_list.asp";
	}
	else if(typ == "pres")
	{
		window.location.href="/contents/present/wall.asp";
	}
	else if(typ == "song")
	{
		window.location.href="/contents/vsong/vsong.asp";
	}
	else if(typ == "unse")
	{
		window.location.href="/contents/Sazoo/main.asp";
	}
	else if(typ == "movie")
	{
		window.location.href="/contents/Cinemovie/cine_main.asp";
	}
	else if(typ == "event")
	{
		window.location.href="/Board2/Board.asp?code=BE216";
	}
	else if(typ == "Stock")
	{
		window.location.href="/plaza/new_jusik/new_jusik.asp";
	}
	else if(typ == "Novel")
	{
		window.location.href="/community/comm_novel.asp";
	}
	else if(typ == "club")
	{
		window.location.href="/Club/Club_Agree.asp";
	}

}


function PBuyItem(typ,Code)
{
	if (typ == 'Mopet')
	{
		openWin2("/Shop2/PBuyItem.asp?typ=" + typ + "&Code=" + Code ,"Buy",100,100,370,360);
	}else{
		openWin("/Shop/PBuyItem.asp?typ=" + typ + "&Code=" + Code ,"Buy",100,100,360,350);
	}
}


function BuyItem(typ,Code)
{
	if (typ == 'Mopet')
	{
		openWin2("/Shop2/BuyItem.asp?typ=" + typ + "&Code=" + Code ,"Buy",100,100,370,360);
	}else{
		openWin("/Shop/BuyItem.asp?typ=" + typ + "&Code=" + Code ,"Buy",100,100,360,350);
	}
}

/*
function OSCheck(width,height)
{	
	webblasare=navigator.appVersion;
	
	if (webblasare.indexOf("Windows NT 5.1")!=-1) 
	{
		window.resizeTo(width,height);
		//document.write(width + ";" + height);
	}
	else
	{
		window.resizeTo(width,(height-20));
		//document.write(width + ";" + height);
	}
}

*/
function OSCheck(nWidth,nHeight)
{	

	var strAgent = navigator.userAgent.toLowerCase();
	var bIE = (strAgent.indexOf("msie") != -1);
	var bXP = (strAgent.indexOf("nt 5.1") != -1);
	var bIE7 = (strAgent.indexOf("msie 7.0") != -1);
	var bSafari = (strAgent.indexOf("konqueror") != -1 || strAgent.indexOf("safari") != -1);
	var bFirefox = (strAgent.indexOf("firefox")!= -1);
	window.resizeTo(nWidth, nHeight + (bXP ? (bIE7 ? 75: 45) : 0));
}
function IncludeFlash(Url1,Url2,width,height)
{
	document.write("<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'  codebase='https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' WIDTH='" + width + "' HEIGHT='" + height + "' id=ShockwaveFlash1><PARAM NAME=movie VALUE='" + Url1 + "'><PARAM NAME='quality' VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><PARAM NAME=wmode VALUE=transparent><PARAM NAME=menu VALUE=false><EMBED src='" + Url2 + "' quality=high bgcolor=#FFFFFF  WIDTH='" + width + "' HEIGHT='" + height + "' ALIGN='' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED></OBJECT>");
}
	
function IncludeFlashVal(Url1,Url2,Val,width,height)
{
	document.write("<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' WIDTH='" + width + "' HEIGHT='" + height + "' id='window_150125'><PARAM NAME=movie VALUE='" + Url1 + "'><PARAM name=flashvars value='" + Val + "'><PARAM NAME='wmode' VALUE=transparent><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><EMBED src='" + Url2 + "' quality=high bgcolor=#FFFFFF  WIDTH='" + width + "' HEIGHT='" + height + "' NAME='window_holder' ALIGN='' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED></OBJECT>");
}


function IncludeFlashValColor(Url1,Url2,Val,width,height,color)
{
	document.write("<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' WIDTH='" + width + "' HEIGHT='" + height + "' id='window_150125'><PARAM NAME=movie VALUE='" + Url1 + "'><PARAM name=flashvars value='" + Val + "'><PARAM NAME='wmode' VALUE=transparent><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><EMBED src='" + Url2 + "' quality=high bgcolor=" + color + "  WIDTH='" + width + "' HEIGHT='" + height + "' NAME='window_holder' ALIGN='' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED></OBJECT>");
}

function IncludeFlashGame(Url1,Url2,width,height)
{
	document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='" + width + "' height='" + height + "' id='game' align='middle' VIEWASTEXT><param name='allowScriptAccess' value='sameDomain'><param name='movie' value='" + Url1 + "'><param name='quality' value='high'><param name='bgcolor' value='#ffffff'><embed src='" + Url2 + "' quality='high' bgcolor='#ffffff' width='" + width + "' height='" + height + "' name='game' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'></object>");
}


function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "="
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else {
    begin += 2
  }
  var end = document.cookie.indexOf(";", begin);
  if (end == -1) end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}


	function goto(t) {
		if (t.substr(0, 10) == 'http://hp.'){
			openWin(t, 'hp',0,0, 960, 710);
		} else if (t.substr(0,10) == 'http://clu') {
			self.location.href=t;
		} else if (t.substr(0,10) == 'http://sup') {
			self.location.href=t;
		}
	}

function openWin(theURL,winname, top, left, width, height)
{
	window.open(theURL,winname, 'top=' +top+ ', left=' +left+ ',Toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no, width=' +width+ ', height=' +height+', resizable=0');
}

function openWin_1(theURL,winname, top, left, width, height)
{
	window.open(theURL,winname, 'top=' +top+ ', left=' +left+ ',Toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no, width=' +width+ ', height=' +height+', resizable=0');
}

function openWin2(theURL,winname, top, left, width, height)
{
	window.open(theURL,winname, 'top=' +top+ ', left=' +left+ ',Toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes, width=' +width+ ', height=' +height+', resizable=0');
}

function openWin3(theURL,winname, top, left, width, height)
{
	window.open(theURL,winname, 'top=' +top+ ', left=' +left+ ',Toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes, width=' +width+ ', height=' +height+', resizable=0');
}

function openWin4(theURL,winname, top, left, width, height)
{
	window.open(theURL,winname, 'top=' +top+ ', left=' +left+ ',Toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes, width=' +width+ ', height=' +height+', resizable=0');
}

function openHP(id, bn, c) {
	//alert('ﾇ・ﾈｨﾇﾇｴﾂ ｼｭｺｺ ﾁ｡ｰﾋﾁﾟﾀﾔｴﾏｴﾙ..(ｼﾒｿ菴ﾃｰ｣20ｺﾐ)');
	openWin('http://hp.vvvic.com/hp2.asp?hpid='+id+'&boardnum='+bn+'&cat='+c,'hp',0,0,940,650)
}
function openFish(id, bn, c) {
	//alert('ﾇ・ﾈｨﾇﾇｴﾂ ｼｭｺｺ ﾁ｡ｰﾋﾁﾟﾀﾔｴﾏｴﾙ..(ｼﾒｿ菴ﾃｰ｣20ｺﾐ)');
	openWin('http://hp.vvvic.com/hpfish.asp?hpid='+id,0,0,940,650)
}


function openAlert(str) {
	alert(str);
}

function comment(db,sn){
	openWin('/common/comment_edit.asp?db=' + db + '&sn=' + sn, 'comment_edit','10','10','500','50')
}

function banner(sn){
	openWin('/common/banner_edit.asp?sn=' + sn, 'banner_edit','10','10','500','50')
}




function loginPop(url) {
	openWin('/login/login_pop.asp?TargetURL=' + url, 'login','100','100','420','280')
}

function loginPop2(url) {
	openWin('/login/login_pop2.asp?TargetURL=' + url, 'login','100','100','420','280')
}

function loginPopAb(url) {
	openWin('http://www.mopetworld.com/login/login_pop2.asp?TargetURL=' + url, 'login','100','100','420','280')
}

function lost(url) {
	openWin('/login/lost.asp?TargetURL=' + url, 'login','100','100','420','280')
}

function charge(way) {
	openWin('/pay/pay_main.asp?way=' + way, 'charge','100','100','504','520')
}


function pump(sn,typ) {
	openWin('/common/pump.asp?sn=' + sn + '&typ=' + typ, 'pump','100','100','420','210')
}

function imgShow(img) {
	openWin('/common/img_show.asp?img=' + img , 'imgShow','100','100','100','100')
}

function showImg(img) {
	openWin('/common/img_show.asp?img=' + img , 'imgShow','100','100','100','100')
}


function getter(got)
{
	window.open("/event/chuseok/vvvicproc.asp?got=" + got, "88as", "toolbar=no,menubar=no, width=1,height=1,left=50,top=50");
	self.close();
}

function vvvicTour(got)
{
	window.open("/event/vvvicTour/tourproc.asp?got=" + got, "18as", "toolbar=no,menubar=no, width=1,height=1,left=50,top=50");
	self.close();
}

function salonpay(got)
{
	window.open("/game2/salon/salonMove_proc.asp?area=" + got, "18as", "toolbar=no,menubar=no, width=1,height=1,left=50,top=50");
	self.close();
}

//ﾂﾊﾁｦ ｺｸｳｻｴﾂ ﾃ｢ﾀｻ ｶ鄙鋗ﾙ
function sendMsg(id) {
	openWin('/MyInfo/msg/msg_write_popup.asp?r_uid=' + id ,'msg' , 50,100,450,400);
}
//ﾄ｣ｱｸ ｽﾅﾃｻ ﾃ｢ﾀｻ ｶ鄙鋗ﾙ
function sendFriend(id)	{
	openWin('/MyInfo/friend/friend_req_popup.asp?ruid=' + id ,'friend' , 50,100,350,320);
}
//ｼｱｹｰﾇﾏｱ篋ｦ ｴｩｸ｣ｸ・ｾﾈｳｻｸｸ ﾇﾑｴﾙ	
function sendPres(){
	alert('ｾﾆﾀﾌﾅﾛｼ･ｿ｡ｼｭ ｱｸﾀﾔﾇﾏｼﾅｾﾟ ﾇﾕｴﾏｴﾙ.\nｺ・ｼｱｹｰﾀｺ ｸﾞﾀﾎﾈｭｸ鯊ﾇ ｺ・ｱｹｰ ｹｰﾀｻ ﾀﾌｿ・ﾏｼｼｿ膺^');
}
