function menu(flag){
	if (flag ==  "1"){
		location.replace("/Main/main.asp");
	}
	else if (flag ==  "2"){
		location.replace("/contact/team.asp");
	}
	else if (flag ==  "3"){
		location.replace("/contact/contact.asp");
	}
	else if (flag ==  "4"){
		location.replace("/contact/link.asp");
	}
}


function popup(flag1, flag2) {
	var width = 578;
	var height = 400;
	var calLeft = Math.round((screen.width / 2) - (width / 2));
	var calTop = Math.round((screen.height / 2) - (height / 2) - 50);
	switch (flag1) {
		case "client": 
			switch (flag2)
			{
				case "entry": window.open('/PROJECT/pop_client_entry_pre.asp', 'project', 'width=578, height=400, scrollbars=yes, top=' + calTop + ', left=' + calLeft); return;
				case "modify": window.open('/PROJECT/pop_client_modify.asp', 'project', 'width=578, height=420, scrollbars=yes, top=' + calTop + ', left=' + calLeft); return;
				default: return;
			}
		case "staff": 
			switch (flag2)
			{
				case "entry": window.open('/PROJECT/pop_staff_entry.asp', 'project', 'width=578, height=420, scrollbars=yes, top=' + calTop + ', left=' + calLeft); return;
				case "modify": window.open('/PROJECT/pop_staff_modify.asp', 'project', 'width=578, height=420, scrollbars=yes, top=' + calTop + ', left=' + calLeft); return;
				default: return;
			}
		case "project": 
			switch (flag2)
			{
				case "client": window.open('/PROJECT/pop_client_entry.asp', 'project', 'width=578, height=420, scrollbars=yes, top=' + calTop + ', left=' + calLeft); return;
				case "pm": window.open('/PROJECT/pop_pm_entry.asp', 'project', 'width=578, height=420, scrollbars=yes, top=' + calTop + ', left=' + calLeft); return;
				default: return;
			}
		default: break;
	}
}









// Flash Contents
function flashInsert(id,url,width,height,flashVars,bgColor,winMode,sAlign){

	var flashStr= "<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='"+id+"' align='middle'>" +
	"<param name='allowScriptAccess' value='always' />" +
	"<param name='movie' value='"+url+"' />" +
	"<param name='FlashVars' value='"+flashVars+"' />" +
	"<param name='wmode' value='"+winMode+"' />" +
	"<param name='menu' value='false' />" +
	"<param name='salign' value='"+sAlign+"' />" +
	"<param name='quality' value='high' />" +
	"<param name='scale' value='noscale' />" +
	"<param name='bgcolor' value='"+bgColor+"' />" +
	"<embed src='"+url+"' flashVars='"+flashVars+"' scale='noscale' wmode='"+winMode+"' menu='false' quality='high' bgcolor='"+bgColor+"' width='"+width+"' height='"+height+"' name='"+id+"' align='middle' allowScriptAccess='"+winMode+"' salign='"+sAlign+"' type='application/x-shockwave-flash' pluginspage='https://www.macromedia.com/go/getflashplayer' /></object>";
	document.write(flashStr);
}

/* constructor */
/* ÀÎ¼ö´Â (¿¤¸®¸ÕÆ® id, ÃÊ±â top °ª, (¼±ÅÃ»çÇ×) bottom ¸¶Áø) */
function floatedLayer(eleName, initialTop, bottomLimit) {

	if (!document.getElementById(eleName)) { return; }
	
	this.ele = document.getElementById(eleName);
	this.initialTop = initialTop;
	this.bottomLimit = (!bottomLimit)? 0 : bottomLimit;
	this.timer = null;
	this.moveLayer();
}

/* class property */
floatedLayer.INTERVAL = 10; /* µ¿ÀÛ °£°Ý: (´ÜÀ§: ¹Ð¸®ÃÊ(ms)) */
floatedLayer.DEGREE = 5; /* ¿òÁ÷ÀÓ Á¤µµ: (´ÜÀ§: ÆÛ¼¾Æ®, 0 < ¹üÀ§ <= 100) */


/* instance method */
floatedLayer.prototype.moveLayer = function () {

	var scrollHeight = 0;

	// ½ºÅ©·ÑµÈ ³ôÀÌ °è»ê (Âü°í: http://www.howtocreate.co.uk/tutorials/javascript/browserwindow)
	if (document.body && document.body.scrollTop) {
		scrollHeight = document.body.scrollTop;
	} else if (document.documentElement && document.documentElement.scrollTop) {
		scrollHeight = document.documentElement.scrollTop;
	}

	var top = (isNaN(parseInt(this.ele.style.top)))? this.initialTop : parseInt(this.ele.style.top);
	var exactHeight = scrollHeight + this.initialTop;

	var moveHeight = Math.ceil(Math.abs(top - exactHeight) * floatedLayer.DEGREE / 100);
	
	top = (top > exactHeight)? top - moveHeight : top + moveHeight;

	var documentHeight = document.body.offsetHeight;
	var eleHeight = this.ele.offsetHeight;

	if ((top + eleHeight) >= documentHeight - this.bottomLimit) {
		top = documentHeight - eleHeight - this.bottomLimit;
	}

	this.ele.style.top = top + "px";

	// setTimeout¿¡¼­ ÀÎ½ºÅÏ½º ¸Þ¼Òµå »ç¿ë (Âü°í: http://www.faqts.com/knowledge_base/view.phtml/aid/2311)
	var self = this;
	if (this.timer) {
		window.clearTimeout(this.timer);
	}
	this.timer = window.setTimeout(function () { self.moveLayer(); }, floatedLayer.INTERVAL);
}

window.onload  = function() {
	var eleTop = 198;
	if (document.getElementById("divTop")) {
		new floatedLayer("divTop", eleTop, 300);
	}
} 

/* function externalLinks(){
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++){
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
		anchor.target = "_blank";
	}
}

window.onload = externalLinks; */




function link(flag){
	if (flag ==  "1"){
		location.href ="/Contents/Contents_View.asp?CG_CODE1_SER=SA01&amp;CG_CODE2_SER=SB02";
	}
	else if (flag ==  "2"){
		location.href ="/Contents/Contents_View.asp?CG_CODE1_SER=SA01&amp;CG_CODE2_SER=SB03";
	}
	else if (flag ==  "3"){
		location.href ="/Contents/Contents_View.asp?CG_CODE1_SER=SA01&amp;CG_CODE2_SER=SB04";
	}
	else if (flag ==  "4"){
		location.href ="/Contents/Contents_View.asp?CG_CODE1_SER=SA01&amp;CG_CODE2_SER=SB05";
	}
	else if (flag ==  "5"){
		location.href ="/Contents/Contents_View.asp?CG_CODE1_SER=SA01&amp;CG_CODE2_SER=SB06";
	}
	else if (flag ==  "6"){
		location.href ="/Contents/Contents_View.asp?CG_CODE1_SER=SA01&amp;CG_CODE2_SER=SB07";
	}
	else if (flag ==  "7"){
		location.href ="/Contents/Contents_View.asp?CG_CODE1_SER=SA01&amp;CG_CODE2_SER=SB08";
	}
}


function pr_video(){
	window.open('/Brochure/pr_video.asp', 'prVideo', 'width=400, height=266, scrollbars=no, top=' + calTop + ', left=' + calLeft); return;
}




function pr_video(){
	var width = 373;
	var height = 277;
	var calLeft = Math.round((screen.width / 2) - (width / 2));
	var calTop = Math.round((screen.height / 2) - (height / 2) - 50);
	
	window.open('/Brochure/pr_video.asp', 'prVideo', 'width=373, height=277, scrollbars=no, top=' + calTop + ', left=' + calLeft);
}




	
