var zoomRate = 20;
var maxRate = 200;
var minRate = 100;

function f_setInit(){
	if(GetCookie2("zoomVal") != null && GetCookie2("zoomVal") != "")
	{
		document.body.style.zoom = GetCookie2("zoomVal");
		setCookie("zoomVal",document.body.style.zoom, 1);
	}
	else
	{
		document.body.style.zoom = '100%';		
		setCookie2("zoomVal",document.body.style.zoom, 1);
	}
}


function zoomInOut(contentid, how)
{  
	if (((how == "in") && (parseInt(document.body.style.zoom) >= maxRate)) || ((how == "out") && (parseInt(document.body.style.zoom) <= minRate)) )
	{	
		return;
	}
	if (how == "in"){
		document.body.style.zoom = parseInt(document.body.style.zoom)+zoomRate+'%';
	}
	else
	{	
		document.body.style.zoom = parseInt(document.body.style.zoom)-zoomRate+'%';
		
	}	
	setCookie2("zoomVal",document.body.style.zoom, 1);
}


function GetCookie2( 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 "";
	}


function setCookie2( key, value, term ){
	var expire = new Date();
	expire.setDate( expire.getDate() + term );
//	document.cookie = key + "=" + escape( value ) + "; path=/; expires="+expire.toGMTString().substring(0,17)+"15:00:00"+expire.toGMTString().substring(25)+";";
	document.cookie = key + "=" + escape( value ) + "; path=/; expires=" + expire.toGMTString() + ";";
}

function setCookie(strName, strValue, intDate)
{
    var strExpires = "";
    if(intDate!=null && !isNaN(intDate))
    {
        var dtmToday = new Date();
        dtmToday.setDate(dtmToday.getDate() + parseInt(intDate));
        strExpires = ";expires=" + dtmToday.toUTCString();
    }
    document.cookie = strName + "=" + escape(strValue) + strExpires + ";path=/; domain=.homeplusb2b.com";
}




function contentPrint() {
	var windowLeft = (screen.width-640)/2;
	var windowTop = (screen.height-480)/2;

	var printURL = "/eng/_inc/print.jsp";
			
	window.open(printURL,"content",'width=768, height=650, menubar=no, scrollbars=yes,status=no,resizable=yes,top=' + windowTop + ',left=' + windowLeft + '');
}
