(function($){if(!document.defaultView||!document.defaultView.getComputedStyle){var oldCurCSS=jQuery.curCSS;jQuery.curCSS=function(elem,name,force){if(name!=="backgroundPosition"||!elem.currentStyle||elem.currentStyle[name]){return oldCurCSS.apply(this,arguments);}var style=elem.style;if(!force&&style&&style[name]){return style[name];}return oldCurCSS(elem,"backgroundPositionX",force)+" "+oldCurCSS(elem,"backgroundPositionY",force);};}})(jQuery);
(function($){function toArray(strg){strg=strg.replace(/left|top/g,"0px");strg=strg.replace(/right|bottom/g,"100%");strg=strg.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");var res=strg.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/);return[parseFloat(res[1],10),res[2],parseFloat(res[3],10),res[4]]}$.fx.step.backgroundPosition=function(fx){if(!fx.bgPosReady){var start=$.curCSS(fx.elem,"backgroundPosition");if(!start){start="0px 0px"}start=toArray(start);fx.start=[start[0],start[2]];var end=toArray(fx.options.curAnim.backgroundPosition);fx.end=[end[0],end[2]];fx.unit=[end[1],end[3]];fx.bgPosReady=true}var nowPosX=[];nowPosX[0]=((fx.end[0]-fx.start[0])*fx.pos)+fx.start[0]+fx.unit[0];nowPosX[1]=((fx.end[1]-fx.start[1])*fx.pos)+fx.start[1]+fx.unit[1];fx.elem.style.backgroundPosition=nowPosX[0]+" "+nowPosX[1]}})(jQuery);

//////////////////////////////////////////////////////////////////////////////////////////
this.vtip=function(){this.xOffset=-50;this.yOffset=-60;$(".vtip").unbind().hover(function(a){this.t=this.title;this.title="";this.top=(a.pageY+yOffset);this.left=(a.pageX+xOffset);$("body").append('<p id="vtip">'+this.t+"</p>");$("p#vtip #vtipArrow");$("p#vtip").css("top",this.top+"px").css("left",this.left+"px").fadeIn("slow")},function(){this.title=this.t;$("p#vtip").fadeOut("slow").remove()}).mousemove(function(a){this.top=(a.pageY+yOffset);this.left=(a.pageX+xOffset);$("p#vtip").css("top",this.top+"px").css("left",this.left+"px")})};jQuery(document).ready(function(a){vtip()});

$(document).ready(function() {


		// Animate plugin categories
		if ($('UL.VerticalBarContainer').length){
		$('UL.VerticalBarContainer li a')
		.css( {backgroundPosition: "130px 3px"} )
		.mouseenter(function(){
			$(this).stop()
				.animate(
					{backgroundPosition:"(160px 3px)"},
					{duration:200})
				.animate(
					{backgroundPosition:"(160px -30px)"},
					{duration:2})
				.animate(
					{backgroundPosition:"(130px -30px)"},
					{duration:200})
			})
		.mouseleave(function(){
			$(this).stop()
				.animate(
					{backgroundPosition:"(160px -30px)"},
					{duration:200})
				.animate(
					{backgroundPosition:"(160px 3px)"},
					{duration:2})
				.animate(
					{backgroundPosition:"(130px 3px)"},
					{duration:200})
			});
	}

		//////////////////////////////////////////////////////////////////////////////////////////
		//var countDiv = $("#HeaderArea ul.NavigationBarSimple > li").size();
//			for(index=0; index< countDiv ; index++)
//			{
//				$('#HeaderArea ul.NavigationBarSimple li:nth('+index+')').addClass("item_"+ index +"");
//			}
			
			//////////////////////////////////////////////////////////////////////////////////////////

//			$("a.trigger").click(function(){
//				$(this).toggleClass("active").next().slideToggle("slow");
//			});
//			
			//$("a.trigger").click(function() {
//						$(this).toggleClass("active").next().toggleClass("none");
//				});

			//////////////////////////////////////////////////////////////////////////////////////////
			//$(".LoginContainer .LoginForm").hide();
			$(".LoginContainer .LoginTitle").click(function(){
				$(this).toggleClass("active").next().slideToggle("slow");
			});


		
		//$('.LoginContainer').hover(function(){
//			$(this).stop().animate({'bottom' : '0'}, 500);
//		 }, function(){$(this).stop().animate({'bottom' : '-120px', 'left' : '11px'}, 700);
//		 });
		  
		  
		  //$('#top-center').click(function(){
//		  $(this).children('.front').stop().animate({'bottom' : '5px'}, 500);
//		 });
//		 
//		  $('#x').click(function(){
//			 $('#top-center').children('.front').stop().animate({'bottom' : '-150px', 'left' : '0px'}, 500);
//			 });


			//////////////////////////////////////////////////////////////////////////////////////////
			jQuery('.slider').jcarousel({
        		//wrap: 'circular'
    		});

			
			//////////////////////////////////////////////////////////////////////////////////////////
			$("tr.TrItem:odd").addClass("odd_item");
			
			$("#FullEvents td.Title:first").addClass("first_item");
			
		///////////////////////////////////////////////////////////////
		$("embed").attr("wmode", "opaque");
		
		// IE
		var embedTag;
		$("embed").each(function(i) {
			embedTag = $(this).attr("outerHTML");
			if ((embedTag != null) && (embedTag.length > 0)) {
				embedTag = embedTag.replace(/embed /gi, "embed wmode=\"opaque\" ");
				$(this).attr("outerHTML", embedTag);
			}
			else {
				$(this).wrap("<div></div>");
			}
		});

});


/*
Bookmark site
*/
function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}
