/* including part 0: email*/
var bugchars = '!#$^&*()+|}{[]?><~%:;/,=`"\'';
function CharsInBag(s)
{ var i;
var lchar="";
// Search through strings characters one by one.
// If character is not in bag.
for (i = 0; i < s.length; i++)
{
// Check that current character isnt whitespace.
var c = s.charAt(i);
if(i>0)lchar=s.charAt(i-1)
if (bugchars.indexOf(c) != -1 || (lchar=="." && c==".")) return false;
}
return true;
}
function isIntegerEmail(s)
{ var i;
for (i = 0; i < s.length; i++)
{
// Check that current character is not a number.
var c = s.charAt(i);
if ((c >= "0") && (c <= "9") && (c != ".")) return false;
}
// All characters are numbers.
return true;
}
function echeck(str) {
var at="@"
var dot="."
var lat=str.indexOf(at)
var lstr=str.length
var ldot=str.indexOf(dot)
var lastdot=str.lastIndexOf(dot)
if (str.indexOf(at)==-1){
return false
}
if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
return false
}
if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr || str.substring(lastdot+1)==""){
return false
}
if (str.indexOf(at,(lat+1))!=-1){
return false
}
if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
return false
}
if (str.indexOf(dot,(lat+2))==-1){
return false
}
if (str.indexOf(" ")!=-1){
return false
}
if(CharsInBag(str)==false){
return false
}
var arrEmail=str.split("@")
var ldot=arrEmail[1].indexOf(".")
if(isIntegerEmail(arrEmail[1].substring(ldot+1))==false){
return false
}
return true
}
function ValidateEmail(x){
var emailID=x
if ((emailID.value==null)||(emailID.value=="")){
emailID.focus()
return false
}
if (echeck(emailID.value)==false){
emailID.value=""
emailID.focus()
return false
}
return true
}
/* including part 1: phone*/
/**
* DHTML phone number validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
*/
// Declaring required variables
var digits = "0123456789";
// non-digit characters which are allowed in phone numbers
var phoneNumberDelimiters = "()- ";
// characters which are allowed in international phone numbers
// (a leading + is OK)
var validWorldPhoneChars = phoneNumberDelimiters + "+";
// Minimum no of digits in an international phone no.
var minDigitsInIPhoneNumber = 10;
function isInteger(s)
{ var i;
for (i = 0; i < s.length; i++)
{
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}
function trim(s)
{ var i;
var returnString = "";
// Search through strings characters one by one.
// If character is not a whitespace, append to returnString.
for (i = 0; i < s.length; i++)
{
// Check that current character isnt whitespace.
var c = s.charAt(i);
if (c != " ") returnString += c;
}
return returnString;
}
function stripCharsInBag(s, bag)
{ var i;
var returnString = "";
// Search through strings characters one by one.
// If character is not in bag, append to returnString.
for (i = 0; i < s.length; i++)
{
// Check that current character isnt whitespace.
var c = s.charAt(i);
if (bag.indexOf(c) == -1) returnString += c;
}
return returnString;
}
function checkInternationalPhone(strPhone){
var bracket=3
strPhone=trim(strPhone)
if(strPhone.indexOf("+")>1) return false
if(strPhone.indexOf("(")!=-1 && strPhone.indexOf(")")==-1)return false
if(strPhone.indexOf("(")==-1 && strPhone.indexOf(")")!=-1)return false
s=stripCharsInBag(strPhone,validWorldPhoneChars);
return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}
function ValidatePhone(y){
var Phone=y
if ((Phone.value==null)||(Phone.value=="")){
Phone.focus()
return false
}
if (checkInternationalPhone(Phone.value)==false){
Phone.value=""
Phone.focus()
return false
}
return true
}
/* including part 2: form*/
function clearText(thefield){
if (thefield.defaultValue == thefield.value) thefield.value = "";
thefield.style.color = "black";
}
function replaceText(thefield){
if (thefield.value == "") thefield.value = thefield.defaultValue;
thefield.style.color = "black";
}
function formfieldsCheck() {
var firstname = document.lawyerregistration1.firstname.value;
var lastname = document.lawyerregistration1.lastname.value;
var email = document.lawyerregistration1.email.value;
var email1 = document.lawyerregistration1.email1.value;
var password = document.lawyerregistration1.password.value;
var password1 = document.lawyerregistration1.password1.value;
var phone = document.lawyerregistration1.phone.value;
var state = document.lawyerregistration1.state.value;
var captcha = document.lawyerregistration1.captcha.value;
if (firstname == "" || firstname == "First Name") {
alert("Please enter your First Name.");
return false;
}
if (lastname == "" || lastname == "Last Name") {
alert("Please enter your Last Name.");
return false;
}
if (email == "" || email == "youremail@company.com" || ValidateEmail(document.lawyerregistration1.email) == false) {
alert("Please enter your email.");
return false;
}
if (email != email1 || ValidateEmail(document.lawyerregistration1.email) == false) {
alert("Your emails do not match.");
return false;
}
if (password == "" || password == "Password") {
alert("Please enter a password.");
return false;
}
if (password != password1) {
alert("Your passwords do not match.");
return false;
}
if (phone == "" || phone == "(555) 555-1234" || ValidatePhone(document.lawyerregistration1.phone) == false) {
alert("Please enter your phone number.");
return false;
}
if (state == 0 || state == null) {
alert("Please select a state.");
return false;
}
if (captcha == "") {
alert("Please enter the 4 characters displayed in the image");
return false;
}
}
function checkForm() {
if (formfieldsCheck() == false) ;
else document.lawyerregistration1.submit();
}
jQuery(document).ready(function($) {
$('#password-clear').show();
$('#password-password').hide();
$('#password-clear').focus(function() {
$('#password-clear').hide();
$('#password-password').show();
$('#password-password').focus();
});
$('#password-password').blur(function() {
if($('#password-password').val() == '') {
$('#password-clear').show();
$('#password-password').hide();
}
});
$('.default-value').each(function() {
var default_value = this.value;
$(this).focus(function() {
if(this.value == default_value) {
this.value = '';
}
});
$(this).blur(function() {
if(this.value == '') {
this.value = default_value;
}
});
});
});
jQuery(document).ready(function($) {
$('#password-clear-c').show();
$('#password-password-c').hide();
$('#password-clear-c').focus(function() {
$('#password-clear-c').hide();
$('#password-password-c').show();
$('#password-password-c').focus();
});
$('#password-password-c').blur(function() {
if($('#password-password-c').val() == '') {
$('#password-clear-c').show();
$('#password-password-c').hide();
}
});
$('.default-value').each(function() {
var default_value = this.value;
$(this).focus(function() {
if(this.value == default_value) {
this.value = '';
}
});
$(this).blur(function() {
if(this.value == '') {
this.value = default_value;
}
});
});
});
/* including part 3: jquery.mls.feedback.tabSlideout*/
//PLUGIN FOR MyLawSuit feedback form
//message variables
var thanksForFeedback = "Thanks for your feedback!";
var seeYaSoon = "
We will be in touch soon.
";
var popupWillBeClosed = "
Popup will be closed after
seconds
";
var host = "";
if(base_url != null && base_url != ""){
host = base_url;
}
var feedbackformcontent = 'Content '+
' '+
' We welcome your feedback, good or bad, as well as any suggestions you may have. '+
' ';
(function($){
$.fn.mls_feedback_CssJs = function() {
$("#slideoutdiv").css({"padding" : "20px", "width": "320px", "background": "#fff", "border": "#676767 1px solid", "font-family":"Arial, Helvetica, sans-serif", "height":"250px"});
$("#slideoutdiv .title").css({"border-bottom":"1px solid #cdc9c1", "padding-bottom":"10px", "margin-bottom":"10px"});
$("#slideoutdiv small").css({"font-size":"11px", "font-style":"italic", "color":"#b6b6b6", "margin-bottom":"20px", "display":"block"});
$("#slideoutdiv .formsmall").css({"width":"150px", "float":"left", "margin-bottom":"10px"});
$("#slideoutdiv .formbig").css({"width":"315px", "margin-bottom":"10px", "clear":"both"});
};
})(jQuery);
(function($){
$.fn.mls_feedback_Form = function() {
return this.each(function() {
var newDiv = document.createElement('div');
newDiv.setAttribute("class", "slide-out-div");
newDiv.setAttribute("id", "slideoutdiv");
newDiv.innerHTML = feedbackformcontent;
var newDivHelp = document.createElement('div');
newDivHelp.setAttribute("class", "slide-out-div");
newDivHelp.setAttribute("id", "slideoutdivHelp");
newDivHelp.setAttribute("style", "display:none");
$(this).append(newDiv);
$(newDiv).append(newDivHelp);
});
};
})(jQuery);
(function($){
$.fn.tabSlideOut = function(callerSettings) {
var settings = $.extend({
tabHandle: '.handle',
speed: 300,
action: 'click',
tabLocation: 'left',
topPos: '200px',
leftPos: '20px',
fixedPosition: false,
positioning: 'absolute',
pathToTabImage: null,
imageHeight: null,
imageWidth: null,
onLoadSlideOut: false
}, callerSettings||{});
settings.tabHandle = $(settings.tabHandle);
var obj = this;
if (settings.fixedPosition === true) {
settings.positioning = 'fixed';
} else {
settings.positioning = 'absolute';
}
//ie6 doesn't do well with the fixed option
if (document.all && !window.opera && !window.XMLHttpRequest) {
settings.positioning = 'absolute';
}
//set initial tabHandle css
if (settings.pathToTabImage != null) {
settings.tabHandle.css({
'background' : 'url('+settings.pathToTabImage+') no-repeat',
'width' : settings.imageWidth,
'height': settings.imageHeight
});
}
settings.tabHandle.css({
'display': 'block',
'textIndent' : '-99999px',
'outline' : 'none',
'position' : 'absolute'
});
obj.css({
'line-height' : '1',
'position' : settings.positioning
});
var properties = {
containerWidth: parseInt(obj.outerWidth(), 10) + 'px',
containerHeight: parseInt(obj.outerHeight(), 10) + 'px',
tabWidth: parseInt(settings.tabHandle.outerWidth(), 10) + 'px',
tabHeight: parseInt(settings.tabHandle.outerHeight(), 10) + 'px'
};
//set calculated css
if(settings.tabLocation === 'top' || settings.tabLocation === 'bottom') {
obj.css({'left' : settings.leftPos});
settings.tabHandle.css({'right' : 0});
}
if(settings.tabLocation === 'top') {
obj.css({'top' : '-' + properties.containerHeight});
settings.tabHandle.css({'bottom' : '-' + properties.tabHeight});
}
if(settings.tabLocation === 'bottom') {
obj.css({'bottom' : '-' + properties.containerHeight, 'position' : 'fixed'});
settings.tabHandle.css({'top' : '-' + properties.tabHeight});
}
if(settings.tabLocation === 'left' || settings.tabLocation === 'right') {
obj.css({
'height' : properties.containerHeight,
'top' : settings.topPos
});
settings.tabHandle.css({'top' : 0});
}
if(settings.tabLocation === 'left') {
obj.css({'left': '-' + properties.containerWidth});
settings.tabHandle.css({'right' : '-' + properties.tabWidth});
}
if(settings.tabLocation === 'right') {
obj.css({'right': '-' + properties.containerWidth});
settings.tabHandle.css({'left' : '-' + properties.tabWidth});
$('html').css('overflow-x', 'hidden');
}
//functions for animation events
settings.tabHandle.click(function(event){
event.preventDefault();
});
var slideIn = function() {
if (settings.tabLocation === 'top') {
obj.animate({top:'-' + properties.containerHeight}, settings.speed).removeClass('open');
} else if (settings.tabLocation === 'left') {
obj.animate({left: '-' + properties.containerWidth}, settings.speed).removeClass('open');
} else if (settings.tabLocation === 'right') {
obj.animate({right: '-' + properties.containerWidth}, settings.speed).removeClass('open');
} else if (settings.tabLocation === 'bottom') {
obj.animate({bottom: '-' + properties.containerHeight}, settings.speed).removeClass('open');
}
};
var slideOut = function() {
if (settings.tabLocation == 'top') {
obj.animate({top:'-3px'}, settings.speed).addClass('open');
} else if (settings.tabLocation == 'left') {
obj.animate({left:'-3px'}, settings.speed).addClass('open');
} else if (settings.tabLocation == 'right') {
obj.animate({right:'-3px'}, settings.speed).addClass('open');
} else if (settings.tabLocation == 'bottom') {
obj.animate({bottom:'-3px'}, settings.speed).addClass('open');
}
};
var clickScreenToClose = function() {
obj.click(function(event){
event.stopPropagation();
});
$(document).click(function(event){
if(event.target.className == null || event.target.className == "" || event.target.className != "formErrorContent"){
//close feedback validation bubbles if opened
$(".fnameformError").fadeOut(150,function(){
$(".fnameformError").remove();
});
$(".emailadrformError").fadeOut(150,function(){
$(".emailadrformError").remove();
});
$(".fbphoneformError").fadeOut(150,function(){
$(".fbphoneformError").remove();
});
$(".subjectformError").fadeOut(150,function(){
$(".subjectformError").remove();
});
$(".messageformError").fadeOut(150,function(){
$(".messageformError").remove();
});
slideIn();
}
});
};
var clickAction = function(){
settings.tabHandle.click(function(){
if (obj.hasClass('open')) {
//close validation bubbles if opened
$(".formError").fadeOut(150,function(){
$(".formError").remove();
})
slideIn();
} else {
slideOut();
}
});
clickScreenToClose();
};
var hoverAction = function(){
obj.hover(
function(){
slideOut();
},
function(){
slideIn();
});
settings.tabHandle.click(function(event){
if (obj.hasClass('open')) {
slideIn();
}
});
clickScreenToClose();
};
var slideOutOnLoad = function(){
slideIn();
setTimeout(slideOut, 500);
};
//choose which type of action to bind
if (settings.action === 'click') {
clickAction();
}
if (settings.action === 'hover') {
hoverAction();
}
if (settings.onLoadSlideOut) {
slideOutOnLoad();
};
};
})(jQuery);
(function($){
$.fn.countDown = function(settings,to) {
settings = jQuery.extend({
startFontSize: '22px',
endFontSize: '22px',
duration: 1000,
startNumber: 10,
endNumber: 0,
callBack: function() { }
}, settings);
return this.each(function() {
//where do we start?
if(!to && to != settings.endNumber) { to = settings.startNumber; }
//set the countdown to the starting number
$(this).text(to).css('fontSize',settings.startFontSize);
//loopage
$(this).animate({
'fontSize': settings.endFontSize
},settings.duration,'',function() {
if(to > settings.endNumber + 1) {
$(this).css('fontSize',settings.startFontSize).text(to - 1).countDown(settings,to - 1);
}
else
{
settings.callBack(this);
}
});
});
};
})(jQuery);
//plugin for masked input for phone number
(function(a){var c=(a.browser.msie?"paste":"input")+".mask";var b=(window.orientation!=undefined);a.mask={definitions:{"9":"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"}};a.fn.extend({caret:function(e,f){if(this.length==0){return}if(typeof e=="number"){f=(typeof f=="number")?f:e;return this.each(function(){if(this.setSelectionRange){this.focus();this.setSelectionRange(e,f)}else{if(this.createTextRange){var g=this.createTextRange();g.collapse(true);g.moveEnd("character",f);g.moveStart("character",e);g.select()}}})}else{if(this[0].setSelectionRange){e=this[0].selectionStart;f=this[0].selectionEnd}else{if(document.selection&&document.selection.createRange){var d=document.selection.createRange();e=0-d.duplicate().moveStart("character",-100000);f=e+d.text.length}}return{begin:e,end:f}}},unmask:function(){return this.trigger("unmask")},mask:function(j,d){if(!j&&this.length>0){var f=a(this[0]);var g=f.data("tests");return a.map(f.data("buffer"),function(l,m){return g[m]?l:null}).join("")}d=a.extend({placeholder:"_",completed:null},d);var k=a.mask.definitions;var g=[];var e=j.length;var i=null;var h=j.length;a.each(j.split(""),function(m,l){if(l=="?"){h--;e=m}else{if(k[l]){g.push(new RegExp(k[l]));if(i==null){i=g.length-1}}else{g.push(null)}}});return this.each(function(){var r=a(this);var m=a.map(j.split(""),function(x,y){if(x!="?"){return k[x]?d.placeholder:x}});var n=false;var q=r.val();r.data("buffer",m).data("tests",g);function v(x){while(++x<=h&&!g[x]){}return x}function t(x){while(!g[x]&&--x>=0){}for(var y=x;y16&&z<32)||(z>32&&z<41));if((x.begin-x.end)!=0&&(!n||z==8||z==46)){w(x.begin,x.end)}if(z==8||z==46||(b&&z==127)){t(x.begin+(z==46?0:-1));return false}else{if(z==27){r.val(q);r.caret(0,p());return false}}}function o(B){if(n){n=false;return(B.keyCode==8)?false:null}B=B||window.event;var C=B.charCode||B.keyCode||B.which;var z=a(this).caret();if(B.ctrlKey||B.altKey||B.metaKey){return true}else{if((C>=32&&C<=125)||C>186){var x=v(z.begin-1);if(xz.length){break}}else{if(m[B]==z[x]&&B!=e){x++;C=B}}}if(!y&&C+1=e){s();if(!y){r.val(r.val().substring(0,C+1))}}}return(e?B:i)}if(!r.attr("readonly")){r.one("unmask",function(){r.unbind(".mask").removeData("buffer").removeData("tests")}).bind("focus.mask",function(){q=r.val();var x=p();s();setTimeout(function(){if(x==j.length){r.caret(0,x)}else{r.caret(x)}},0)}).bind("blur.mask",function(){p();if(r.val()!=q){r.change()}}).bind("keydown.mask",l).bind("keypress.mask",o).bind(c,function(){setTimeout(function(){r.caret(p(true))},0)})}p()})}})})(jQuery);
//MLS plugin implementation
var name = "Name:";
var emailadr = "Email:";
var subject = "Subject:";
var phone = "Phone:";
var message = "Message:";
$(document).ready(function() {
$("body").mls_feedback_Form();
$("head").mls_feedback_CssJs();
$('#slideoutdiv').tabSlideOut({
tabHandle: '.handle', //class of the element that will be your tab
pathToTabImage: host+'system/application/views/images/feedback_btn.png', //path to the image for the tab (optionaly can be set using css)
imageHeight: '137px', //height of tab image
imageWidth: '48px', //width of tab image
tabLocation: 'left', //side of screen where tab lives, top, right, bottom, or left
speed: 300, //speed of animation
action: 'click', //options: 'click' or 'hover', action to trigger animation
topPos: '290px', //position from the top
fixedPosition: false //options: true makes it stick(fixed position) on scroll
});
//css styling
//bring back the font color for default values
//name
if($("#fname").val() != name){
$("#fname").css("color","#000000");
}
else{
$("#fname").css("color","#666666");
}
$("#fname").bind("blur",function(){
if($(this).val() == name){
$(this).css("color","#666666");
}
});
//email
if($("#emailadr").val() != emailadr){
$("#emailadr").css("color","#000000");
}
else{
$("#emailadr").css("color","#666666");
}
$("#emailadr").bind("blur",function(){
if($(this).val() == emailadr){
$(this).css("color","#666666");
}
});
//phone
if($("#fbphone").val() != phone){
$("#fbphone").css("color","#000000");
}
else{
$("#fbphone").css("color","#666666");
}
$("#fbphone").bind("blur",function(){
if($(this).val() == phone){
$(this).css("color","#666666");
}
});
//subject
if($("#subject").val() != subject){
$("#subject").css("color","#000000");
}
else{
$("#subject").css("color","#666666");
}
$("#subject").bind("blur",function(){
if($(this).val() == subject){
$(this).css("color","#666666");
}
});
//message
if($("#message").val() != message){
$("#message").css("color","#000000");
}
else{
$("#message").css("color","#666666");
}
$("#message").bind("blur",function(){
if($(this).val() == message){
$(this).css("color","#666666");
}
});
//mask definition
$("#fbphone").mask("(999) 999-9999");
if( $("#fbphone").val() == "" ){
$("#fbphone").val(phone);
}
$("#fbphone").bind("blur.mask", function(){
if( $("#fbphone").val() == "" ){
$("#fbphone").val(phone).css("color","#666666");
}
});
//validations
$("#feedbackform").validationEngine();
//binding submit event
$("#submitlink").bind("click", function(){
$("#feedbackform").submit();
})
$("#feedbackform").bind("submit", function() {
if($('#fname').val() == '' || $('#fname').val() == name){
$('#fname').val('');
$.validationEngine.loadValidation("#fname");
}
if($('#emailadr').val() == '' || $('#emailadr').val() == emailadr){
$('#emailadr').val('');
$.validationEngine.loadValidation("#emailadr");
}
if($('#fbphone').val() == '' || $('#fbphone').val() == phone){
$('#fbphone').val('');
$.validationEngine.loadValidation("#fbphone");
}
if($('#subject').val() == '' || $('#subject').val() == subject){
$('#subject').val('');
$.validationEngine.loadValidation("#subject");
}
if($('#message').val() == '' || $('#message').val() == message){
$('#message').val('');
$.validationEngine.loadValidation("#message");
}
if($.validationEngine.isError){
return false;
}
else{
var fname = $("input#fname").val();
var emailad = $("input#emailadr").val();
var fbphone = $("input#fbphone").val();
var sub = $("input#subject").val();
var mess = $("textarea#message").val();
var dataString = 'name='+ fname + '&email=' + emailad + '&fbphone=' + fbphone + '&subject=' + sub + '&message=' +mess ;
$('#sendusfeedbackimg').hide();
$('#feedbackform').hide();
$('#slideoutdivHelp').show().html("");
$('#message2').html("
"+thanksForFeedback+"
")
.append(seeYaSoon+popupWillBeClosed);
$('#countdown').countDown({
startNumber: 5,
callBack: function() {
$('#message2').fadeOut(100, function(){
$(document).trigger("click");
$("input#fname").val(name).css("color","#666666");
$("input#emailadr").val(emailadr).css("color","#666666");
$("input#fbphone").val(phone).css("color","#666666");
$("input#subject").val(subject).css("color","#666666");
$("textarea#message").val(message).css("color","#666666");
$('#sendusfeedbackimg').show();
$('#feedbackform').show();
})
}
});
//submit form via ajax
$.ajax({
type: "POST",
url: host+"feedback", //please enter valid url for feedback
data: dataString,
success: function() {
}
});
return false;
}
});
});
/* including part 4: jquery.maskedinput-1.2.2.min*/
/*
Masked Input plugin for jQuery
Copyright (c) 2007-2009 Josh Bush (digitalbush.com)
Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license)
Version: 1.2.2 (03/09/2009 22:39:06)
*/
(function(a){var c=(a.browser.msie?"paste":"input")+".mask";var b=(window.orientation!=undefined);a.mask={definitions:{"9":"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"}};a.fn.extend({caret:function(e,f){if(this.length==0){return}if(typeof e=="number"){f=(typeof f=="number")?f:e;return this.each(function(){if(this.setSelectionRange){this.focus();this.setSelectionRange(e,f)}else{if(this.createTextRange){var g=this.createTextRange();g.collapse(true);g.moveEnd("character",f);g.moveStart("character",e);g.select()}}})}else{if(this[0].setSelectionRange){e=this[0].selectionStart;f=this[0].selectionEnd}else{if(document.selection&&document.selection.createRange){var d=document.selection.createRange();e=0-d.duplicate().moveStart("character",-100000);f=e+d.text.length}}return{begin:e,end:f}}},unmask:function(){return this.trigger("unmask")},mask:function(j,d){if(!j&&this.length>0){var f=a(this[0]);var g=f.data("tests");return a.map(f.data("buffer"),function(l,m){return g[m]?l:null}).join("")}d=a.extend({placeholder:"_",completed:null},d);var k=a.mask.definitions;var g=[];var e=j.length;var i=null;var h=j.length;a.each(j.split(""),function(m,l){if(l=="?"){h--;e=m}else{if(k[l]){g.push(new RegExp(k[l]));if(i==null){i=g.length-1}}else{g.push(null)}}});return this.each(function(){var r=a(this);var m=a.map(j.split(""),function(x,y){if(x!="?"){return k[x]?d.placeholder:x}});var n=false;var q=r.val();r.data("buffer",m).data("tests",g);function v(x){while(++x<=h&&!g[x]){}return x}function t(x){while(!g[x]&&--x>=0){}for(var y=x;y16&&z<32)||(z>32&&z<41));if((x.begin-x.end)!=0&&(!n||z==8||z==46)){w(x.begin,x.end)}if(z==8||z==46||(b&&z==127)){t(x.begin+(z==46?0:-1));return false}else{if(z==27){r.val(q);r.caret(0,p());return false}}}function o(B){if(n){n=false;return(B.keyCode==8)?false:null}B=B||window.event;var C=B.charCode||B.keyCode||B.which;var z=a(this).caret();if(B.ctrlKey||B.altKey||B.metaKey){return true}else{if((C>=32&&C<=125)||C>186){var x=v(z.begin-1);if(xz.length){break}}else{if(m[B]==z[x]&&B!=e){x++;C=B}}}if(!y&&C+1=e){s();if(!y){r.val(r.val().substring(0,C+1))}}}return(e?B:i)}if(!r.attr("readonly")){r.one("unmask",function(){r.unbind(".mask").removeData("buffer").removeData("tests")}).bind("focus.mask",function(){q=r.val();var x=p();s();setTimeout(function(){if(x==j.length){r.caret(0,x)}else{r.caret(x)}},0)}).bind("blur.mask",function(){p();if(r.val()!=q){r.change()}}).bind("keydown.mask",l).bind("keypress.mask",o).bind(c,function(){setTimeout(function(){r.caret(p(true))},0)})}p()})}})})(jQuery);
/* including part 5: jquery.modal*/
/*
* jqModal - Minimalist Modaling with jQuery
* (http://dev.iceburg.net/jquery/jqModal/)
*
* Copyright (c) 2007,2008 Brice Burgess
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* $Version: 03/01/2009 +r14
*/
(function($) {
$.fn.jqm=function(o){
var p={
overlay: 30,
overlayClass: 'jqmOverlay',
closeClass: 'jqmClose',
trigger: '.jqModal',
ajax: F,
ajaxText: '',
target: F,
modal: F,
toTop: F,
onShow: F,
onHide: F,
onLoad: F
};
return this.each(function(){if(this._jqm)return H[this._jqm].c=$.extend({},H[this._jqm].c,o);s++;this._jqm=s;
H[s]={c:$.extend(p,$.jqm.params,o),a:F,w:$(this).addClass('jqmID'+s),s:s};
if(p.trigger)$(this).jqmAddTrigger(p.trigger);
});};
$.fn.jqmAddClose=function(e){return hs(this,e,'jqmHide');};
$.fn.jqmAddTrigger=function(e){return hs(this,e,'jqmShow');};
$.fn.jqmShow=function(t){return this.each(function(){t=t||window.event;$.jqm.open(this._jqm,t);});};
$.fn.jqmHide=function(t){return this.each(function(){t=t||window.event;$.jqm.close(this._jqm,t);$(".jqmOverlay").remove();});};
$.jqm = {
hash:{},
open:function(s,t){var h=H[s],c=h.c,cc='.'+c.closeClass,z=(parseInt(h.w.css('z-index'))),z=(z>0)?z:3000,o=$('').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z-1,opacity:c.overlay/100});if(h.a)return F;h.t=t;h.a=true;h.w.css('z-index',z);
if(c.modal) {if(!A[0])L('bind');A.push(s);}
else if(c.overlay > 0)h.w.jqmAddClose(o);
else o=F;
h.o=(o)?o.addClass(c.overlayClass).fadeIn(200).prependTo('body'):F;
h.o.unbind("click");
if(ie6){$('html,body').css({height:'100%',width:'100%'});if(o){o=o.css({position:'absolute'})[0];for(var y in {Top:1,Left:1})o.style.setExpression(y.toLowerCase(),"(_=(document.documentElement.scroll"+y+" || document.body.scroll"+y+"))+'px'");}}
if(c.ajax) {var r=c.target||h.w,u=c.ajax,r=(typeof r == 'string')?$(r,h.w):$(r),u=(u.substr(0,1) == '@')?$(t).attr(u.substring(1)):u;
r.html(c.ajaxText).load(u,function(){if(c.onLoad)c.onLoad.call(this,h);if(cc)h.w.jqmAddClose($(cc,h.w));e(h);});}
else if(cc)h.w.jqmAddClose($(cc,h.w));
if(c.toTop&&h.o)h.w.before('').insertAfter(h.o);
(c.onShow)?c.onShow(h):h.w.show();
//positioning popup to be always visible without scrolling
var leftposition = 0;
var windowWidth = $(window).width();
var fboxpopupWidth = $("div[id^='facybox']").width();
leftposition = (windowWidth-fboxpopupWidth)/2;
if($.browser.mozilla){
leftposition = (windowWidth-fboxpopupWidth)/2;
}
if($.browser.msie && jQuery.browser.version == 8){
leftposition = (windowWidth-fboxpopupWidth)/2;
}
if($.browser.msie && jQuery.browser.version < 8){
leftposition = (windowWidth-fboxpopupWidth)/2;
}
if($.browser.msie && jQuery.browser.version == 7){
leftposition = (windowWidth-fboxpopupWidth)/2;
}
if($.browser.opera){
leftposition = (windowWidth-fboxpopupWidth)/2;
}
if($("div[id^=facybox]").length > 0){
var position = "'fixed'";
if( $("div[id^=facybox]").data("facyboxdata") != null && $("div[id^=facybox]").data("facyboxdata") != "undefined" && $("div[id^=facybox]").data("facyboxdata").page != null ){
position = "";
$( "html, body" ).animate( { scrollTop: 0 }, "slow" );
}
if($("div[id^=facybox]").data("facyboxdata") != null && $("div[id^=facybox]").data("facyboxdata") != undefined){
$page = $("div[id^=facybox]").data("facyboxdata").page;
if($page == "list_matchedlawyers" || $page == "list_biddedlawyers" || $page == "list_interestedlawyers"){
position = "absolute";
}
}
$("div[id^='facybox']").css({
//top: ($(window).scrollTop() + 50),
left: leftposition,
position: position,
top: 50
});
}
e(h);return F;
},
close:function(s){var h=H[s];if(!h.a)return F;h.a=F;
if(A[0]){A.pop();if(!A[0])L('unbind');}
if(h.c.toTop&&h.o)$('#jqmP'+h.w[0]._jqm).after(h.w).remove();
//fix for photo upload page
if ($("#cropbox").length > 0 && $('#newimagepath').val()!=''){
reload_image('#currentPhoto' , $('#newimagepath').val());
reload_image('#leftmenuuserimg' , $('#newimagepath').val());
}
if ($("#oldimagename").length > 0){
//Replace current image with the old image
$("#leftmenuuserimg").remove();
$("#userimgcell").html("");
$("#currentPhoto").remove();
$("#profilePic").html("");
//undoing new image path
$('#newimagepath').val("");
//update user data in db
$.post(base_url+"photoupload2/cancel_upload", { oldimagenameval: $("#oldimagename").val() });
}
if(h.c.onHide)h.c.onHide(h);
else{h.w.hide(200);
if(h.o){h.o.fadeOut(600)};
}return F;
},
params:{}};
var s=0,H=$.jqm.hash,A=[],ie6=$.browser.msie&&($.browser.version == "6.0"),F=false,
i=$('').css({opacity:0}),
e=function(h){if(ie6)if(h.o)h.o.html('').prepend(i);else if(!$('iframe.jqm',h.w)[0])h.w.prepend(i); /*f(h);*/},
//f=function(h){try{$(':input:visible',h.w)[0].focus();}catch(_){}},
L=function(t){$()[t]("keypress",m)[t]("keydown",m)[t]("mousedown",m);},
m=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.jqmID'+h.s)[0]);/*if(r)f(h);*/return !r;},
hs=function(w,t,c){return w.each(function(){var s=this._jqm;$(t).each(function() {
if(!this[c]){this[c]=[];$(this).click(function(){for(var i in {jqmShow:1,jqmHide:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return F;});}this[c].push(s);});});};
})(jQuery);
/* including part 6: jquery.modal2*/
/*
* jqModal - Minimalist Modaling with jQuery
* (http://dev.iceburg.net/jquery/jqModal/)
*
* Copyright (c) 2007,2008 Brice Burgess
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* $Version: 03/01/2009 +r14
*/
(function($) {
$.fn.jqm2=function(o){
var p={
overlay: 30,
overlayClass: 'jqmOverlay2',
closeClass: 'jqmClose2',
trigger: '.jqModal2',
ajax: F,
ajaxText: '',
target: F,
modal: F,
toTop: F,
onShow: F,
onHide: F,
onLoad: F
};
return this.each(function(){if(this._jqm2)return H[this._jqm2].c=$.extend({},H[this._jqm2].c,o);s++;this._jqm2=s;
H[s]={c:$.extend(p,$.jqm2.params,o),a:F,w:$(this).addClass('jqmID'+s),s:s};
if(p.trigger)$(this).jqmAddTrigger2(p.trigger);
});};
$.fn.jqmAddClose2=function(e){return hs(this,e,'jqmHide2');};
$.fn.jqmAddTrigger2=function(e){return hs(this,e,'jqmShow2');};
$.fn.jqmShow2=function(t){return this.each(function(){t=t||window.event;$.jqm2.open(this._jqm2,t);});};
$.fn.jqmHide2=function(t){return this.each(function(){t=t||window.event; $.jqm2.close(this._jqm2,t); $(".jqmOverlay2").remove(); });};
$.jqm2 = {
hash:{},
open:function(s,t){var h=H[s],c=h.c,cc='.'+c.closeClass,z=(parseInt(h.w.css('z-index'))),z=(z>0)?z:3000,o=$('').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z-1,opacity:c.overlay/100});if(h.a)return F;h.t=t;h.a=true;h.w.css('z-index',z);
if(c.modal) {if(!A[0])L('bind');A.push(s);}
else if(c.overlay > 0)h.w.jqmAddClose2(o);
else o=F;
h.o=(o)?o.addClass(c.overlayClass).fadeIn(200).prependTo('body'):F;
h.o.unbind("click");
if(ie6){$('html,body').css({height:'100%',width:'100%'});if(o){o=o.css({position:'absolute'})[0];for(var y in {Top:1,Left:1})o.style.setExpression(y.toLowerCase(),"(_=(document.documentElement.scroll"+y+" || document.body.scroll"+y+"))+'px'");}}
if(c.ajax) {var r=c.target||h.w,u=c.ajax,r=(typeof r == 'string')?$(r,h.w):$(r),u=(u.substr(0,1) == '@')?$(t).attr(u.substring(1)):u;
r.html(c.ajaxText).load(u,function(){if(c.onLoad)c.onLoad.call(this,h);if(cc)h.w.jqmAddClose2($(cc,h.w));e(h);});}
else if(cc)h.w.jqmAddClose2($(cc,h.w));
if(c.toTop&&h.o)h.w.before('').insertAfter(h.o);
(c.onShow)?c.onShow(h):h.w.show();
//positioning popup to be always visible without scrolling
var leftposition = 0;
var windowWidth = $(window).width();
var fboxpopupWidth = $('#fboxpopup2').width();
leftposition = (windowWidth-fboxpopupWidth)/2;
if($.browser.mozilla){
leftposition = (windowWidth-fboxpopupWidth)/2;
}
if($.browser.msie && jQuery.browser.version == 8){
leftposition = (windowWidth-fboxpopupWidth)/2;
}
if($.browser.msie && jQuery.browser.version < 8){
leftposition = (windowWidth-fboxpopupWidth)/2;
}
if($.browser.msie && jQuery.browser.version == 7){
leftposition = (windowWidth-fboxpopupWidth)/2;
}
if($.browser.opera){
leftposition = (windowWidth-fboxpopupWidth)/2;
}
/*if($('#facybox2').length > 0){
$('#facybox2').css({
//top: ($(window).scrollTop() + 50),
left: leftposition,
position: 'fixed',
top: 50
});
}*/
if($("div[id^=facybox]").length > 0){
var position = "'fixed'";
if( $("div[id^=facybox]").data("facyboxdata") != null && $("div[id^=facybox]").data("facyboxdata") != "undefined" && $("div[id^=facybox]").data("facyboxdata").page != null ){
position = "";
$( "html, body" ).animate( { scrollTop: 0 }, "slow" );
}
$("div[id^='facybox']").css({
left: leftposition,
position: position,
top: 50
});
}
e(h);return F;
},
close:function(s){var h=H[s];if(!h.a)return F;h.a=F;
if(A[0]){A.pop();if(!A[0])L('unbind');}
if(h.c.toTop&&h.o)$('#jqmP'+h.w[0]._jqm2).after(h.w).remove();
//open validation bubble if closed
if ($(".greenPopup").length > 0){
if( !$(".greenPopup").is(":visible") ){
$(".greenPopup").show();
}
}
//remove bubbles on popup if present
if($('#facybox2') != null){
removeBubbles();
}
if(h.c.onHide)h.c.onHide(h);
else{h.w.hide(200);if(h.o)h.o.fadeOut(600);
} return F;
},
params:{}};
var s=0,H=$.jqm2.hash,A=[],ie6=$.browser.msie&&($.browser.version == "6.0"),F=false,
i=$('').css({opacity:0}),
e=function(h){if(ie6)if(h.o)h.o.html('').prepend(i);else if(!$('iframe.jqm2',h.w)[0])h.w.prepend(i); /*f(h);*/},
//f=function(h){try{$(':input:visible',h.w)[0].focus();}catch(_){}},
L=function(t){$()[t]("keypress",m)[t]("keydown",m)[t]("mousedown",m);},
m=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.jqmID'+h.s)[0]);/*if(r)f(h);*/return !r;},
hs=function(w,t,c){return w.each(function(){var s=this._jqm2;$(t).each(function() {
if(!this[c]){this[c]=[];$(this).click(function(){for(var i in {jqmShow2:1,jqmHide2:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return F;});}this[c].push(s);});});};
})(jQuery);
/* including part 7: facybox*/
/*
* facybox (for jQuery)
* version: 1.0 (11/09/2009)
* @requires jQuery v1.2 or later
*
* Examples at http://bitbonsai.com/facybox/
*
* Licensed under the MIT:
* http://www.opensource.org/licenses/mit-license.php
*
* Copyright 2009 Mauricio Wolff [ chris@ozmm.org ]
*
* Usage:
*
* jQuery(document).ready(function() {
* jQuery('a[rel*=facybox]').facybox()
* })
*
* Terms
* Loads the #terms div in the box
*
* Terms
* Loads the terms.html page in the box
*
* Terms
* Loads the terms.png image in the box
*
*
* You can also use it programmatically:
*
* jQuery.facybox('some html')
* jQuery.facybox('some html', 'my-groovy-style')
*
* The above will open a facybox with "some html" as the content.
*
* jQuery.facybox(function($) {
* $.get('blah.html', function(data) { $.facybox(data) })
* })
*
* The above will show a loading screen before the passed function is called,
* allowing for a better ajaxy experience.
*
* The facybox function can also display an ajax page, an image, or the contents of a div:
*
* jQuery.facybox({ ajax: 'remote.html' })
* jQuery.facybox({ ajax: 'remote.html' }, 'my-groovy-style')
* jQuery.facybox({ image: 'stairs.jpg' })
* jQuery.facybox({ images: ['stairs.jpg','ballon.jpg'] })
* jQuery.facybox({ images: ['stairs.jpg','ballon.jpg'], initial:'ballon.jpg'})
* jQuery.facybox({ image: 'stairs.jpg' }, 'my-groovy-style')
* jQuery.facybox({ div: '#box' })
* jQuery.facybox({ div: '#box' }, 'my-groovy-style')
*
* Want to close the facybox? Trigger the 'close.facybox' document event:
*
* jQuery(document).trigger('close.facybox')
*
* facybox also has a bunch of other hooks:
*
* loading.facybox
* beforeReveal.facybox
* reveal.facybox (aliased as 'afterReveal.facybox')
* init.facybox
*
* Simply bind a function to any of these hooks:
*
* $(document).bind('reveal.facybox', function() { ...stuff to do after the facybox and contents are revealed... })
*
*/
;(function($) {
$.fn.fixPNG = function() {
return this.each(function () {
var image = $(this).css('backgroundImage');
if (image.match(/^url\(["']?(.*\.png)["']?\)$/i)) {
image = RegExp.$1;
$(this).css({
'backgroundImage': 'none',
'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=" + ($(this).css('backgroundRepeat') == 'no-repeat' ? 'crop' : 'scale') + ", src='" + image + "')"
}).each(function () {
var position = $(this).css('position');
if (position != 'absolute' && position != 'relative')
$(this).css('position', 'relative');
});
}
});
};
//TODO refactor using data.content_klass
$.facybox = function(data, klass) {
$.facybox.loading();
$.facybox.content_klass = klass;
if (data.ajax) revealAjax(data.ajax);
else if(data.image) revealImage(data.image);
else if(data.images) revealGallery(data.images,data.initial);
else if(data.div) revealHref(data.div);
else if($.isFunction(data)) data.call($);
else $.facybox.reveal(data);
}
/*
* Public, $.facybox methods
*/
$.extend($.facybox, {
//possible option: noAutoload --- will build facybox only when it is needed
settings: {
opacity : 0.3,
overlay : true,
modal : false,
imageTypes : [ 'png', 'jpg', 'jpeg', 'gif' ],
imageMimeTypes : [ 'image/jpeg', 'image/png', 'image/gif' ]
},
html : function(){
/**/
return '\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
'
},
loading: function(){
init();
if($('.loading',$('#facybox'))[0]) return;//already in loading state...
showOverlay();
$.facybox.wait();
if (!$.facybox.settings.modal) {
$(document).bind('keydown.facybox', function(e) {
if(e.keyCode == 27) $.facybox.close();//ESC
});
}
$(document).trigger('loading.facybox');
},
wait: function(){
var $f = $('#facybox');
$('.content',$f).empty();//clear out old content
$('.body',$f).children().hide().end().append('
');
$f.fadeIn('fast');
$.facybox.centralize();
$(document).trigger('reveal.facybox').trigger('afterReveal.facybox');
},
centralize: function(){
var $f = $('#facybox');
var pos = $.facybox.getViewport();
var wl = parseInt(pos[0]/2) - parseInt($f.find("table").width() / 2);
var fh = parseInt($f.height());
if(pos[1] > fh){
var t = (pos[3] + (pos[1] - fh)/2);
$f.css({ 'left': wl, 'top': t });
// console.log('height smaller then window: '+fh, pos[1], pos[3])
} else {
var t = (pos[3] + (pos[1] /10));
$f.css({ 'left': wl, 'top': t });
// console.log('height bigger then window')
}
},
getViewport: function() {
// [1009, 426, 0, 704]
return [$(window).width(), $(window).height(), $(window).scrollLeft(), $(window).scrollTop()];
},
reveal: function(content){
$(document).trigger('beforeReveal.facybox');
var $f = $('#facybox');
$('.content',$f)
.attr('class',($.facybox.content_klass||'')+' content') //do not simply add the new class, since on the next call the old classes would remain
.html(content);
$('.loading',$f).remove();
var $body = $('.body',$f);
$body.children().fadeIn('fast');
$.facybox.centralize();
$(document).trigger('reveal.facybox').trigger('afterReveal.facybox');
},
close: function(){
$(document).trigger('close.facybox');
return false;
}
})
/*
* Bind to links, on click they open a facybox which
* contains what their href points to
*/
$.fn.facybox = function(settings) {
var $this = $(this);
if(!$this[0]) return $this;//called on empty elements, just stop and continue chain
if(settings)$.extend($.facybox.settings, settings);
if(!$.facybox.settings.noAutoload) init();
$this.bind('click.facybox',function(){
$.facybox.loading();
// support for rel="facybox.inline_popup" syntax, to add a class
// also supports deprecated "facybox[.inline_popup]" syntax
var klass = this.rel.match(/facybox\[?\.(\w+)\]?/);
$.facybox.content_klass = klass ? klass[1] : '';
revealHref(this.href);
return false;
});
return $this;//continue chain
}
/*
* Private methods
*/
// called one time to setup facybox on this page
function init() {
if($.facybox.settings.inited) return;
else $.facybox.settings.inited = true;
$(document).trigger('init.facybox');
makeBackwardsCompatible();
var imageTypes = $.facybox.settings.imageTypes.join('|');
$.facybox.settings.imageTypesRegexp = new RegExp('\.(' + imageTypes + ')', 'i');
$('body').append($.facybox.html());//insert facybox to dom
// ie hacks
var $f = $("#facybox");
// it amazes me that this is still better than native png32 support in ie8...
if($.browser.msie){
$(".n, .s, .w, .e, .nw, .ne, .sw, .se", $f).fixPNG();
// ie6
if(parseInt($.browser.version) <= 6){
var css = ""
$('head').append(css);
$(".close", $f).fixPNG();
$(".close",$f).css({
'right': '15px'
});
}
$(".w, .e",$f).css({
width: '13px',
'font-size': '0'
}).text(" ");
}
//if we did not autoload, so the user has just clicked the facybox and pre-loading is useless
if(! $.facybox.settings.noAutoload){
preloadImages();
}
$('#facybox .close').click($.facybox.close);
}
//preloads all the static facybox images
function preloadImages(){
//TODO preload prev/next ?
$('#facybox').find('.n, .close , .s, .w, .e, .nw, ne, sw, se').each(function() {
var img = new Image();
img.src = $(this).css('background-image').replace(/url\((.+)\)/, '$1');
})
// var img = new Image();
// img.src = 'images/loading.gif';
/*
TODO: remove and load preloader from filament group
*/
}
function makeBackwardsCompatible() {
var $s = $.facybox.settings;
$s.imageTypes = $s.image_types || $s.imageTypes;
$s.facyboxHtml = $s.facybox_html || $s.facyboxHtml;
}
// Figures out what you want to display and displays it
// formats are:
// div: #id
// image: blah.extension
// ajax: anything else
function revealHref(href) {
// div
if(href.match(/#/)) {
var url = window.location.href.split('#')[0];
var target = href.replace(url,'');
if (target == '#') return
$.facybox.reveal($(target).html(), $.facybox.content_klass);
// image
} else if(href.match($.facybox.settings.imageTypesRegexp)) {
revealImage(href);
// ajax
} else { revealAjax(href)}
}
function revealGallery(hrefs, initial) {
//initial position
var position = $.inArray(initial||0,hrefs);
if(position ==-1){
position = 0;
}
//build navigation and ensure it will be removed
var $footer = $('#facybox div.footer');
$footer.append($('
'));
var $nav = $('#facybox .navigation');
$(document).bind('afterClose.facybox',function(){$nav.remove()});
function change_image(diff){
position = (position + diff + hrefs.length) % hrefs.length;
revealImage(hrefs[position]);
$nav.find('.counter').html(position +1+" / "+hrefs.length);
}
change_image(0);
//bind events
$('.prev',$nav).click(function(){change_image(-1)});
$('.next',$nav).click(function(){change_image(1)});
$(document).bind('keydown.facybox', function(e) {
if(e.keyCode == 39)change_image(1); // right
if(e.keyCode == 37)change_image(-1); // left
});
}
function revealImage(href){
var $f = $("#facybox");
$('#facybox .content').empty();
$.facybox.loading();//TODO loading must be shown until image is loaded -> stopLoading() on onload
var image = new Image();
image.onload = function() {
$.facybox.reveal('', $.facybox.content_klass);
var $footer = $("div.footer",$f);
var $content = $("div.content",$f);
var $navigation = $("div.navigation",$f);
var $next = $("a.next",$f);
var $prev = $("a.prev",$f);
var $counter = $("div.counter",$f);
var size = [$content.width(), $content.height()];
$footer.width(size[0]).height(size[1]);
$navigation.width(size[0]).height(size[1]);
$next.width(parseInt(size[0]/2)).height(size[1]).css({ left: (size[0]/2) });
$prev.width(size[0]/2).height(size[1]);
$counter.width(parseInt($f.width() -26)).css({'opacity' : 0.5, '-moz-border-radius' : '8px', '-webkit-border-radius' : '8px'})
}
image.src = href;
}
function revealAjax(href) {
// $.get(href, function(data) { $.facybox.reveal(data) });
$.ajax({
type: "GET",
url: href,
complete: function(XMLHttpRequest, textStatus) {
content_type = XMLHttpRequest.getResponseHeader("Content-Type");
if ( jQuery.inArray(content_type, $.facybox.settings.imageMimeTypes) >= 0 ) {
revealImage(href)
$.facybox.centralize();
} else {
$.facybox.reveal( XMLHttpRequest.responseText );
}
}
});
}
function skipOverlay() {
return $.facybox.settings.overlay == false || $.facybox.settings.opacity === null
}
function showOverlay() {
if(skipOverlay()) return;
if($('#facybox_overlay').length == 0){
$("body").append('');
}
$('#facybox_overlay').hide().addClass("facybox_overlayBG")
.css('opacity', $.facybox.settings.opacity)
.fadeIn(200);
if(!$.facybox.settings.modal){
$('#facybox_overlay').click(function(){ $(document).trigger('close.facybox')})
}
}
function hideOverlay() {
if(skipOverlay()) return;
$('#facybox_overlay').fadeOut(200, function(){
$("#facybox_overlay").removeClass("facybox_overlayBG").
addClass("facybox_hide").
remove();
})
}
/*
* Bindings
*/
$(document).bind('close.facybox', function() {
$(document).unbind('keydown.facybox');
// ie hacks
var $f = $("#facybox");
if($.browser.msie){
$('#facybox').hide();
hideOverlay();
$('#facybox .loading').remove();
} else {
$('#facybox').fadeOut('fast',function() {
$('#facybox .content').removeClass().addClass('content');//revert changing class
hideOverlay();
$('#facybox .loading').remove();
})
}
$(document).trigger('afterClose.facybox');
});
})(jQuery);
/* including part 8: jquery-ui-1.8.custom.min*/
/*!
* jQuery UI 1.8
*
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI
*//*
* jQuery UI 1.8
*
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI
*/
jQuery.ui||(function(a){a.ui={version:"1.8",plugin:{add:function(c,d,f){var e=a.ui[c].prototype;for(var b in f){e.plugins[b]=e.plugins[b]||[];e.plugins[b].push([d,f[b]])}},call:function(b,d,c){var f=b.plugins[d];if(!f||!b.element[0].parentNode){return}for(var e=0;e0){return true}e[b]=1;d=(e[b]>0);e[b]=0;return d},isOverAxis:function(c,b,d){return(c>b)&&(c<(b+d))},isOver:function(g,c,f,e,b,d){return a.ui.isOverAxis(g,f,b)&&a.ui.isOverAxis(c,e,d)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};a.fn.extend({_focus:a.fn.focus,focus:function(b,c){return typeof b==="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus();(c&&c.call(d))},b)}):this._focus.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var b;if((a.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){b=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(a.curCSS(this,"position",1))&&(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}else{b=this.parents().filter(function(){return(/(auto|scroll)/).test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!b.length?a(document):b},zIndex:function(e){if(e!==undefined){return this.css("zIndex",e)}if(this.length){var c=a(this[0]),b,d;while(c.length&&c[0]!==document){b=c.css("position");if(b=="absolute"||b=="relative"||b=="fixed"){d=parseInt(c.css("zIndex"));if(!isNaN(d)&&d!=0){return d}}c=c.parent()}}return 0}});a.extend(a.expr[":"],{data:function(d,c,b){return !!a.data(d,b[3])},focusable:function(c){var d=c.nodeName.toLowerCase(),b=a.attr(c,"tabindex");return(/input|select|textarea|button|object/.test(d)?!c.disabled:"a"==d||"area"==d?c.href||!isNaN(b):!isNaN(b))&&!a(c)["area"==d?"parents":"closest"](":hidden").length},tabbable:function(c){var b=a.attr(c,"tabindex");return(isNaN(b)||b>=0)&&a(c).is(":focusable")}})})(jQuery);;/*!
* jQuery UI Widget 1.8
*
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI/Widget
*//*
* jQuery UI Widget 1.8
*
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI/Widget
*/
(function(b){var a=b.fn.remove;b.fn.remove=function(c,d){return this.each(function(){if(!d){if(!c||b.filter(c,[this]).length){b("*",this).add(this).each(function(){b(this).triggerHandler("remove")})}}return a.call(b(this),c,d)})};b.widget=function(d,f,c){var e=d.split(".")[0],h;d=d.split(".")[1];h=e+"-"+d;if(!c){c=f;f=b.Widget}b.expr[":"][h]=function(i){return !!b.data(i,d)};b[e]=b[e]||{};b[e][d]=function(i,j){if(arguments.length){this._createWidget(i,j)}};var g=new f();g.options=b.extend({},g.options);b[e][d].prototype=b.extend(true,g,{namespace:e,widgetName:d,widgetEventPrefix:b[e][d].prototype.widgetEventPrefix||d,widgetBaseClass:h},c);b.widget.bridge(d,b[e][d])};b.widget.bridge=function(d,c){b.fn[d]=function(g){var e=typeof g==="string",f=Array.prototype.slice.call(arguments,1),h=this;g=!e&&f.length?b.extend.apply(null,[true,g].concat(f)):g;if(e&&g.substring(0,1)==="_"){return h}if(e){this.each(function(){var i=b.data(this,d),j=i&&b.isFunction(i[g])?i[g].apply(i,f):i;if(j!==i&&j!==undefined){h=j;return false}})}else{this.each(function(){var i=b.data(this,d);if(i){if(g){i.option(g)}i._init()}else{b.data(this,d,new c(g,this))}})}return h}};b.Widget=function(c,d){if(arguments.length){this._createWidget(c,d)}};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(d,e){this.element=b(e).data(this.widgetName,this);this.options=b.extend(true,{},this.options,b.metadata&&b.metadata.get(e)[this.widgetName],d);var c=this;this.element.bind("remove."+this.widgetName,function(){c.destroy()});this._create();this._init()},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled")},widget:function(){return this.element},option:function(e,f){var d=e,c=this;if(arguments.length===0){return b.extend({},c.options)}if(typeof e==="string"){if(f===undefined){return this.options[e]}d={};d[e]=f}b.each(d,function(g,h){c._setOption(g,h)});return c},_setOption:function(c,d){this.options[c]=d;if(c==="disabled"){this.widget()[d?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",d)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(d,e,f){var h=this.options[d];e=b.Event(e);e.type=(d===this.widgetEventPrefix?d:this.widgetEventPrefix+d).toLowerCase();f=f||{};if(e.originalEvent){for(var c=b.event.props.length,g;c;){g=b.event.props[--c];e[g]=e.originalEvent[g]}}this.element.trigger(e,f);return !(b.isFunction(h)&&h.call(this.element[0],e,f)===false||e.isDefaultPrevented())}}})(jQuery);;/*!
* jQuery UI Mouse 1.8
*
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI/Mouse
*
* Depends:
* jquery.ui.widget.js
*//*
* jQuery UI Mouse 1.8
*
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI/Mouse
*
* Depends:
* jquery.ui.widget.js
*/
(function(a){a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(c){return b._mouseDown(c)}).bind("click."+this.widgetName,function(c){if(b._preventClickEvent){b._preventClickEvent=false;c.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(d){d.originalEvent=d.originalEvent||{};if(d.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(d));this._mouseDownEvent=d;var c=this,e=(d.which==1),b=(typeof this.options.cancel=="string"?a(d.target).parents().add(d.target).filter(this.options.cancel).length:false);if(!e||b||!this._mouseCapture(d)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(d)&&this._mouseDelayMet(d)){this._mouseStarted=(this._mouseStart(d)!==false);if(!this._mouseStarted){d.preventDefault();return true}}this._mouseMoveDelegate=function(f){return c._mouseMove(f)};this._mouseUpDelegate=function(f){return c._mouseUp(f)};a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(a.browser.safari||d.preventDefault());d.originalEvent.mouseHandled=true;return true},_mouseMove:function(b){if(a.browser.msie&&!b.button){return this._mouseUp(b)}if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault()}if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,b)!==false);(this._mouseStarted?this._mouseDrag(b):this._mouseUp(b))}return !this._mouseStarted},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(b.target==this._mouseDownEvent.target);this._mouseStop(b)}return false},_mouseDistanceMet:function(b){return(Math.max(Math.abs(this._mouseDownEvent.pageX-b.pageX),Math.abs(this._mouseDownEvent.pageY-b.pageY))>=this.options.distance)},_mouseDelayMet:function(b){return this.mouseDelayMet},_mouseStart:function(b){},_mouseDrag:function(b){},_mouseStop:function(b){},_mouseCapture:function(b){return true}})})(jQuery);;/*
* jQuery UI Position 1.8
*
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI/Position
*/(function(f){f.ui=f.ui||{};var c=/left|center|right/,e="center",d=/top|center|bottom/,g="center",a=f.fn.position,b=f.fn.offset;f.fn.position=function(i){if(!i||!i.of){return a.apply(this,arguments)}i=f.extend({},i);var l=f(i.of),n=(i.collision||"flip").split(" "),m=i.offset?i.offset.split(" "):[0,0],k,h,j;if(i.of.nodeType===9){k=l.width();h=l.height();j={top:0,left:0}}else{if(i.of.scrollTo&&i.of.document){k=l.width();h=l.height();j={top:l.scrollTop(),left:l.scrollLeft()}}else{if(i.of.preventDefault){i.at="left top";k=h=0;j={top:i.of.pageY,left:i.of.pageX}}else{k=l.outerWidth();h=l.outerHeight();j=l.offset()}}}f.each(["my","at"],function(){var o=(i[this]||"").split(" ");if(o.length===1){o=c.test(o[0])?o.concat([g]):d.test(o[0])?[e].concat(o):[e,g]}o[0]=c.test(o[0])?o[0]:e;o[1]=d.test(o[1])?o[1]:g;i[this]=o});if(n.length===1){n[1]=n[0]}m[0]=parseInt(m[0],10)||0;if(m.length===1){m[1]=m[0]}m[1]=parseInt(m[1],10)||0;if(i.at[0]==="right"){j.left+=k}else{if(i.at[0]===e){j.left+=k/2}}if(i.at[1]==="bottom"){j.top+=h}else{if(i.at[1]===g){j.top+=h/2}}j.left+=m[0];j.top+=m[1];return this.each(function(){var r=f(this),q=r.outerWidth(),p=r.outerHeight(),o=f.extend({},j);if(i.my[0]==="right"){o.left-=q}else{if(i.my[0]===e){o.left-=q/2}}if(i.my[1]==="bottom"){o.top-=p}else{if(i.my[1]===g){o.top-=p/2}}f.each(["left","top"],function(t,s){if(f.ui.position[n[t]]){f.ui.position[n[t]][s](o,{targetWidth:k,targetHeight:h,elemWidth:q,elemHeight:p,offset:m,my:i.my,at:i.at})}});if(f.fn.bgiframe){r.bgiframe()}r.offset(f.extend(o,{using:i.using}))})};f.ui.position={fit:{left:function(h,i){var k=f(window),j=h.left+i.elemWidth-k.width()-k.scrollLeft();h.left=j>0?h.left-j:Math.max(0,h.left)},top:function(h,i){var k=f(window),j=h.top+i.elemHeight-k.height()-k.scrollTop();h.top=j>0?h.top-j:Math.max(0,h.top)}},flip:{left:function(i,j){if(j.at[0]==="center"){return}var l=f(window),k=i.left+j.elemWidth-l.width()-l.scrollLeft(),h=j.my[0]==="left"?-j.elemWidth:j.my[0]==="right"?j.elemWidth:0,m=-2*j.offset[0];i.left+=i.left<0?h+j.targetWidth+m:k>0?h-j.targetWidth+m:0},top:function(i,k){if(k.at[1]==="center"){return}var m=f(window),l=i.top+k.elemHeight-m.height()-m.scrollTop(),h=k.my[1]==="top"?-k.elemHeight:k.my[1]==="bottom"?k.elemHeight:0,j=k.at[1]==="top"?k.targetHeight:-k.targetHeight,n=-2*k.offset[1];i.top+=i.top<0?h+k.targetHeight+n:l>0?h+j+n:0}}};if(!f.offset.setOffset){f.offset.setOffset=function(l,i){if(/static/.test(f.curCSS(l,"position"))){l.style.position="relative"}var k=f(l),n=k.offset(),h=parseInt(f.curCSS(l,"top",true),10)||0,m=parseInt(f.curCSS(l,"left",true),10)||0,j={top:(i.top-n.top)+h,left:(i.left-n.left)+m};if("using" in i){i.using.call(l,j)}else{k.css(j)}};f.fn.offset=function(h){var i=this[0];if(!i||!i.ownerDocument){return null}if(h){return this.each(function(){f.offset.setOffset(this,h)})}return b.call(this)}}}(jQuery));;/*
* jQuery UI Draggable 1.8
*
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI/Draggables
*
* Depends:
* jquery.ui.core.js
* jquery.ui.mouse.js
* jquery.ui.widget.js
*/(function(a){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return}this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(b);if(!this.handle){return false}return true},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b);this._cacheHelperProportions();if(a.ui.ddmanager){a.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;(c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt));if(c.containment){this._setContainment()}if(this._trigger("start",b)===false){this._clear();return false}this._cacheHelperProportions();if(a.ui.ddmanager&&!c.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,b)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(b,true);return true},_mouseDrag:function(b,d){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!d){var c=this._uiHash();if(this._trigger("drag",b,c)===false){this._mouseUp({});return false}this.position=c.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(a.ui.ddmanager){a.ui.ddmanager.drag(this,b)}return false},_mouseStop:function(c){var d=false;if(a.ui.ddmanager&&!this.options.dropBehaviour){d=a.ui.ddmanager.drop(this,c)}if(this.dropped){d=this.dropped;this.dropped=false}if(!this.element[0]||!this.element[0].parentNode){return false}if((this.options.revert=="invalid"&&!d)||(this.options.revert=="valid"&&d)||this.options.revert===true||(a.isFunction(this.options.revert)&&this.options.revert.call(this.element,d))){var b=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(b._trigger("stop",c)!==false){b._clear()}})}else{if(this._trigger("stop",c)!==false){this._clear()}}return false},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp({})}else{this._clear()}return this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==b.target){c=true}});return c},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c])):(d.helper=="clone"?this.element.clone():this.element);if(!b.parents("body").length){b.appendTo((d.appendTo=="parent"?this.element[0].parentNode:d.appendTo))}if(b[0]!=this.element[0]&&!(/(fixed|absolute)/).test(b.css("position"))){b.css("position","absolute")}return b},_adjustOffsetFromHelper:function(b){if(typeof b=="string"){b=b.split(" ")}if(a.isArray(b)){b={left:+b[0],top:+b[1]||0}}if("left" in b){this.offset.click.left=b.left+this.margins.left}if("right" in b){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if("top" in b){this.offset.click.top=b.top+this.margins.top}if("bottom" in b){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)&&e.containment.constructor!=Array){var c=a(e.containment)[0];if(!c){return}var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}else{if(e.containment.constructor==Array){this.containment=e.containment}}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c)),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c))}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(b[0].tagName);var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.leftthis.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.topthis.containment[3])?g:(!(g-this.offset.click.topthis.containment[2])?f:(!(f-this.offset.click.left').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(a(this).offset()).appendTo("body")})},stop:function(b,c){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});a.ui.plugin.add("draggable","opacity",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("opacity")){e._opacity=b.css("opacity")}b.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._opacity){a(c.helper).css("opacity",d._opacity)}}});a.ui.plugin.add("draggable","scroll",{start:function(c,d){var b=a(this).data("draggable");if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){b.overflowOffset=b.scrollParent.offset()}},drag:function(d,e){var c=a(this).data("draggable"),f=c.options,b=false;if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){if(!f.axis||f.axis!="x"){if((c.overflowOffset.top+c.scrollParent[0].offsetHeight)-d.pageY=0;v--){var s=g.snapElements[v].left,n=s+g.snapElements[v].width,m=g.snapElements[v].top,A=m+g.snapElements[v].height;if(!((s-y=p&&n<=k)||(m>=p&&m<=k)||(n