//<script>
String.prototype.Contains=function(A){return (this.indexOf(A)>-1);};
var s=navigator.userAgent.toLowerCase();
var Co_BrowserInfo={IsIE:s.Contains('msie'),IsIE7:s.Contains('msie 7'),IsGecko:s.Contains('gecko/'),IsSafari:s.Contains('safari'),IsOpera:s.Contains('opera'),IsMac:s.Contains('macintosh'),IsFirefox:s.Contains("firefox/"),IsChrome : s.Contains(' chrome/'),UserAgent:s};
(function(A){A.IsGeckoLike=(A.IsGecko||A.IsSafari||A.IsOpera);if (A.IsGecko){var B=s.match(/gecko\/(\d+)/)[1];A.IsGecko10=B<20051111;}else A.IsGecko10=false;})(Co_BrowserInfo);
var Co_Tools={WindowLoaded:false};
Co_Tools.GetWindowScroll=function(win){if(!win)win=window;var x=0,y=0;
  if(typeof(win.pageYOffset)=='number'){y=win.pageYOffset;x=win.pageXOffset;}
	else if(win.document.body&&(win.document.body.scrollLeft||win.document.body.scrollTop)){y=win.document.body.scrollTop;x=win.document.body.scrollLeft;}
	else if(win.document.documentElement&&(win.document.documentElement.scrollLeft||win.document.documentElement.scrollTop)){y=win.document.documentElement.scrollTop;x=win.document.documentElement.scrollLeft;}
  return [x,y];
};
Co_Tools.GetWindowScrollX=function(win){return this.GetWindowScroll(win)[0];};
Co_Tools.GetWindowScrollY=function(win){return this.GetWindowScroll(win)[1];};
Co_Tools.GetViewportDimensions = function(win)
{
	if (typeof(window.innerWidth) != 'undefined')
	{
		return [window.innerWidth, window.innerHeight];
	}
	else if (typeof(document.documentElement) != 'undefined' && typeof(document.documentElement.clientWidth) != 'undefined' && document.documentElement.clientWidth != 0)
	{
		return [document.documentElement.clientWidth, document.documentElement.clientHeight];
	}
	else
	{
		return [document.getElementsByTagName('body')[0].clientWidth, document.getElementsByTagName('body')[0].clientHeight];
	}
};
Co_Tools.GetWindowDimensions=function(win){if(!win)win=window;var w=0,h=0;
  if(typeof(win.innerWidth)=='number') {w=win.innerWidth;h=win.innerHeight;}
	else if(win.document.documentElement && (win.document.documentElement.clientWidth||win.document.documentElement.clientHeight)) {w=win.document.documentElement.clientWidth;h=win.document.documentElement.clientHeight;}
	else if(win.document.body&&(win.document.body.clientWidth||win.document.body.clientHeight)){w=win.document.body.clientWidth;h=win.document.body.clientHeight;}
	return [w,h];
};
Co_Tools.GetWindowWidth=function(win){return this.GetWindowDimensions(win)[0];};
Co_Tools.GetWindowHeight=function(win){return this.GetWindowDimensions(win)[1];};
Co_Tools.GetObjectPosition=function(o, full){var t=l=0;
if(!o.offsetParent)
	return [l,t];
	t=o.offsetTop;l=o.offsetLeft;
	while(o = o.offsetParent)
	{
if ((o.parentNode.align=="center" && o.nodeName=="DIV") && !full){continue;}
t+=o.offsetTop;l+=o.offsetLeft;};return [l,t];}
Co_Tools.GetObjectPositionX=function(o){return this.GetObjectPosition(o)[0];};
Co_Tools.GetObjectPositionY=function(o){return this.GetObjectPosition(o)[1];};
Co_Tools.AttachEvent=function(sourceObject, eventName, listener){if (Co_BrowserInfo.IsIE) {sourceObject.attachEvent('on'+eventName, listener);}else {sourceObject.addEventListener(eventName, listener, false);}}
/* These events cannot yet be detached */
Co_Tools.AddEventListenerEx=Co_Tools.AddEventListener=function(sourceObject, eventName, listener, paramsArray, targetObject ){if (Co_BrowserInfo.IsIE) {var o=new Object();o.Source=targetObject||sourceObject;o.Params=paramsArray||[];/*Memory leak if we have DOM objects here.*/o.Listener=function(ev){return listener.apply(o.Source,[ev].concat(o.Params));};sourceObject.attachEvent('on'+eventName,o.Listener);sourceObject=null;paramsArray=null;}else {sourceObject.addEventListener(eventName,function(e){listener.apply(targetObject||sourceObject,[e].concat(paramsArray||[]));},false);};}
Co_Tools.RemoveEventListenerEx=function(sourceObject, eventName, listener) {}
Co_Tools.RemoveEventListener=Co_Tools.DetachEvent=function(sourceObject,eventName,listener){if(Co_BrowserInfo.IsIE){sourceObject.detachEvent('on'+eventName,listener);}else{sourceObject.removeEventListener(eventName,listener,false);}} 
Co_Tools.RunFunction=function(func,thisObject,paramsArray,timerWindow){if(func)this.SetTimeout(func,0,thisObject,paramsArray,timerWindow);}
Co_Tools.SetTimeout=function(func,milliseconds,thisObject,paramsArray,timerWindow){return (timerWindow||window).setTimeout(function(){if(paramsArray)func.apply(thisObject,[].concat(paramsArray));else func.apply(thisObject);},milliseconds);}
Co_Tools.SetInterval=function(func,milliseconds,thisObject,paramsArray,timerWindow){return (timerWindow||window).setInterval(function(){if(paramsArray)func.apply(thisObject,[].concat(paramsArray));else func.apply(thisObject);},milliseconds);}
Co_Tools.GetSelectedRadioIndex=Co_Tools.getSelectedRadioIndex=function(o){if (!typeof(o.length)=="undefined"){if (o.checked) return 0;};var i,ol;for (i=0,ol=o.length;i<ol;i++)if(o[i].checked)return i;return -1;}
Co_Tools.GetSelectedRadioItem=Co_Tools.getSelectedRadioItem=function(o){var idx=this.getSelectedRadioIndex(o);if(idx>=0)return o[idx];else return null;}
Co_Tools.ToggleSelect_if_IE=function(b_visible,ignore_objects){var s_visible = (b_visible?"visible":"hidden");if (typeof(ignore_objects) == "undefined")ignore_objects = false;if (!document.getElementsByTagName)return;if (Co_BrowserInfo.IsIE){if(!document.all)return;var o = document.getElementsByTagName("SELECT");for (var i=0;i<o.length;i++){if (o[i].getAttribute("do_not_hide") != "true")o[i].style.visibility=s_visible;}if(ignore_objects)return;var o=document.getElementsByTagName("OBJECT");for(var i=0;i<o.length;i++)o[i].style.visibility=s_visible;} else if(!ignore_objects) {var o=document.getElementsByTagName("OBJECT");for(var i=0;i<o.length;i++)o[i].style.visibility=s_visible;}}
Co_Tools.getChildElementById=Co_Tools.getChildElementByID=function(s_id, node){
	var ret;var nl=node.childNodes.length;if(nl==0)return null;
	for(var i=0;i<nl;i++)
	{
		if(i==0)node=node.firstChild;
		else node=node.nextSibling;
		if(node==null)return null;
		if(node.nodeType == 3 || node.nodeType == 8)continue;
		if(node.id.toLowerCase()==s_id.toLowerCase()){return node;}
		else if (node.childNodes.length>0){ret=this.getChildElementById(s_id,node);}
		if(ret)return ret;
	};return null;
};
Co_Tools.formatCurrency=Co_Tools.FormatCurrency=function(n,symbol){if(!symbol)symbol="$";n=n.toString().replace(/\$|\,/g,'');dblValue=parseFloat(n);blnSign=(dblValue==(dblValue=Math.abs(dblValue)));dblValue=Math.floor(dblValue*100+0.50000000001);intCents=dblValue%100;strCents=intCents.toString();dblValue=Math.floor(dblValue/100).toString();if(intCents<10)strCents="0"+strCents;for(var i=0;i<Math.floor((dblValue.length-(1+i))/3);i++)dblValue=dblValue.substring(0,dblValue.length-(4*i+3))+','+dblValue.substring(dblValue.length-(4*i+3));return (((blnSign)?'':'-')+symbol+dblValue+'.'+strCents);}

if (typeof(addDOMLoadEvent) == "undefined")
{
	addDOMLoadEvent = function(func) {
	   if (!window.__load_events) {
	      var init = function () {if (arguments.callee.done) return;arguments.callee.done = true;
	          if (window.__load_timer) {clearInterval(window.__load_timer);window.__load_timer = null;}
	          for (var i=0;i < window.__load_events.length;i++) {window.__load_events[i]();}
	          window.__load_events = null;
	      };
	   
	      // for Mozilla/Opera9
	      if (document.addEventListener) {document.addEventListener("DOMContentLoaded", init, false);}
	      
	      // for Internet Explorer
	      /*@cc_on @*/
	      /*@if (@_win32)
	          document.write("<scr"+"ipt id=__ie_onload defer src=//0><\/scr"+"ipt>");
	          var script = document.getElementById("__ie_onload");
	          script.onreadystatechange = function() {
	              if (this.readyState == "complete") {
	                  init(); // call the onload handler
	              }
	          };
	      /*@end @*/
	      if (/WebKit/i.test(navigator.userAgent)) { // sniff
	          window.__load_timer = setInterval(function() {if (/loaded|complete/.test(document.readyState)) {init();}}, 10);
	      }
				window.__load_events = [];
				if (typeof(window.onload)=='function') window.__load_events.push(window.onload);
	      window.onload = init;
	   }
	   window.__load_events.push(func);
	}
}
Co_Tools.AddEventListener(window, "load", function(){Co_Tools.WindowLoaded = true;});
Co_Tools.IsArray = function(obj)
{
	return (obj instanceof Array);
}
Co_Tools.GetObjectBoundaries = function(obj)
{
	var bcrect, od, odb, odde, dimensions = {"left": 0, "top": 0, "right": 0, "bottom": 0, "width": 0, "height": 0};

	if (obj)
	{
		od = obj.ownerDocument;
		odb = od.body;
		odde = od.documentElement;
		bcrect = obj.getBoundingClientRect();
		dimensions.left = bcrect.left;
		dimensions.top = bcrect.top;
		dimensions.right = bcrect.right;
		dimensions.bottom = bcrect.bottom;

		if(bcrect.width)
		{
			dimensions.width = bcrect.width;
			dimensions.height = bcrect.height;
		}
		else
		{
			dimensions.width = dimensions.right - dimensions.left;
			dimensions.height = dimensions.bottom - dimensions.top;
		}

		if(odb.scrollTop)
		{
			dimensions.top += odb.scrollTop;
			dimensions.left += odb.scrollLeft;
		}
		else if(odde && odde.scrollTop)
		{
			dimensions.top += odde.scrollTop;
			dimensions.left += odde.scrollLeft;
		}
		if (Co_BrowserInfo.IsIE)
		{
			dimensions.top -= 2;
			dimensions.left -= 2;
		}
	}
	return dimensions;
};

//</script>
