var pagetopAgt = navigator.userAgent.toLowerCase();
if (pagetopAgt.indexOf("msie 6.") == -1) {
	/* Get Attribute
	================================================== */
	var GetScreenRealSize = function(type){
		if(type == "width"){
			return(screen.availWidth);
		}else if(type == "height"){
			return(screen.availHeight);
		}
	}
	
	var GetWindowRealSize = function(type){
		if(type == "width"){
			if(usr.ICAB || usr.OPERA){
				return(window.innerWidth);
			}else if(d.all){
				return(document.body.clientWidth);
			}else if(d.layers || d.getElementById){
				return(window.innerWidth);
			}
		}else if(type == "height"){
			if(usr.ICAB || usr.OPERA){
				return(window.innerHeight);
			}else if(d.all){
				return(document.body.clientHeight);
			}else if(d.layers || d.getElementById){
				return(window.innerHeight);
			}
		}
	}
	
	var getHeight = function(idName) {
		if(usr.checkObj == 2){
			return d.all(idName).style.pixelHeight;
		}else if(usr.checkObj == 3 || usr.checkObj == 4){
			return parseInt(d.getElementById(idName).offsetHeight);
		}else if(usr.checkObj == 1){
			return d.layers[idName].clip.height;
		}
	}
	
	var getWidth = function(idName) {
		if(usr.checkObj == 2){
			return d.all(idName).style.pixelWidth;
		}else if(usr.checkObj ==3 || usr.checkObj ==4){
			return parseInt(d.getElementById(idName).offsetWidth);
		}else if(usr.checkObj == 1){
			return d.layers[idName].clip.width;
		}
	}
	
	var getTop = function(idName){
		if(usr.checkObj == 3 || usr.checkObj == 4){
			return parseInt(d.getElementById(idName).style.top);
		}else if(usr.checkObj == 2){
			return d.all(idName).style.pixelTop;
		}else if(usr.checkObj == 1){
			return d.layers[idName].top;
			/*return d.layers[idName].pageX;*/
		}
	}
	
	var getLeft = function(idName){
		if(usr.checkObj == 3 || usr.checkObj == 4){
			return parseInt(d.getElementById(idName).style.left);
		}else if(usr.checkObj == 2){
			return d.all(idName).style.pixelLeft;
		}else if(usr.checkObj == 1){
			return d.layers[idName].left;
			/*return d.layers[idName].pageY;*/
		}
	}
	
	var getWindowWidth = function(){
		if(usr.WinIE6s){
			return d.documentElement.clientWidth;
		}else if(usr.Mac && (usr.checkObj == 1 || usr.OPERA)){
			return window.innerWidth;
		}else if(usr.Win && usr.checkObj == 1){
			return window.innerWidth - 16;
		}else if(usr.checkObj == 4){
			return window.innerWidth - 15;
		}else if(usr.OPERA || usr.checkObj == 2 || usr.checkObj == 3){
			return d.body.clientWidth;
		}
	}
	
	var getWindowHeight = function(){
		if(usr.WinIE6s){
			return d.documentElement.clientHeight;
		}else if(usr.Mac && (usr.checkObj == 1 || usr.OPERA)){
			return window.innerHeight;
		}else if(usr.Win && usr.checkObj == 1){
			return window.innerHeight - 16;
		}else if(usr.checkObj == 4){
			return window.innerHeight - 15;
		}else if(usr.OPERA || usr.checkObj == 2 || usr.checkObj == 3){
			return d.body.clientHeight;
		}
	}
	
	var getWindowXOffset = function(){
		if(usr.WinIE6s || usr.modeStandard){
			return d.body.parentNode.scrollLeft;
		}else if(usr.checkObj == 2 || usr.checkObj == 3){
			return d.body.scrollLeft;
		}else if(usr.checkObj == 1 || usr.checkObj == 4){
			return window.pageXOffset;
		}
	}
	
	var getWindowYOffset = function(){
		if(usr.WinIE6s || usr.modeStandard){
			return d.body.parentNode.scrollTop;
		}else if(usr.checkObj == 2 || usr.checkObj == 3){
			return d.body.scrollTop;
		}else if(usr.checkObj == 1 || usr.checkObj == 4){
			return window.pageYOffset;
		}
	}
	
	var getDocWidth = function(){
		if(usr.allObj){
			return getTagLeft('end') + 1;
		}
	}
	var getDocHeight = function(){
		if(usr.allObj){
			return getTagTop('end') + 1;
		}
	}
	
	var getDistanceMaxX = function(){
		if(usr.allObj){
			return (getDocWidth() - getWindowWidth());
		}
	}
	var getDistanceMaxY = function(){
		if(usr.allObj){
			return (getDocHeight() - getWindowHeight());
		}
	}
	
	var getVisibility = function(idName){
		if(usr.checkObj == 2 || usr.checkObj == 3){
			if(d.all(idName).style.visibility=='')return 'inherit'
			return d.all(idName).style.visibility
		}else if(usr.checkObj == 4){
			if(d.getElementById(idName).style.visibility=='')return 'inherit'
			return d.getElementById(idName).style.visibility
		}else if(usr.checkObj == 1){
			if(d.layers[idName].visibility=='show')return 'visible'
			if(d.layers[idName].visibility=='hide')return 'hidden'
			if(d.layers[idName].visibility=='inherit')return 'inherit'
		}
	}
	
	var setObj = function(idName){
		return d.all ? d.all(idName) : d.getElementById ? d.getElementById(idName) : d.layers[idName];
	}
	
	var getTagLeft = function(idName) {
		var obj = setObj(idName);
		var tagCoords = new Object();
		if((usr.checkObj == 2) || (usr.checkObj == 3) || (usr.checkObj == 4)) {
			tagCoords.x = obj.offsetLeft;
			while ((obj = obj.offsetParent) != null) {
				tagCoords.x += obj.offsetLeft;
			}
		} else if(usr.checkObj == 1) {
			tagCoords.x = d.anchors[idName].x;
		}if((tagCoords.x*0)==0){
			return tagCoords.x;
		}else{
			return idName;
		}
	}
	
	var getTagTop = function(idName) {
		var obj = setObj(idName);
		var tagCoords = new Object();
		if((usr.checkObj == 2) || (usr.checkObj == 3) || (usr.checkObj == 4)) {
			tagCoords.y = obj.offsetTop;
			while ((obj = obj.offsetParent) != null) {
				tagCoords.y += obj.offsetTop;
			}
		} else if(usr.checkObj == 1) {
			tagCoords.y = d.anchors[idName].y;
		}if((tagCoords.y*0) == 0){
			if(usr.Mac && usr.Moz){
				return (tagCoords.y - 12);
			}else if((usr.Win && usr.Moz) || (usr.Mac && usr.SAFARI)){
				return (tagCoords.y - 9);
			}else{
				return (tagCoords.y);
			}
		}else{
			return idName;
		}
	}
	
	/*PageScroller*/
	var pageScrollTimer;
	var pageScroll = function(toX,toY,frms,frX,frY) {
		if(pageScrollTimer) clearTimeout(pageScrollTimer);
		var spd = usr.Moz?2:usr.Mac ? 14 :16;
		var actX = getWindowXOffset();
		var actY = getWindowYOffset();
		if(!toX || toX < 0) toX = 0;
		if(!toY || toY < 0) toY = 0;
		if(!frms) frms = (usr.Mac&&(usr.OPERA||usr.NS6))?3:usr.NS6?4:usr.NS?10:5;
		if(!frX) frX = 0 + actX;
		if(!frY) frY = 0 + actY;
	
		frX += (toX - actX) / frms;
		if (frX < 0) frX = 0;
		frY += (toY - actY) / frms;
		if (frY < 0) frY = 0;
		var posX = Math.ceil(frX);
		var posY = Math.ceil(frY);
		window.scrollTo(posX, posY);
		if((Math.floor(Math.abs(actX - toX)) < 1) && (Math.floor(Math.abs(actY - toY)) < 1)){
			clearTimeout(pageScrollTimer);
			window.scroll(toX,toY);
		}else if(posX != toX || posY != toY){
			pageScrollTimer = setTimeout("pageScroll("+toX+","+toY+","+frms+","+frX+","+frY+")",spd);
		}else{
			clearTimeout(pageScrollTimer);
		}
	}
	
	var toAnchor = function(idName,longitudinalAdj,traverser) {
		if(usr.allObj){
			if(!!idName){
				var anchorX = traverser?getTagLeft(idName) : 0;
				var anchorY = longitudinalAdj?getTagTop(idName)-longitudinalAdj : getTagTop(idName)-20;
				var dMaxX = getDistanceMaxX();
				var dMaxY = getDistanceMaxY();
				if(((anchorX*0) == 0)||((anchorY*0) == 0)){
					var setX = (anchorX<1)?0:(anchorX>dMaxX)?dMaxX:anchorX;
					var setY = (anchorY<1)?0:(anchorY>dMaxY)?dMaxY:anchorY;
					pageScroll(setX,setY);
				}else{
					location.hash = idName;
				}
			}else{
				pageScroll(0,0);
			}
		}else{
			!!idName ? location.hash = idName : location.hash = "top";
		}
	}
	/* Set Up Object
	================================================== */
	var bAgent = navigator.userAgent;
	var bName = navigator.appName;
	var bPlugins = navigator.plugins;
	var d = document;
	
	var sniffer = function(){
	
	/* Object
	================================================== */
		/*NS4 = 1, IE4 = 2, IE5+,OPERA5,7 = 3, NS6+,SAFARI,OPERA6 = 4, others = 0*/
		this.checkObj = d.all?(d.getElementById?3:2):(d.getElementById?4:(d.layers?1:0));
		this.allObj = ((this.checkObj == 1) || (this.checkObj == 2) || (this.checkObj == 3) || (this.checkObj == 4));
		this.checkObj4 = (d.getElementById && !d.all) ? 1 :0;
		this.checkObj3 = (d.getElementById && d.all) ? 1 :0;
		this.checkObj2 = (d.all && !d.getElementById) ? 1 :0;
		this.checkObj1 = d.layers ? 1 :0;
	
	/* Compat Mode*
	================================================== */
		this.modeStandard = d.compatMode == "CSS1Compat" ? 1 : 0;
		this.modeQuirks = d.compatMode == "BackCompat" ? 1 : 0;
		
		this.WinIE6s = (this.Win && this.IE && this.modeStandard && ((bAgent.indexOf('MSIE 6.',0) != -1)||(bAgent.indexOf('MSIE 7.',0) != -1)));
		this.WinIE6q = (this.Win && this.IE &&this. modeQuirks && ((bAgent.indexOf('MSIE 6.',0) != -1)||(bAgent.indexOf('MSIE 7.',0) != -1)));
		
		return this;
	}
	var usr = new sniffer;
} else {
	var toAnchor = function(idName,longitudinalAdj,traverser) {
		location.href = location.href+"#";
	}

}