(function($){$.fn.changePataContent=function(url){};
var closePataContent=function(){};
$(function(){function validateSubmitLinks()
{var valid=true;
if(!$('#addLinkForm input[name=link_title]').val())
{valid=false;
$('#activeFileName').addClass('active');
}
return valid;
}
$('#step2tab').click(function(){if(!validateSubmitLinks())return false;
$('#step2').css('display','block');
$('#step1').css('display','none');
$('#step1tab').removeClass('orangeStep').addClass('grayStep');
$(this).removeClass('grayStep').addClass('orangeStep');
});
$('#step1tab').click(function(){$('#step1').css('display','block');
$('#step2').css('display','none');
$('#step2tab').removeClass('orangeStep').addClass('grayStep');
$(this).removeClass('grayStep').addClass('orangeStep');
});
$('#linksSubmitBtn').click(function(){if(!validateSubmitLinks())return false;
$('#step2').css('display','block');
$('#step1').css('display','none');
$('#step1tab').removeClass('orangeStep').addClass('grayStep');
$('#step2tab').removeClass('grayStep').addClass('orangeStep');
return false;
});
$('#addLinkForm').submit(function(){return validateSubmitLinks();
});
$('#fileSubmitButton').click(function(){$('#addLinkForm').submit();
});
$('#step2 ul li a').click(function(){$('#step2 ul li a').removeClass('active');
$(this).addClass("active");
$('#addLinkForm input[name=link_linkcat_id]').val($(this).attr('href').substring(1));
return false;
});
var filter=0;
var sort=0;
var type=0;
var page=1;
function readyload(){var shares_params=$('#__shares').html().split("|");
$('#resultsCount').html($('#__total').html());
var total=shares_params.length/2;
for(i=0;
i<total;
i++)
$("ul[id=shares] a[href=#"+shares_params[i*2]+"] span").html("("+shares_params[i*2+1]+")");
$('div[class=pagination] a').click(function(){$('div[class=pagination] a').removeClass("active");
$(this).addClass("active");
page=$(this).attr('alt');
$('#mainResultsBlock').load('/jsfeed.php?click=filter_page&page='+page+'&request='+request+'&shares='+filter+'&sort='+sort+'&type='+type,readyload);
window.location.hash=filter+"/"+sort+"/"+type+"/"+page;
return false;
});
}
$('div[class=pagination] a').click(function(){$('div[class=pagination] a').removeClass("active");
$(this).addClass("active");
page=$(this).attr('alt');
$('#mainResultsBlock').load('/jsfeed.php?click=filter_page&page='+page+'&request='+request+'&shares='+filter+'&sort='+sort+'&type='+type,readyload);
window.location.hash=filter+"/"+sort+"/"+type+"/"+page;
return false;
});
$('ul[id=sortVariants] a').click(function(){var reg=/^.*#(.*)$/i;
var regArr=reg.exec($(this)[0]);
if(!regArr[1])return;
sort=parseInt(regArr[1]);
$('div[class=pagination] a').removeClass("active");
$('div[class=pagination] a[alt=1]').attr('class','active');
page=1;
$('#mainResultsBlock').load('/jsfeed.php?click=filter_sort&page='+page+'&request='+request+'&shares='+filter+'&sort='+sort+'&type='+type,readyload);
$('ul[id=sortVariants] a').removeClass("active");
$(this).addClass("active");
window.location.hash=filter+"/"+sort+"/"+type;
return false;
});
$('ul[id=typeSelector] a').click(function(){var reg=/^.*#(.*)$/i;
var regArr=reg.exec($(this)[0]);
if(!regArr[1])return;
$('ul[id=typeSelector] a').removeClass("active");
$(this).addClass("active");
type=parseInt(regArr[1]);
$('div[class=pagination] a').removeClass("active");
$('div[class=pagination] a[alt=1]').attr('class','active');
page=1;
$('#mainResultsBlock').load('/jsfeed.php?click=filter_type&page='+page+'&request='+request+'&shares='+filter+'&sort='+sort+'&type='+type,readyload);
window.location.hash=filter+"/"+sort+"/"+type;
return false;
});
$('ul[id=shares] a').click(function(){var reg=/^.*#(.*)$/i;
var regArr=reg.exec($(this)[0]);
if(!regArr[1])return;
filter=filter^Math.pow(2,parseInt(regArr[1]));
if(filter&Math.pow(2,regArr[1]))
$(this).addClass("active");
else
$(this).removeClass("active");
$('div[class=pagination] a').removeClass("active");
$('div[class=pagination] a[alt=1]').attr('class','active');
page=1;
$('#mainResultsBlock').load('/jsfeed.php?click=filter_share&page='+page+'&request='+request+'&shares='+filter+'&sort='+sort+'&type='+type,readyload);
window.location.hash=filter+"/"+sort+"/"+type;
return false;
});
if(window.location.hash)
{var sort_params=window.location.hash.substring(1).split("/");
if(sort_params[0]!=undefined)filter=sort_params[0];
if(sort_params[1]!=undefined)sort=sort_params[1];
if(sort_params[2]!=undefined)type=sort_params[2];
if(sort_params[3]!=undefined)page=sort_params[3];
$('#mainResultsBlock').load('/jsfeed.php?page='+page+'&request='+request+'&shares='+filter+'&sort='+sort+'&type='+type,readyload);
var total=$("ul[id=shares] a").length;
$('div[class=pagination] a').removeClass("active");
$('ul[id=typeSelector] a').removeClass("active");
$("ul[id=sortVariants] a[href=#"+sort+"]").attr('class','active');
$("ul[id=typeSelector] a[href=#"+type+"]").attr('class','active');
$('div[class=pagination] a[alt='+page+']').attr('class','active');
for(i=1;
i<=total;
i++)
{if(filter&Math.pow(2,i))
{$("ul[id=shares] a[href=#"+i+"]").attr('class','active');
}}};
$('#hideVideo').click(function(){$('#controlsVideo > span').hide();$('#videoResults').slideToggle();$('#hideVideo').toggle();$('#showVideo').toggle();});
$('#showVideo').click(function(){$('#videoResults').slideToggle();$('#hideVideo').toggle();$('#showVideo').toggle(function(){$('#controlsVideo > span').show();});});
$('#hideDisc').click(function(){$('#controlsDisc > span').hide();$('#discResults').slideToggle();$('#hideDisc').toggle();$('#showDisc').toggle();});
$('#showDisc').click(function(){$('#discResults').slideToggle();$('#hideDisc').toggle();$('#showDisc').toggle(function(){$('#controlsDisc > span').show();});});
$('#hideGroup').click(function(){$('#controlsGroup > span').hide();$('#groupResults').slideToggle();$('#hideGroup').toggle();$('#showGroup').toggle();});
$('#showGroup').click(function(){$('#groupResults').slideToggle();$('#hideGroup').toggle();$('#showGroup').toggle(function(){$('#controlsGroup > span').show();});});
$('#hideSocialNetwork').click(function(){$('#controlsSocialNetwork > span').hide();
$('#socialNetworkResults').slideUp();
$('#hideSocialNetwork').toggle();
$('#showSocialNetwork').toggle();
});
$('#showSocialNetwork').click(function(){$('#socialNetworkResults').slideDown();
$('#hideSocialNetwork').toggle();
$('#showSocialNetwork').toggle(function(){$('#controlsSocialNetwork > span').show();
});
});
$('#hideOptions').click(function(){if(window.scrollanimation)return;
window.scrollanimation=true;
$('#leftColumn').hide("slow",function(){$('#centerColumn').css("margin-left","0");
$('#centerColumn').css("width","80%");
$('.videoList').css("width",750);
window.scrollanimation=false;
});
$('#hideOptions').toggle();
$('#showOptions').toggle();
});
$('#showOptions').click(function(){if(window.scrollanimation)return;
window.scrollanimation=true;
$('#centerColumn').css("width","63%");
$('#centerColumn').css("margin-left","176px");
$('#leftColumn').slideToggle("slow",function(){window.scrollanimation=false;
});
$('#hideOptions').toggle();
$('#showOptions').toggle();
$('.videoList').css("width",600);
});
$('#hideAdvancedSearch').click(function(){$('#hideAdvancedSearch').toggle();$('#showAdvancedSearch').toggle();});
$('#showAdvancedSearch').click(function(){$('#hideAdvancedSearch').toggle();$('#showAdvancedSearch').toggle();});
$('#bigDownloadButton').click(function(){$('#downloadTextarea').slideToggle("slow");});
$(".optionMenu > li > a").click(function(){$(this).toggleClass("expanded").toggleClass("collapsed").find("+ ul").slideToggle("medium");$(this).find("div").toggleClass("expand").toggleClass("collaps");});
$(".collectionMenu > li > a").click(function(){$(this).toggleClass("expanded").toggleClass("collapsed").find("+ ul").slideToggle("medium");$(this).find("div").toggleClass("expand").toggleClass("collaps");});
$(".upcomingLinksMenu > .additionalResults ").click(function(){$(this).find("div.subCategoryList").slideToggle("medium");});
function ScrollText(e){e.find(".linkName").animate({marginLeft:-e.find(".linkName").width()+e.width()-20,},5000,function(){e.find(".linkName").animate({marginLeft:0,},5000,function(){ScrollText(e);});});}
$(".longLink").live('mouseenter',function(){if($(this).find(".linkName").width()>$(this).width())ScrollText($(this));});
$('.longLink').live('mouseleave',function(){$(this).find(".linkName").css('margin-left',0);$(this).find(".linkName").stop();});
$('#logInButton').mouseenter(function(){$(".hiddenMenu").fadeIn();});
$('.hiddenMenu').mouseleave(function(){$(this).delay(function(){$(this).fadeOut();});}).mouseenter(function(){$(".hiddenMenu").fadeIn();});
$('#password').focusin(function(){$('#activePassword').addClass('active');}).focusout(function(){$('#activePassword').removeClass('active');});
$('#description').focusin(function(){$('#activeDescription').addClass('active');}).focusout(function(){$('#activeDescription').removeClass('active');});
$('#fileName').focusin(function(){$('#activeFileName').addClass('active');}).focusout(function(){$('#activeFileName').removeClass('active');});
$('#fileLink').focusin(function(){$('#activeFileLink').addClass('active');}).focusout(function(){$('#activeFileLink').removeClass('active');});
$('#searchFriends').focusin(function(){$('#activeSearch').addClass('active');}).focusout(function(){$('#activeSearch').removeClass('active');});
$('#signup_email').focusin(function(){$('#active_signup_email').addClass('active');}).focusout(function(){$('#active_signup_email').removeClass('active');});
$('#signup_password').focusin(function(){$('#active_signup_password').addClass('active');}).focusout(function(){$('#active_signup_password').removeClass('active');});
$('#signup_password2').focusin(function(){$('#active_signup_password2').addClass('active');}).focusout(function(){$('#active_signup_password2').removeClass('active');});
$('#signup_username').focusin(function(){$('#active_signup_username').addClass('active');}).focusout(function(){$('#active_signup_username').removeClass('active');});
$('#login_email').focusin(function(){$('#active_email').addClass('active');}).focusout(function(){$('#active_email').removeClass('active');});
$('#login_password').focusin(function(){$('#active_login_password').addClass('active');}).focusout(function(){$('#active_login_password').removeClass('active');});
$('#textMessage').focusin(function(){$('#active_textMessage').addClass('active');}).focusout(function(){$('#active_textMessage').removeClass('active');});
$("#daily").click(function(){if(window.scrollanimation)return;
window.scrollanimation=true;
$('.weekly').fadeOut("slow",function(){$('.monthly').fadeOut("slow",function(){$('.daily').fadeIn("slow");
window.scrollanimation=false;
})});
$("#monthly a").removeClass('active');
$("#weekly a").removeClass('active');
$(this).find("a").addClass('active');
});
$("#weekly").click(function(){if(window.scrollanimation)return;
window.scrollanimation=true;
$('.monthly').fadeOut("slow",function(){$('.daily').fadeOut("slow",function(){$('.weekly').fadeIn("slow");
window.scrollanimation=false;
})});
$("#daily a").removeClass('active');
$("#monthly a").removeClass('active');
$(this).find("a").addClass('active');
});
$("#monthly").click(function(){if(window.scrollanimation)return;
window.scrollanimation=true;
$('.weekly').fadeOut("slow",function(){$('.daily').fadeOut("slow",function(){$('.monthly').fadeIn("slow");
window.scrollanimation=false;
})});
$("#daily a").removeClass('active');
$("#weekly a").removeClass('active');
$(this).find("a").addClass('active');
});
$("#dailyTop").click(function(){if(window.scrollanimation)return;
window.scrollanimation=true;
$('.weeklyTop').fadeOut("slow",function(){$('.monthlyTop').fadeOut("slow",function(){$('.latestSearches').fadeOut("slow",function(){$('.dailyTop').fadeIn("slow");
window.scrollanimation=false;
})})});
$("#monthlyTop a").removeClass('active');
$("#weeklyTop a").removeClass('active');
$("#latestSearches a").removeClass('active');
$(this).find("a").addClass('active');
$('.flags').show("slow");
});
$("#weeklyTop").click(function(){if(window.scrollanimation)return;
window.scrollanimation=true;
$('.monthlyTop').fadeOut("slow",function(){$('.dailyTop').fadeOut("slow",function(){$('.latestSearches').fadeOut("slow",function(){$('.weeklyTop').fadeIn("slow");
window.scrollanimation=false;
})})});
$("#dailyTop a").removeClass('active');
$("#monthlyTop a").removeClass('active');
$("#latestSearches a").removeClass('active');
$(this).find("a").addClass('active');
$('.flags').show("slow");
});
$("#monthlyTop").click(function(){if(window.scrollanimation)return;
window.scrollanimation=true;
$('.weeklyTop').fadeOut("slow",function(){$('.dailyTop').fadeOut("slow",function(){$('.latestSearches').fadeOut("slow",function(){$('.monthlyTop').fadeIn("slow");
window.scrollanimation=false;
})})});
$("#dailyTop a").removeClass('active');
$("#latestSearches a").removeClass('active');
$("#weeklyTop a").removeClass('active');
$(this).find("a").addClass('active');
$('.flags').show("slow");
});
$("#latestSearches").click(function(){if(window.scrollanimation)return;
window.scrollanimation=true;
$('.weeklyTop').fadeOut("slow",function(){$('.dailyTop').fadeOut("slow",function(){$('.monthlyTop').fadeOut("slow",function(){$('.latestSearches').fadeIn("slow");
window.scrollanimation=false;
})})});
$("#dailyTop a").removeClass('active');
$("#weeklyTop a").removeClass('active');
$("#monthlyTop a").removeClass('active');
$(this).find("a").addClass('active');
$('.flags').hide("slow");
});
$("#upcoming").click(function(){if(window.scrollanimation)return;
window.scrollanimation=true;
$('.popular').fadeOut("slow",function(){$('.upcoming').fadeIn("slow");
window.scrollanimation=false;
});
$("#popular a").removeClass('active');
$(this).find("a").addClass('active');
});
$("#popular").click(function(){if(window.scrollanimation)return;
window.scrollanimation=true;
$('.upcoming').fadeOut("slow",function(){$('.popular').fadeIn("slow");
window.scrollanimation=false;
});
$("#upcoming a").removeClass('active');
$(this).find("a").addClass('active');
});
$("#newUsers").click(function(){if(window.scrollanimation)return;
window.scrollanimation=true;
$('.topUsers').fadeOut("slow",function(){$('.newUsers').fadeIn("slow");
window.scrollanimation=false;
});
$("#topUsers a").removeClass('active');
$(this).find("a").addClass('active');
});
$("#topUsers").click(function(){if(window.scrollanimation)return;
window.scrollanimation=true;
$('.newUsers').fadeOut("slow",function(){$('.topUsers').fadeIn("slow");
window.scrollanimation=false;
});
$("#newUsers a").removeClass('active');
$(this).find("a").addClass('active');
});
$("#newGroups").click(function(){if(window.scrollanimation)return;
window.scrollanimation=true;
$('.topGroups').fadeOut("slow",function(){$('.newGroups').fadeIn("slow");
window.scrollanimation=false;
});
$("#topGroups a").removeClass('active');
$(this).find("a").addClass('active');
});
$("#topGroups").click(function(){if(window.scrollanimation)return;
window.scrollanimation=true;
$('.newGroups').fadeOut("slow",function(){$('.topGroups').fadeIn("slow");
window.scrollanimation=false;
});
$("#newGroups a").removeClass('active');
$(this).find("a").addClass('active');
});
$('.menu_user ul li a').click(function(){$('.menu_user ul li a').removeClass('active');
$(this).addClass("active");
return false;
});
/*$("#myScrollVideo").mbScrollable({width:600,elementsInPage:4,elementMargin:0,height:"auto",controls:"#controlsVideo",slideTimer:1000,autoscroll:false,scrollTimer:100,nextCallback:closePataContent,prevCallback:closePataContent});
*/
$("#myScrollRelatedVideo").mbScrollable({width:750,elementsInPage:4,elementMargin:0,height:"auto",controls:"#controlsVideo",slideTimer:1000,autoscroll:false,scrollTimer:100,nextCallback:closePataContent,prevCallback:closePataContent});
$("#myScrollGroup").mbScrollable({width:600,elementsInPage:4,elementMargin:0,height:"auto",controls:"#controlsGroup",slideTimer:1000,autoscroll:false,scrollTimer:100,nextCallback:closePataContent,prevCallback:closePataContent});
});
/*$.widget("ui.combobox",{_create:function(){var self=this;
var select=this.element.hide();
var input=$("<input>").insertAfter(select).autocomplete({source:function(request,response){var matcher=new RegExp(request.term,"i");
response(select.children("option").map(function(){var text=$(this).text();
if(this.value&&(!request.term||matcher.test(text)))
return{id:this.value,label:text.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+$.ui.autocomplete.escapeRegex(request.term)+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>"),value:text};
}));
},delay:0,change:function(event,ui){if(!ui.item){$(this).val("");
return false;
}
select.val(ui.item.id);
self._trigger("selected",event,{item:select.find("[value='"+ui.item.id+"']")});
},minLength:0}).addClass("ui-widget-content ui-corner-left");
$("<button>&nbsp;</button>").attr("tabIndex",-1).attr("title","Show All Items").insertAfter(input).button({icons:{primary:"ui-icon-triangle-1-s"},text:false}).removeClass("ui-corner-all").addClass("ui-corner-right ui-button-icon").click(function(){if(input.autocomplete("widget").is(":visible")){input.autocomplete("close");
return;
}
input.autocomplete("search","");
input.focus();
});
}});
$(function(){$("#combobox").combobox();
});*/
$(function(){$('.bubbleInfo').each(function(){var distance=10;
var time=250;
var hideDelay=500;
var hideDelayTimer=null;
var beingShown=false;
var shown=false;
var trigger=$('.trigger',this);
var info=$('.popup',this).css('opacity',0);
$([trigger.get(0),info.get(0)]).mouseover(function(){if(hideDelayTimer)clearTimeout(hideDelayTimer);
if(beingShown||shown){return;
}else{beingShown=true;
info.css({bottom:20,left:33,display:'block'}).animate({bottom:'+='+distance+'px',opacity:1},time,'swing',function(){beingShown=false;
shown=true;
});
}
return false;
}).mouseout(function(){if(hideDelayTimer)clearTimeout(hideDelayTimer);
hideDelayTimer=setTimeout(function(){hideDelayTimer=null;
info.animate({bottom:'+='+distance+'px',opacity:0},time,'swing',function(){shown=false;
info.css('display','none');
});
},hideDelay);
return false;
});
});
$('.socialUpBubbleInfo').each(function(){var distance=10;
var time=1000;
var hideDelay=500;
var hideDelayTimer=null;
var beingShown=false;
var shown=false;
var trigger=$('.trigger',this);
var info=$('.popup',this).css('opacity',0);
$([trigger.get(0),info.get(0)]).mouseover(function(){$(this).removeClass('onLoad');
if(hideDelayTimer)clearTimeout(hideDelayTimer);
if(beingShown||shown){return;
}else{beingShown=true;
;
trigger.find('img').css('z-index','160').animate({width:100,height:100,margin:-15});
info.css({bottom:40,left:-25,display:'block'}).animate({bottom:'+='+distance+'px',opacity:1},time,'swing',function(){beingShown=false;
shown=true;
});
}
return false;
}).mouseout(function(){trigger.find('img').css('z-index','1');
if(hideDelayTimer)clearTimeout(hideDelayTimer);
hideDelayTimer=setTimeout(function(){hideDelayTimer=null;
trigger.find('img').css('width','70px');
trigger.find('img').css('height','70px');
trigger.find('img').css('margin','0');
info.animate({bottom:'+='+distance+'px',opacity:0},time,'swing',function(){shown=false;
info.css('display','none');
});
},hideDelay);
return false;
});
});
$('.socialDownBubbleInfo').each(function(){var distance=10;
var time=1000;
var hideDelay=500;
var hideDelayTimer=null;
var beingShown=false;
var shown=false;
var trigger=$('.trigger',this);
var info=$('.popup',this).css('opacity',0);
$([trigger.get(0),info.get(0)]).mouseover(function(){$(this).removeClass('onLoad');
if(hideDelayTimer)clearTimeout(hideDelayTimer);
if(beingShown||shown){return;
}else{beingShown=true;
;
trigger.find('img').css('z-index','160').animate({width:100,height:100,margin:-15});
info.css({top:40,left:-25,display:'block'}).animate({top:'+='+distance+'px',opacity:1},time,'swing',function(){beingShown=false;
shown=true;
});
}
return false;
}).mouseout(function(){trigger.find('img').css('z-index','1');
if(hideDelayTimer)clearTimeout(hideDelayTimer);
hideDelayTimer=setTimeout(function(){hideDelayTimer=null;
trigger.find('img').css('width','70px');
trigger.find('img').css('height','70px');
trigger.find('img').css('margin','0');
info.animate({top:'+='+distance+'px',opacity:0},time,'swing',function(){shown=false;
info.css('display','none');
});
},hideDelay);
return false;
});
});
var instanse=false;
var file;
var state;
var maxLength=100;
function getStateOfChat(){$.ajax({type:"POST",url:"process.php",data:{'function':'getState','file':file},dataType:"json",success:function(data){state=data.state;
instanse=false;
},});
};
});
})(jQuery);

(function($){$.mbScrollable={plugin:"mb.scroller",author:"MB",version:"1.0",defaults:{dir:"horizontal",width:950,elementsInPage:4,elementMargin:2,shadow:false,height:"auto",controls:"#controls",slideTimer:600,autoscroll:false,scrollTimer:6000,nextCallback:function(){},prevCallback:function(){}},buildMbScrollable:function(options){return this.each(function(){this.options={};
$.extend(this.options,$.mbScrollable.defaults);
$.extend(this.options,options);
var mbScrollable=this;
var el=this;
this.isVertical=this.options.dir!="horizontal";
var controls=$(this.options.controls);
this.idx=1;
this.scrollTo=0;
this.elements=$(this).children();
this.elements.addClass("scrollEl");
controls.hide();
$(this).children().each(function(){$(this).wrap("<div class='SECont'></div>");
});
if(this.options.shadow){$(this.elements).css("-moz-box-shadow",this.options.shadow);
$(this.elements).css("-webkit-box-shadow",this.options.shadow);
}
this.elements=$(this).children();
var eip=this.options.elementsInPage<this.elements.size()?this.options.elementsInPage:this.elements.size();
if(this.isVertical){this.singleElDim=(this.options.height/eip)-this.options.elementMargin;
$(this.elements).css({marginBottom:this.options.elementMargin,height:this.singleElDim,width:this.options.width});
}else{this.singleElDim=(this.options.width/eip)-this.options.elementMargin;
$(this.elements).css({marginRight:this.options.elementMargin,width:this.singleElDim,display:"inline-block",float:"left"});
}
this.elementsDim=(this.singleElDim*this.elements.size())+(this.options.elementMargin*this.elements.size());
this.totalPages=Math.ceil(this.elements.size()/this.options.elementsInPage);
var adj=$.browser.safari&&el.options.elementsInPage>2?this.options.elementMargin/(this.options.elementsInPage):0;
if(this.isVertical)
$(mbScrollable).css({overflow:"hidden",height:this.options.height-adj,width:this.options.width,paddingRight:5,position:"relative"});
else
$(mbScrollable).css({overflow:"hidden",width:this.options.width-adj,height:this.options.height,paddingBottom:5,position:"relative"});
var mbscrollableStrip=$("<div class='scrollableStrip'/>").css({width:this.elementsDim,position:"relative"});
$(this.elements).wrapAll(mbscrollableStrip);
this.mbscrollableStrip=$(this).find(".scrollableStrip");
$(this.elements).hover(function(){if($(mbScrollable)[0].autoScrollActive)
$(mbScrollable).mbStopAutoscroll();
},function(){if($(mbScrollable)[0].autoScrollActive)
$(mbScrollable).mbAutoscroll();
});
if(this.options.autoscroll&&this.elements.size()>this.options.elementsInPage){this.autoScrollActive=true;
$(this).mbAutoscroll();
}
$(this).mbPageIndex();
$(mbScrollable).mbActivateControls();
setTimeout(function(){$(".scrollEl").fadeIn();
},1000);
$(mbScrollable).mbManageControls();
});
},mbNextPage:function(){var el=$(this).get(0);
if(el.idx==el.totalPages){$(this).mbManageControls();
return;
}
if(el.options.nextCallback)el.options.nextCallback();
var adj=$.browser.safari&&el.options.elementsInPage>2?el.options.elementMargin/el.options.elementsInPage:0;
el.scrollTo-=((el.singleElDim+el.options.elementMargin)*el.options.elementsInPage)-adj;
if(el.isVertical){if((el.scrollTo<-el.elementsDim+el.options.height))
el.scrollTo=-el.elementsDim+el.options.height;
$(el.mbscrollableStrip).animate({marginTop:el.scrollTo},el.options.slideTimer);
}else{if((el.scrollTo<-el.elementsDim+el.options.width))
el.scrollTo=-el.elementsDim+el.options.width;
$(el.mbscrollableStrip).animate({marginLeft:el.scrollTo},el.options.slideTimer);
}
el.idx+=1;
$(this).mbManageControls();
},mbPrevPage:function(){var el=$(this).get(0);
if(el.idx==1){$(this).mbManageControls();
return;
}
if(el.options.prevCallback)el.options.prevCallback();
var adj=$.browser.safari&&el.options.elementsInPage>2?el.options.elementMargin/el.options.elementsInPage:0;
el.scrollTo+=((el.singleElDim+el.options.elementMargin)*el.options.elementsInPage)+adj;
if(el.isVertical){if(el.scrollTo>=0)el.scrollTo=0;
$(el.mbscrollableStrip).animate({marginTop:el.scrollTo},el.options.slideTimer);
}else{if(el.scrollTo>=0)el.scrollTo=0;
$(el.mbscrollableStrip).animate({marginLeft:el.scrollTo},el.options.slideTimer);
}
el.idx-=1;
$(this).mbManageControls();
},mbFirstPage:function(){var el=$(this).get(0);
el.scrollTo=0;
if(el.isVertical){$(el.mbscrollableStrip).animate({marginTop:el.scrollTo},el.options.slideTimer);
}else{$(el.mbscrollableStrip).animate({marginLeft:el.scrollTo},el.options.slideTimer);
}
el.idx=1;
$(this).mbManageControls();
$(el).mbStopAutoscroll();
},mbLastPage:function(){var el=$(this).get(0);
if(el.isVertical){el.scrollTo=-el.elementsDim+el.options.height;
$(el.mbscrollableStrip).animate({marginTop:el.scrollTo},el.options.slideTimer);
}else{el.scrollTo=-el.elementsDim+el.options.width;
$(el.mbscrollableStrip).animate({marginLeft:el.scrollTo},el.options.slideTimer);
}
el.idx=el.totalPages;
$(this).mbManageControls();
$(el).mbStopAutoscroll();
},mbPageIndex:function(){var el=$(this).get(0);
var controls=$(el.options.controls);
var pages=controls.find(".pageIndex");
if(pages){function getPage(i){el.scrollTo=-((el.singleElDim+el.options.elementMargin)*(el.options.elementsInPage*(i-1)));
if(el.isVertical){if(el.scrollTo<-el.elementsDim+el.options.height)
el.scrollTo=-el.elementsDim+el.options.height;
$(el.mbscrollableStrip).animate({marginTop:el.scrollTo},el.options.slideTimer);
}else{if(el.scrollTo<-el.elementsDim+el.options.width)
el.scrollTo=-el.elementsDim+el.options.width;
$(el.mbscrollableStrip).animate({marginLeft:el.scrollTo},el.options.slideTimer);
}
el.idx=Math.floor(i);
$(el).mbManageControls();
}
var n=0;
for(var i=1;
i<=el.totalPages;
i++){n++;
var p=$("<span class='page'> "+n+" <\/span>").bind("click",function(){getPage($(this).html());
$(el).mbStopAutoscroll();
});
pages.append(p);
};
}},mbAutoscroll:function(){var dir="next";
var el=$(this).get(0);
if(el.autoscroll)return;
var timer=el.options.scrollTimer;
el.autoscroll=true;
el.auto=setInterval(function(){dir=el.idx==1?"next":el.idx==el.totalPages?"prev":dir;
if(dir=="next")
$(el).mbNextPage();
else
$(el).mbPrevPage();
},timer);
$(el).mbManageControls();
},mbStopAutoscroll:function(){var el=$(this).get(0);
el.autoscroll=false;
clearInterval(el.auto);
$(el).mbManageControls();
},mbActivateControls:function(){var mbScrollable=this;
var el=$(mbScrollable).get(0);
var controls=$(el.options.controls);
controls.find(".first").bind("click",function(){$(mbScrollable).mbFirstPage();
});
controls.find(".prev").bind("click",function(){$(mbScrollable).mbStopAutoscroll();
$(mbScrollable).mbPrevPage();
});
controls.find(".next").bind("click",function(){$(mbScrollable).mbStopAutoscroll();
$(mbScrollable).mbNextPage();
});
controls.find(".last").bind("click",function(){$(mbScrollable).mbLastPage();
});
controls.find(".start").bind("click",function(){$(mbScrollable).mbAutoscroll();
$(mbScrollable)[0].autoScrollActive=true;
});
controls.find(".stop").bind("click",function(){$(mbScrollable).mbStopAutoscroll();
$(mbScrollable)[0].autoScrollActive=false;
});
},mbManageControls:function(){var mbScrollable=this;
var el=$(mbScrollable).get(0);
var controls=$(el.options.controls);
if(el.elements.size()<=el.options.elementsInPage){controls.hide();
}else{controls.fadeIn();
}
if(el.idx==el.totalPages){controls.find(".last").addClass("disabled");
controls.find(".next").addClass("disabled");
}else{controls.find(".last").removeClass("disabled");
controls.find(".next").removeClass("disabled");
}
if(el.idx==1){controls.find(".first").addClass("disabled");
controls.find(".prev").addClass("disabled");
}else{controls.find(".first").removeClass("disabled");
controls.find(".prev").removeClass("disabled");
}
if(el.autoscroll){controls.find(".start").addClass("sel");
controls.find(".stop").removeClass("sel");
}else{controls.find(".start").removeClass("sel");
controls.find(".stop").addClass("sel");
}
controls.find(".page").removeClass("sel");
controls.find(".page").eq(el.idx-1).addClass("sel");
controls.find(".idx").html(el.idx+" / "+el.totalPages);
},goToPage:function(i){var el=$(this).get(0);
el.scrollTo=-((el.singleElDim+el.options.elementMargin)*(el.options.elementsInPage*(i-1)));
if(el.isVertical){if(el.scrollTo<-el.elementsDim+el.options.height)
el.scrollTo=-el.elementsDim+el.options.height;
$(el.mbscrollableStrip).animate({marginTop:el.scrollTo},el.options.slideTimer);
}else{if(el.scrollTo<-el.elementsDim+el.options.width)
el.scrollTo=-el.elementsDim+el.options.width;
$(el.mbscrollableStrip).animate({marginLeft:el.scrollTo},el.options.slideTimer);
}
el.idx=Math.floor(i);
},mbAddElement:function(n){var el=$(this).get(0);
var newEl=$(n);
newEl.addClass("scrollEl");
$(this).find(".scrollableStrip").append(newEl);
newEl.wrap("<div class='SECont'/>");
newEl.css({marginRight:el.options.elementMargin,width:el.singleElDim});
}};
$.fn.mbScrollable=$.mbScrollable.buildMbScrollable;
$.fn.mbNextPage=$.mbScrollable.mbNextPage;
$.fn.mbPrevPage=$.mbScrollable.mbPrevPage;
$.fn.mbFirstPage=$.mbScrollable.mbFirstPage;
$.fn.mbLastPage=$.mbScrollable.mbLastPage;
$.fn.mbPageIndex=$.mbScrollable.mbPageIndex;
$.fn.mbAutoscroll=$.mbScrollable.mbAutoscroll;
$.fn.mbStopAutoscroll=$.mbScrollable.mbStopAutoscroll;
$.fn.mbActivateControls=$.mbScrollable.mbActivateControls;
$.fn.mbManageControls=$.mbScrollable.mbManageControls;
$.fn.goToPage=$.mbScrollable.goToPage;
$.fn.mbAddElement=$.mbScrollable.mbAddElement;
})(jQuery);
(function($){$.fn.extend({scrollable:function(arg1,arg2,arg3){return this.each(function(){if(typeof arg1=="string"){var el=$.data(this,"scrollable");
el[arg1].apply(el,[arg2,arg3]);
}else{new $.scrollable(this,arg1,arg2);
}});
}});
$.scrollable=function(el,opts){$.data(el,"scrollable",this);
this.init(el,opts);
};
$.extend($.scrollable.prototype,{init:function(el,config){var self=this;
var opts={size:5,horizontal:false,activeClass:'active',speed:300,onSeek:null,items:'.items',prev:'.prev',next:'.next',navi:'.navi',naviItem:'span'};
this.opts=$.extend(opts,config);
var root=this.root=$(el);
var itemRoot=$(opts.items,root);
if(!itemRoot.length)itemRoot=root;
itemRoot.css({position:'relative',overflow:'hidden',visibility:'visible'});
itemRoot.children().wrapAll('<div class="__scrollable" style="position:absolute"/>');
this.wrap=itemRoot.children(":first");
this.wrap.css(opts.horizontal?"width":"height","200000em").after('<br clear="all"/>');
this.items=this.wrap.children();
this.index=0;
if(opts.horizontal){itemRoot.width(opts.size*(this.items.eq(1).offset().left-this.items.eq(0).offset().left)-2);
}else{itemRoot.height(opts.size*(this.items.eq(1).offset().top-this.items.eq(0).offset().top)-2);
}
if($.isFunction($.fn.mousewheel)){root.bind("mousewheel.scrollable",function(event,delta){self.move(-delta,50);
return false;
});
}
$(window).bind("keypress.scrollable",function(evt){if($(evt.target).parents(".__scrollable").length){if(opts.horizontal&&(evt.keyCode==37||evt.keyCode==39)){self.move(evt.keyCode==37?-1:1);
return false;
}
if(!opts.horizontal&&(evt.keyCode==38||evt.keyCode==40)){self.move(evt.keyCode==38?-1:1);
return false;
}}
return true;
});
this.items.each(function(index,arg){$(this).bind("click.scrollable",function(){self.click(index);
});
});
this.activeIndex=0;
$(opts.prev,root).click(function(){self.prev()});
$(opts.next,root).click(function(){self.next()});
$(opts.navi,root).each(function(){var navi=$(this);
var status=self.getStatus();
if(navi.is(":empty")){for(var i=0;
i<status.pages;
i++){var item=$("<"+opts.naviItem+"/>").attr("page",i).click(function(){var el=$(this);
el.parent().children().removeClass(opts.activeClass);
el.addClass(opts.activeClass);
self.setPage(el.attr("page"));
});
if(i==0)item.addClass(opts.activeClass);
navi.append(item);
}}else{navi.children().each(function(i){var item=$(this);
item.attr("page",i);
if(i==0)item.addClass(opts.activeClass);
item.click(function(){item.parent().children().removeClass(opts.activeClass);
item.addClass(opts.activeClass);
self.setPage(item.attr("page"));
});
});
}});
},click:function(index){var item=this.items.eq(index);
var klass=this.opts.activeClass;
if(!item.hasClass(klass)&&(index>=0||index<this.items.size())){var prev=this.items.eq(this.activeIndex).removeClass(klass);
item.addClass(klass);
this.seekTo(index-Math.floor(this.opts.size/2));
this.activeIndex=index;
}},getStatus:function(){var len=this.items.size();
var s={length:len,index:this.index,size:this.opts.size,pages:Math.floor(len/this.opts.size),page:Math.floor(this.index/this.opts.size)};
return s;
},seekTo:function(index,time){if(index<0)index=0;
index=Math.min(index,this.items.length-this.opts.size);
var item=this.items.eq(index);
if(item.size()==0)return false;
this.index=index;
if(this.opts.horizontal){var left=this.wrap.offset().left-item.offset().left;
this.wrap.animate({left:left},time||this.opts.speed);
}else{var top=this.wrap.offset().top-item.offset().top;
this.wrap.animate({top:top},time||this.opts.speed);
}
if($.isFunction(this.opts.onSeek)){this.opts.onSeek.call(this.getStatus());
}
var navi=$(this.opts.navi,this.root);
if(navi.length){var klass=this.opts.activeClass;
var page=Math.round(index/this.opts.size);
navi.children().removeClass(klass).eq(page).addClass(klass);
}
return true;
},move:function(offset,time){this.seekTo(this.index+offset,time);
},next:function(time){this.move(1,time);
},prev:function(time){this.move(-1,time);
},movePage:function(offset,time){this.move(this.opts.size*offset,time);
},setPage:function(index,time){this.seekTo(this.opts.size*index,time);
},prevPage:function(time){var page=Math.floor(this.index/this.opts.size);
this.seekTo(this.opts.size*(page-1),time);
},nextPage:function(time){var page=Math.floor(this.index/this.opts.size);
this.seekTo(this.opts.size*(page+1),time);
},begin:function(time){this.seekTo(0,time);
},end:function(time){this.seekTo(this.items.size()-this.opts.size,time);
}});
})(jQuery);
(function($){$.event.special.mousewheel={setup:function(){var handler=$.event.special.mousewheel.handler;
if($.browser.mozilla)
$(this).bind('mousemove.mousewheel',function(event){$.data(this,'mwcursorposdata',{pageX:event.pageX,pageY:event.pageY,clientX:event.clientX,clientY:event.clientY});
});
if(this.addEventListener)
this.addEventListener(($.browser.mozilla?'DOMMouseScroll':'mousewheel'),handler,false);
else
this.onmousewheel=handler;
},teardown:function(){var handler=$.event.special.mousewheel.handler;
$(this).unbind('mousemove.mousewheel');
if(this.removeEventListener)
this.removeEventListener(($.browser.mozilla?'DOMMouseScroll':'mousewheel'),handler,false);
else
this.onmousewheel=function(){};
$.removeData(this,'mwcursorposdata');
},handler:function(event){var args=Array.prototype.slice.call(arguments,1);
event=$.event.fix(event||window.event);
$.extend(event,$.data(this,'mwcursorposdata')||{});
var delta=0,returnValue=true;
if(event.wheelDelta)delta=event.wheelDelta/120;
if(event.detail)delta=-event.detail/3;
if($.browser.opera)delta=-event.wheelDelta;
event.data=event.data||{};
event.type="mousewheel";
args.unshift(delta);
args.unshift(event);
return $.event.handle.apply(this,args);
}};
$.fn.extend({mousewheel:function(fn){return fn?this.bind("mousewheel",fn):this.trigger("mousewheel");
},unmousewheel:function(fn){return this.unbind("mousewheel",fn);
}});
})(jQuery);
(function($){$(function(){$('form#info .slider label').each(function(){var labelColor='#999';
var restingPosition='5px';
$(this).css({'color':labelColor,'position':'absolute','top':'6px','left':restingPosition,'display':'inline','z-index':'99'});
var inputval=$(this).next().val();
var labelwidth=$(this).width();
var labelmove=labelwidth+5+'px';
if(inputval!==''){$(this).stop().animate({'left':'-'+labelmove},1);
}
$('input, textarea').focus(function(){var label=$(this).prev('label');
var width=$(label).width();
var adjust=width+5+'px';
var value=$(this).val();
if(value==''){label.stop().animate({'left':'-'+adjust},'fast');
}else{label.css({'left':'-'+adjust});
}}).blur(function(){var label=$(this).prev('label');
var value=$(this).val();
if(value==''){label.stop().animate({'left':restingPosition},'fast');
}});
});
});
})(jQuery);

