//////////////////////////////// common ////////////////////////////////
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 "";
}


///////////////////////////////// board function /////////////////////////////

function popView(imgObj)
{
	var url = "";
	if(typeof imgObj == 'string')
	{
		url = imgObj; 
	}
	else if(typeof imgObj == 'object' && imgObj.parentNode != "undefined" && imgObj.src != "undefined")
	{
		if(imgObj.parentNode.tagName == 'A')
		{
    		return; 
		}
		else
		{
			url = imgObj.src;
		}
	}
	
	window.open("/lib/common/imageZoom.asp?url=" + url,"imgZoom","scrollbars=yes,width=100,height=100,left=0,top=0");
}

function HideLayer(id)
{
	document.getElementById(id).style.display = "none";
}

function FnAttachPhoto()
{
	window.open('/include/attach/attach_photo.asp','AttachPhoto','width=400,height=400,left=100,top=100');
}

///////////////////////////////// menu /////////////////////////////
function View3Depth(id)
{
	document.getElementById(id).style.display = "";
}

function MenuOn(id,src)
{
	document.getElementById(id).src = src;
	document.getElementById(id).onmouseout = null;
}


function resizeIFrame(sFrameName) {
    var isIE     = (navigator.userAgent.toLowerCase().indexOf("msie")!=-1 && window.document.all) ? true:false;
    var objBody  = window.frames[sFrameName].document.body;
    var objFrame = document.getElementById(sFrameName);
    ifrmHeight = objBody.scrollHeight + (objBody.offsetHeight - objBody.clientHeight);
    objFrame.style.height = ifrmHeight+10;
    if (isIE==false)
    {
        var iframeElement = parent.document.getElementById(sFrameName);
        if (parent.frames && parent.frames['dataFrame']) {
        	iframeElement.height =  parent.frames['dataFrame'].document.getElementById('offsettop_layer').offsetTop + 10;
        }
    }
}