function scrollquick(name,bottomlimit){
	var topdis=50;
	if(!document.getElementById(name)){
		return;
	}
	var obj = $("#"+name);
	var btmlimit=parseInt(document.documentElement.scrollHeight-obj.height()-bottomlimit);
	var menuYloc = parseInt(obj.css("top").substring(0, obj.css("top").indexOf("px")));
	$(window).scroll(function() {
		if(menuYloc<$(document).scrollTop()){
			
		}else{
			topdis = menuYloc;
		}
		offset = topdis+parseInt($(document).scrollTop()) + "px";
		if(parseInt(offset)>btmlimit||menuYloc>btmlimit){
			return;
		}
		obj.animate({ top: offset }, { duration: 500, queue: false });
	});
}

function newWindow(url,target,w,h,s,p) {
    var win;

    if (p == 1) {
        if (self.innerHeight) {
            windowWidth = self.innerWidth;
            windowHeight = self.innerHeight;
        }
        else if (document.documentElement && document.documentElement.clientHeight) {
            windowWidth = document.documentElement.clientWidth;
            windowHeight = document.documentElement.clientHeight;
        }
        else if (document.body) {
            windowWidth = document.body.clientWidth;
            windowHeight = document.body.clientHeight;
        }
        var x = (windowWidth-w)/2;
        var y = (windowHeight-h)/2;

        win = window.open(url,target,"left="+x+",top="+y+",width="+w+",height="+h+",scrollbars="+s+",resizable=0,status=1");
    } else {
        win = window.open(url,target,"width="+w+",height="+h+",scrollbars="+s+",resizable=0,status=1");
    }
    win.focus();

    return win;
}

function embedSwf(url,id,w,h,wm) {
    var wmode = (wm == 1) ? 'window' : 'transparent';
    var embed = "";
    embed = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="'+id+'" width="'+w+'" height="'+h+'">';
    embed += '  <param name="movie" value="'+url+'" \/>';
    embed += '  <param name="quality" value="high" \/>';
    embed += '  <param name="bgcolor" value="#FFFFFF" \/>';
    embed += '  <param name="wmode" value="'+wmode+'" \/>';
    embed += '  <param name="menu" value="false" \/>';
    embed += '  <param name="allowscriptaccess" value="always" \/>';
    embed += '  <param name="allowfullscreen" value="true" \/>';
    embed += '  <embed type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" name="'+id+'" src="'+url+'" width="'+w+'" height="'+h+'" quality="high" bgcolor="#FFFFFF" wmode="'+wmode+'" menu="false" allowscriptaccess="always" allowfullscreen="true"><\/embed>';
    embed += '<\/object>';

    document.write(embed);
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function getPrint() {
    return window.print();
}

var nowZoom = 100;
var maxZoom = 200;
var minZoom = 100;
var increaseNum = 10;
function zoomIn() {
    if (nowZoom < maxZoom) {
        nowZoom += increaseNum; 
    } else {
        return;
    }

    document.getElementById('dobody').style.zoom = nowZoom + "%";
}

function zoomOut() {
    if (nowZoom > minZoom) {
        nowZoom -= increaseNum;
    } else {
        return;
    }

    document.getElementById('dobody').style.zoom = nowZoom + "%";
}

function zoomRenew() {
    nowZoom = minZoom;
    document.getElementById('dobody').style.zoom = nowZoom + "%";
}
