/***
* MooTools Copyright:copyright (c) 2007 Valerio Proietti, <http://mad4milk.net>
* This script is used to fix for mootools v1.11 , Free for use
* Use :
<script type="text/JavaScript" src="/path/to/mootools.v1.11.js"></script>
<script type="text/JavaScript" src=""/path/to/mootools.v1.11-fix_by_loa.js"></script>
<!-- this js must put at the line after the mootols.js , and please don't set any code between them -->

*/
var MooToolsFixByLoa = {
version: '1.11'
,date: '2008-04-09'
};
$extend(Function.prototype,{
	emptyself:function(){
		this.forEach(function(v,i){
			if ( typeof(v) == 'function' )v = Class.empty;
		});
	}
}
);

Element.extend({
setStyle:function(property, value){
	switch(property){
		case 'opacity': return this.setOpacity(parseFloat(value));
		case 'float': property = (window.ie) ? 'styleFloat' : 'cssFloat';
/*fix on ie Add by loa(locke_ad@yahoo.com.tw) 2007-11-05*/
case 'width':
case 'height':if (window.ie)if (value.toInt()<1)value=1;break;
/*fix end*/
	}
	property = property.camelCase();
	switch($type(value)){
		case 'number': if (!['zIndex', 'zoom'].contains(property)) value += 'px'; break;
		case 'array': value = 'rgb(' + value.join(',') + ')';
	}
	this.style[property] = value;
	return this;
}
});
if( !Event.KEY_DOWN )Event = $extend(Event, {
KEY_BACKSPACE: 8,KEY_TAB:       9,
KEY_RETURN:   13,KEY_ESC:      27,
KEY_LEFT:     37,KEY_UP:       38,
KEY_RIGHT:    39,KEY_DOWN:     40,
KEY_DELETE:   46,KEY_HOME:     36,
KEY_END:      35,KEY_PAGEUP:   33,
KEY_PAGEDOWN: 34});


var Client = {
	Engine: {'name': 'unknown', 'version': ''},
	Platform: {},
	Features: {}
};

//Client.Features
Client.Features.xhr = !!(window.XMLHttpRequest);
Client.Features.xpath = !!(document.evaluate);

//Client.Engine
if (window.opera) Client.Engine.name = 'opera';
else if (window.ActiveXObject) Client.Engine = {'name': 'ie', 'version': (Client.Features.xhr) ? 7 : 6};
else if (!navigator.taintEnabled) Client.Engine = {'name': 'webkit', 'version': (Client.Features.xpath) ? 420 : 419};
else if (document.getBoxObjectFor != null) Client.Engine.name = 'gecko';
Client.Engine[Client.Engine.name] = Client.Engine[Client.Engine.name + Client.Engine.version] = true;

//Client.Platform
Client.Platform.name = navigator.platform.match(/(mac)|(win)|(linux)|(nix)/i) || ['Other'];
Client.Platform.name = Client.Platform.name[0].toLowerCase();
Client.Platform[Client.Platform.name] = true;




/*
Class: Client
	Cross browser methods to get various window dimensions.
	Warning: All these methods require that the browser operates in strict mode, not quirks mode.
*/
Client.extend = $extend;
Client.extend({

	/*
	Property: getWidth
		Returns an integer representing the width of the browser window (without the scrollbar).
	*/

	getWidth: function(){
		if (Client.Engine.webkit419) return window.innerWidth;
		if (Client.Engine.opera) return document.body.clientWidth;
		return document.documentElement.clientWidth || document.body.clientWidth;
	},

	/*
	Property: getHeight
		Returns an integer representing the height of the browser window (without the scrollbar).
	*/

	getHeight: function(){
		if (Client.Engine.webkit419) return window.innerHeight;
		if (Client.Engine.opera) return document.body.clientHeight;
		return document.documentElement.clientHeight || document.body.clientHeight;
	},

	/*
	Property: getScrollWidth
		Returns an integer representing the scrollWidth of the window.
		This value is equal to or bigger than <getWidth>.

	See Also:
		<http://developer.mozilla.org/en/docs/DOM:element.scrollWidth>
	*/

	getScrollWidth: function(){
		if (Client.Engine.ie) return Math.max(document.documentElement.offsetWidth, document.documentElement.scrollWidth);
		if (Client.Engine.webkit) return document.body.scrollWidth;
		//return document.documentElement.scrollWidth;
		return Math.max(document.documentElement.scrollWidth, document.body.scrollWidth);
	},

	/*
	Property: getScrollHeight
		Returns an integer representing the scrollHeight of the window.
		This value is equal to or bigger than <getHeight>.

	See Also:
		<http://developer.mozilla.org/en/docs/DOM:element.scrollHeight>
	*/

	getScrollHeight: function(){
		if (Client.Engine.ie) return Math.max(document.documentElement.offsetHeight, document.documentElement.scrollHeight);
		if (Client.Engine.webkit) return document.body.scrollHeight;
		return Math.max(document.documentElement.scrollHeight, document.body.scrollHeight);
	},

	/*
	Property: getScrollLeft
		Returns an integer representing the scrollLeft of the window (the number of pixels the window has scrolled from the left).

	See Also:
		<http://developer.mozilla.org/en/docs/DOM:element.scrollLeft>
	*/

	getScrollLeft: function(){
		return window.pageXOffset || document.body.scrollLeft || document.documentElement.scrollLeft;
	},

	/*
	Property: getScrollTop
		Returns an integer representing the scrollTop of the window (the number of pixels the window has scrolled from the top).

	See Also:
		<http://developer.mozilla.org/en/docs/DOM:element.scrollTop>
	*/

	getScrollTop: function(){
		return window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
	},

	/*
	Property: getSize
		Same as <Element.getSize>, but for window
	*/

	getSize: function(){
		return {
			'size': {'x': Client.getWidth(), 'y': Client.getHeight()},
			'scrollSize': {'x': Client.getScrollWidth(), 'y': Client.getScrollHeight()},
			'scroll': {'x': Client.getScrollLeft(), 'y': Client.getScrollTop()}
		};
	}

});

/*
Class: window
	Utility methods attached to the window object to match Element's equivalents
*/

window.extend({

	/*
	Property: getSize
		Same as <Client.getSize>
	*/

	getSize: Client.getSize,

	getPosition: function(){
		return {'x': 0, 'y': 0};
	}

});



/*
Fx.Slide2 = Fx.Slide.extend({
	initialize: function(el, options){
		this.parent(el, this.options);
		var z = 0;
		
		if ( (z = parseInt(this.element.getStyle('Zindex'))) > 0 ){
			alert(z);								 
			this.wrapper.setStyle('Zindex',z+1 );
		}
	},
	is_hide: function(){
		alert(this.wrapper.offsetWidth);
		if (this.wrapper.offsetHeight <= 1 || this.wrapper.offsetWidth <= 1)return true;
		else return false;
	},
	toggle: function(mode){
		if (this.is_hide()) return this.slideIn(mode);
		return this.slideOut(mode);
	}


});*/
window.addEvent('domready', function(){
  var a = $$('A');
  a.forEach(function(v,i){
		try{
			//alert(v.href);
			var href = v.getAttribute('href');
			if(typeof(href) == 'string')if ( String(href).substr(href.length-1) == '#' ){
				v.href = 'javascript:;';	
			}
		}catch(e){
			/*alert(e.message);
			alert(v.parentNode.innerHTML);*/
		}
	});
});
