
	function GO(elemid)
	{
		var elem;

		if(typeof elemid == 'object')
		{
			elem=elemid;
		}
		else
		{
			if(document.getElementById)
			{
				elem=document.getElementById(elemid);
			}
			else if(document.all)
			{
				elem=document.all(elemid);
			}
			else if(document.layers)
			{
				elem=document.all[elemid];
			}
		}

		return elem;
	}



	function CCS(elemid, css_style, css_value, gett)
	{
		var elem;

		elem=GO(elemid);

		if(!elem)
		{
			if(gett) return Array(false, false);
			return false;
		}

		if(gett) return Array(true, elem.style[css_style]);


		if(elem.style)
		{
			elem.style[css_style]=css_value;
		}

		return true;
	}



	var CCB;

	function CCBD()
	{
		//if((GO('top').style.filter != undefined) && !navigator.userAgent.indexOf('opera'))

		//if((GO('top').style.filter != undefined) && !navigator.userAgent.indexOf('opera'))


		if(navigator.userAgent.indexOf('MSIE 8') > 0)
		{
			CCB='ien';
		}
		else if(GO('top').style.opacity != undefined)
		{
			CCB='moz';
		}
		else if(GO('top').style.filter != undefined)
		{
			CCB='ie';
		}
		else
		{
			CCB='other';
		}
	}



	function IE6()
	{
		var appVer=navigator.appVersion;
		appVer=appVer.split(';');
		if(appVer[1] == ' MSIE 6.0')
		{
			return true;
		}
	}



	function CCO(elemid, val)
	{
		if(!CCB) CCBD();

		if(CCB != 'other')
		{
			if(typeof elemid != 'object')
			{
				elemid=GO(elemid);
			}

			if(CCB == 'ien')
			{
				elemid.style.filter='progid:DXImageTransform.Microsoft.Alpha(Opacity=' + val + ')';
			}
			else if(CCB == 'ie')
			{
				elemid.style.filter='alpha(opacity=' + val + ')';
			}
			else
			{
				elemid.style.opacity=val / 100;
			}
		}
	}



	function Trim(string)
	{
		return string.replace(/^\s*((?:[\S\s]*\S)?)\s*$/, '$1');
	}



	/**
	*
	*  URL encode / decode
	*  http://www.webtoolkit.info/
	*
	**/

	var Url = {

		// public method for url encoding
		encode : function (string) {
			return escape(this._utf8_encode(string));
		},

		// public method for url decoding
		decode : function (string) {
			return this._utf8_decode(unescape(string));
		},

		// private method for UTF-8 encoding
		_utf8_encode : function (string) {
			string = string.replace(/\r\n/g,"\n");
			var utftext = "";

			for (var n = 0; n < string.length; n++) {

				var c = string.charCodeAt(n);

				if (c < 128) {
					utftext += String.fromCharCode(c);
				}
				else if((c > 127) && (c < 2048)) {
					utftext += String.fromCharCode((c >> 6) | 192);
					utftext += String.fromCharCode((c & 63) | 128);
				}
				else {
					utftext += String.fromCharCode((c >> 12) | 224);
					utftext += String.fromCharCode(((c >> 6) & 63) | 128);
					utftext += String.fromCharCode((c & 63) | 128);
				}

			}

			return utftext;
		},

		// private method for UTF-8 decoding
		_utf8_decode : function (utftext) {
			var string = "";
			var i = 0;
			var c = c1 = c2 = 0;

			while ( i < utftext.length ) {

				c = utftext.charCodeAt(i);

				if (c < 128) {
					string += String.fromCharCode(c);
					i++;
				}
				else if((c > 191) && (c < 224)) {
					c2 = utftext.charCodeAt(i+1);
					string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
					i += 2;
				}
				else {
					c2 = utftext.charCodeAt(i+1);
					c3 = utftext.charCodeAt(i+2);
					string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
					i += 3;
				}

			}

			return string;
		}

	}



	function getPageSize()
	{
		var xScroll, yScroll;
		var windowWidth, windowHeight, pageWidth, pageHeight, arrayPageSize;

		if(window.innerHeight && window.scrollMaxY)
		{
			xScroll=document.body.scrollWidth;
			yScroll=window.innerHeight + window.scrollMaxY;
		}
		else if(document.body.scrollHeight > document.body.offsetHeight)
		{
			xScroll=document.body.scrollWidth;
			yScroll=document.body.scrollHeight;
		}
		else
		{
			xScroll=document.body.offsetWidth;
			yScroll=document.body.offsetHeight;
		}

		var windowWidth, windowHeight;

		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;
		}

		if(yScroll < windowHeight)
		{
			pageHeight=windowHeight;
		}
		else
		{
			pageHeight=yScroll;
		}

		if(xScroll < windowWidth)
		{
			pageWidth=windowWidth;
		}
		else
		{
			pageWidth=xScroll;
		}

		arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight);

		return arrayPageSize;
	}


	function SL(id, url)
	{
		var head, loader, script, cache;

		head=document.getElementsByTagName('head')[0];
	    	loader=document.getElementById('loader');

	    	if(loader) head.removeChild(loader);

	    	script=document.createElement('script');
	    	script.id='loader-' + id;
		script.src=url + Math.random() + 'a/';

		cache=document.getElementsByTagName('head')[0];
	    	cache.appendChild(script);
	}


	function HS(string)
	{
		string=string.replace(/&/g, '&amp;');
		string=string.replace(/</g, '&lt;');
		string=string.replace(/>/g, '&gt;');
		string=string.replace(/"/g, '&quot;');

		return string;
	}