/*
boltmail.co.kr
by amuro
*/



/* common */

function openwindow(url, name, width, height, scroll, resizable)
{
	if (!name) name='anywin'
	if (!width) width=500
	if (!height) height=300
	if (scroll) scr='yes'; else scr='no'
	if (resizable) res='yes'; else res='no'

	return window.open(url, name, 'width='+width+', height='+height+', menubar=no, toolbar=no, location=no, directories=no, status=yes, scrollbars='+scr+', resizable='+res)
}

function checklogin(form)
{
	if (!form.input_username.value)
	{
		// alert('input your username.')
		form.input_username.focus()
		return false
	}
	if (!form.input_password.value)
	{
		form.input_password.focus()
		return false
	}

	if (form.logintype.checked) form.action='https://domainname.net:446/login/login.html'

	return true
}

function checkAll(form, chkall, chkbox)
{
	var listform=document.getElementById(form); // var f = document.form;

	for (var i=0; i<listform.elements.length; i++)
	{
		var element=listform.elements[i];
 
		if ( element.name.indexOf(chkbox)==0 )
		{
			if (!document.getElementById(chkall).checked)
			{
				element.checked = 0; // f.all.checked = 0;
			}
			else
			{
				element.checked = 1; // f.all.checked = 1;
			}
		}
	}
}



/* etc */

function openwindow_console()
{
	openwindow('/console/', 'console', 950, 700, true, true)
}

function openwindow_message(to) // message
{
	// window.open('/message/', 'message', 'width=583, height=412, menubar=no, toolbar=no, location=no, directories=no, status=no, scrollbars=yes, resizable=no')
	openwindow('/message/?to='+to, 'mbox', 559, 390, true)
	// location.reload()
}

function openwindow_userprofile(username)
{
	openwindow('/friends/userprofile.html?username='+username, 'userprofile', 420, 370)
}

function openwindow_addressbook()
{
	openwindow('/land/email/addressbook/', 'addressbook', 470, 430, true)
}

function openwindow_zipcode(city3) // zipcode
{
	openwindow('/apply/zipcode.html?input_city3='+city3, 'zipcode', 475, 250, true);
}

function openwindow_apply()
{
	openwindow('/apply/', 'apply', 714, 670, true)
}

function openwindow_nopassword()
{
	openwindow('/login/nopassword/', 'nopassword', 714, 670, true)
}

function openwindow_standard()
{
	var openwin=openwindow('/library/standard/', 'standard', 980, 700, true, true)
	openwin.focus()
}



/* viewer */

function openwindow_imageview(filename)
{
	openwindow('/viewer/imageview.html?filename='+filename, 'image', 650, 500, true, true)
}

function openwindow_viewer2(filename, titlebar, sx, sy, addstr)
{
	openwindow('./view_window.html?filename='+filename+'&titlebar='+titlebar+'&'+addstr, 'image', sx, sy)
}

function openwindow_file(filename)
{
	openwindow(filename, 'image', 650, 500, true, true)
}

function openwindow_printable(boardno, no)
{
	openwindow('/viewer/printable.html?boardno='+boardno+'&no='+no, 'console', 600, 500, true, true)
}



/* popup window*/

function openwindow_popup(url, name, width, height)
{
	var popwindow=openwindow(url, name, width, height, true)
	popwindow.focus()
}



/* popup menu */

function popupmenu_open(popmenu_name)
{
	popmenu_name.style.visibility="visible"
}

function popupmenu_close(popmenu_name)
{
	popmenu_name.style.visibility='hidden'
}


/* object*/

function FlashObject(byPath, byWidth, byHeight)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+byWidth+'" height="'+byHeight+'">');
	document.write('<param name="movie" value="'+byPath+'">');
	document.write('<param name="quality" value="high">');
	document.write('<embed src="'+byPath+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+byWidth+'" height="'+byHeight+'"></embed>');
	document.write('</object>');
}



function setCookie(name, value, expiredays)
{
	var todayDate = new Date()
	todayDate.setDate( todayDate.getDate() + expiredays )
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

function setcookie1(name)
{
	setCookie(name, 1, 1)
}



/* product */

function openwindow_product(p_item)
{
	var openwin=openwindow('/products/view.html?p_item='+p_item, 'product', 570, 550, true, true)
	openwin.focus()
}
function openwindow_product_detail(url)
{
	var openwin=openwindow(url, 'product_detail', 600, 600, true, true)
	openwin.focus();
}

function openwindow_product_config(url)
{
	var openwin=openwindow(url, 'product_config', 450, 400, true, true)
	openwin.focus();
}
function openwindow_product_form(url)
{
	var openwin=openwindow(url, 'product_form', 450, 600, true, true)
	openwin.focus();
}

/*
function openwindow_detail(p_item)
{
	// var openwindow=window.open("./detail/?p_item=" + p_item,"detail", "top=0, left=0, width=780, height=600, scrollbars=yes, resizable=yes")
	var win=openwindow('./detail/?p_item='+p_item, 'detail', 500, 600, true, true)
	win.focus()
}
function openwindow_catalog(url)
{
	// var win=window.open(gopath,"catalog","scrollbars=yes,width=800,height=600");
	var win=openwindow(url, 'catalog', 600, 600, true, true)
	win.focus();
}
*/

/* EOF */
