	var KEY = {
	
		UP: 38,
		DOWN: 40,
		DEL: 46,
		TAB: 9,
		RETURN: 13,
		ESC: 27,
		COMMA: 188,
		PAGEUP: 33,
		PAGEDOWN: 34,
		BACKSPACE: 8
	};

var m_names_en = new Array("January", "February", "March","April", "May", "June", "July", "August", "September","October", "November", "December");
var m_names_fr = new Array("Janvier", "Fevrier", "Mars", "Avril", "Mai", "Juin", "Juillet", "Aout", "Septembre","Octobre", "Novembre", "Decembre");
var d_names_en = new Array("Sunday","Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
var d_names_fr = new Array("Dimanche","Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi");
var d_names={
	'en':d_names_en,
	'fr':d_names_fr
};
var m_names={
	'en':m_names_en,
	'fr':m_names_fr
};

var userCulture = 'en';

var _event = {};


 if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) {
 	var isTouchScreen = 1;
 	
 }else{
 	var isTouchScreen = 0;
 }

if (!Array.prototype.indexOf) {
	  Array.prototype.indexOf = function (obj, fromIndex) {
	    if (fromIndex == null) {
	        fromIndex = 0;
	    } else if (fromIndex < 0) {
	        fromIndex = Math.max(0, this.length + fromIndex);
	    }
	    for (var i = fromIndex, j = this.length; i < j; i++) {
	        if (this[i] === obj)
	            return i;
	    }
	    return -1;
	  };
	}




function include(arr,obj) {
    return (arr.indexOf(obj) != -1);
}

	function formatCurrency($val,$culture){
		
	 	switch($culture){
	 		case 'usd':
	 			return '$'+$val;
	 		case 'eur':
	 			return $val+'€';
	 		default:
	 			return '$'+$val; 
	 	}
		
	}


function Set_Cookie( name, value, expires, path, domain, secure )
{
	// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );
	
	/*
	if the expires variable is set, make the correct
	expires time, the current script below will set
	it for x number of days, to make it for hours,
	delete * 24, for minutes, delete * 60 * 24
	*/
	if ( expires )
	{
	expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );
	
	document.cookie = name + "=" +escape( value ) +
	( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
	( ( path ) ? ";path=" + path : "" ) +
	( ( domain ) ? ";domain=" + domain : "" ) +
	( ( secure ) ? ";secure" : "" );
}


function ValidateForm(id,email,url){
	
	var emailID=jQuery(email);
	
	if((emailID.val()==null)||(emailID.val()=="")){
		alert("Please enter a valid email address.");
		emailID.focus();
		return false;
	}
	if (echeck(emailID.val())==false){
		emailID.val('');
		emailID.focus();
		return false;
	}
	
	jQuery(id).load('/user/addemail',{email:emailID.val()});
	if(url==1) jQuery('.dw').remove();
	
}

function format2Digits(s){
	if(s<10){  return '0'+s; }else{ return s;}
}

	function displayPrice(price){
 		
 		if(!price || price==0) return 'Free';
 		if(!isNaN(price)){
 			if(price>0)
 				return '$'+price;
 			else
 				return 'N/A';
 		}else{
 			return price;
 		}
 	}	
	

function changeSelect(countryField,stateField,url,callBack){
	if(!callBack)callBack = function(){};
	var country = jQuery(countryField);
	country.unbind();
	country.bind('change',function(e){
		jQuery.ajax({url:url,
				 cache:false,
				 dataType:'json',
				 data:{id:country.val()},
				 success:function(data){
				 	var optionsselect='';
					jQuery.each(data,function(key,val)
					{
						optionsselect += '<option value='+key+'>'+val+'</option>';
						
					});	
					jQuery(stateField).html(optionsselect);
				
					//jQuery(stateField).change();
					callBack();
				 },
				 beforeSend: function(req){
 					jQuery('#barloader').show();
 				},
 				complete: function(req){
 					jQuery('#barloader').hide();
 				}
				});
	});
	country.bind('keyup',function(event){
		if ((event.which && event.which == 40) ||    (event.keyCode && event.keyCode == 40) || (event.which && event.which == 38) ||    (event.keyCode && event.keyCode == 38)){
		
		jQuery.ajax({url:url,
				 cache:false,
				 dataType:'json',
				 data:{id:country.val()},
				 success:function(data){
				 	var optionsselect='';
					jQuery.each(data,function(key,val)
					{
						optionsselect += '<option value='+key+'>'+val+'</option>';
					});	
					jQuery(stateField).html(optionsselect);
					jQuery(stateField).change();
					callBack();
				 },
				 beforeSend: function(req){
 					jQuery('#barloader').show();
 				},
 				complete: function(req){
 					jQuery('#barloader').hide();
 				}
				});
			}
	});
	
		
	
}

function addFormTooltip(id,options){
	var id = jQuery(id);
	
	if(!jQuery('#tooltip').length)jQuery('body').append('<div id=tooltip ><div id=tooltipContent></div><img src="/images/main/tooltip.png" ></div>');
	
	if(options) jQuery('#tooltip').css(options);
	
	id.each(function(key,val){
		var element = jQuery(val); 
		element.bind('mouseover focus',function(e){
			if(element.attr('tooltip')!= ''){
				jQuery('#tooltip').css({'top':element.offset().top-15,'left':element.offset().left+element.width()+10});
				jQuery('#tooltipContent').html(element.attr('tooltip'));
				jQuery('#tooltip').show();
			}
		});
		element.bind('blur mouseout',function(e){jQuery('#tooltip').hide();jQuery('#tooltipContent').html("");});
	}); 

}
function addFormTooltip2(id,options){
	var id = jQuery(id);
	
	if(!jQuery('#tooltip').length)jQuery('body').append('<div id=tooltip ><div id=tooltipContent></div><img src="/images/dealinium/tooltip.png" ></div>');
	
	if(options) jQuery('#tooltip').css(options);
	
	id.each(function(key,val){
		var element = jQuery(val); 
		element.bind('mouseover focus',function(e){
			if(element.attr('tooltip')!= ''){
				jQuery('#tooltip').css({'top':element.offset().top,'left':element.offset().left+element.outerWidth()+10});
				jQuery('#tooltipContent').html(element.attr('tooltip'));
				jQuery('#tooltip').show();
			}
		});
		element.bind('blur mouseout',function(e){jQuery('#tooltip').hide();jQuery('#tooltipContent').html("");});
	}); 

}

function customize(url,options){
	jQuery.ajax({
		url: url,
		data : options,
		success: function(data){}
	});

}

function rgbToHex(rgb) {
	if(rgb.substring(0,1)=='#'){
		return rgb;
	}
  var rgbvals = /rgb\((.+),(.+),(.+)\)/i.exec(rgb);
  var rval = parseInt(rgbvals[1]);
  var gval = parseInt(rgbvals[2]);
  var bval = parseInt(rgbvals[3]);
  return '#' + (
    rval.toString(16) +
    gval.toString(16) +
    bval.toString(16)
  ).toUpperCase();

} 


function removeLogo(url,target){
	jQuery.ajax({url:url,success:function(data){jQuery(target).attr('src',data);}});		
}
function removePicture(id){
	jQuery.ajax({url:'/photo/removePicture',
			data:{pId:id},
			success:function(data){
				jQuery('#thphoto_'+id).fadeToggle();
				}
	});
}



function wizard(target,url,step){
	jQuery.ajax({
		url:url,
		data:{step:step},
		success: function(data){
			jQuery(target).replaceWith(data);
		}
	});
}


function initTextField(classe){
	var elements = jQuery(classe);
	
	elements.each(function(key,val){	
		var element = jQuery(val);
		var msg = element.val();
		element.focus(function(e){
			if(element.val()==msg){	
				element.val('').css('color','#555555');
			}else{
				element.unbind('focus');
			}
				
		});
		element.mousedown(function(e){
			element.focus();
		});
	});
}

//// GOOGLE MAP
		var geocoder;
  		var map;
  		

		 function initialize(target) {
			    geocoder = new google.maps.Geocoder();
			    var latlng = new google.maps.LatLng(-34.397, 150.644);
			    var myOptions = {
			      zoom: 15,
			      center: latlng,
			      mapTypeId: google.maps.MapTypeId.ROADMAP
			    };
			   try{
			     map = new google.maps.Map(document.getElementById(target), myOptions);
			   }catch(e){}
		 }
		
		
		
function DialogWindow(caller,title,optionsFrame,optionsContent,optionsSettings){
	
	var optionsSettings = jQuery.extend({},optionsSettings);
	if(optionsSettings.oneInstance==1){ 
		jQuery('.dw:not(.lock)').remove();
		jQuery('.layerBG').remove();
	}
	var el = jQuery(caller);
	var self = this;
	var id = 'dw_'+(new Date().getTime());
	
	
	
	this.frame = jQuery('<div class="dw selected"></div>').attr('id',id);
	this.header = jQuery('<div class=dw_title></div>');
	this.titleContent = jQuery('<div class=dw_titleContent></div>').text(title);
	this.closeButton = jQuery('<img src=/images/button/cross.png >').click(function(e){jQuery('#'+id).fadeOut().remove();jQuery('.layerBG').remove();self.onClose();});
	this.content = jQuery('<div class=dw_content></div>');
	this.footer = jQuery('<div class=dw_footer></div>');
	
	
	
	
	this.onClose = function(){};
	
	this.frame.append(jQuery('<table style="width:100%"></table>').
						append('<tr><td class="tl"/><td class="b"/><td class="tr"/></tr>').
						append(
							jQuery('<tr></tr>').
								append('<td class="b"/>').
								append(
										jQuery('<td class=body></td>').
											append(this.header.append(this.titleContent).append(this.closeButton)).append(this.content)
								).
								append('<td class="b"/>')
							).
							append('<tr><td class="bl"/><td class="b"/><td class="br"/></tr>')
							);
	
	//this.frame.append(this.header.append(this.titleContent).append(this.closeButton)).append(this.content);
	if(optionsFrame){this.frame.css(optionsFrame);};
	if(optionsContent){this.content.css(optionsContent);};
	if(optionsSettings.backlayer == 1){
		jQuery('body').append("<div class=layerBG style='height:"+jQuery(document).height()+"px'></div>");
	}
	jQuery('body').append(this.frame);
	

	
	this.header.bind('mousedown touchstart',function(e){
		if(isTouchScreen){
			e = e.originalEvent.touches[0];
		}
		var sX = e.pageX;
		var sY = e.pageY;
		jQuery('body').disableTextSelect();
		self.frame.disableTextSelect();
		jQuery('body').bind('mousemove touchmove',function(ev){
			if(isTouchScreen){
				ev.preventDefault();
				ev = ev.originalEvent.touches[0];
			}	
			var top = parseFloat(self.frame.css('top'))+(ev.pageY-sY);
			var left = parseFloat(self.frame.css('left'))+(ev.pageX-sX);
			
			self.frame.css('left',left);
			self.frame.css('top',top);
			sX = ev.pageX;
			sY = ev.pageY;
		});
		jQuery('body').bind('mouseup touchend',function(ev){
		
			jQuery('body').enableTextSelect();
			self.frame.enableTextSelect();
			jQuery('body').unbind();
		});
	});
	
	this.frame.bind('mousedown touchstart',function(e){jQuery('.dw').removeClass('selected');jQuery(this).addClass('selected');});
	if(optionsSettings.position =='center'){
		this.center();
	}else{
		var top = Math.min(el.offset().top,jQuery(window).height()-this.frame.height()-25+jQuery(window).scrollTop());
		var left = Math.min(el.offset().left+el.width()+5,jQuery(window).width()-this.frame.width()-15+jQuery(window).scrollLeft());
	}
	this.frame.css('left',left);
	this.frame.css('top',top);
	this.frame.fadeIn();
}

DialogWindow.prototype.center=function(){
	var top = Math.max(0,jQuery(window).height()/2-this.frame.height()/2)+jQuery(window).scrollTop();
	 var left = Math.max(0,jQuery(window).width()/2-this.frame.width()/2)+jQuery(window).scrollLeft();
	 this.frame.css('left',left);
	 this.frame.css('top',top);

};

DialogWindow.prototype.close=function(callback){
		this.closeButton.click();
		if(typeof callback == 'function') {
			callback();
		}
};


jQuery.fn.centerElement = function () {
	var el = jQuery(this);
	var top = Math.max(0,jQuery(window).height()/2-el.height()/2)+jQuery(window).scrollTop();
	var left = Math.max(0,jQuery(window).width()/2-el.width()/2)+jQuery(window).scrollLeft();
	el.css('left',left);
	el.css('top',top);
};

function ajaxDialog(caller,title,ajaxparam,optionsFrame,optionsContent,optionsSettings){
	var el = jQuery(caller);
	var dw = new DialogWindow(caller,title,optionsFrame,optionsContent,optionsSettings);
	dw.content.append("<div id='bookloader' style='text-align:center;display: none;'><img  src='/images/loader/ajax-loader4.gif' ></div>");
	jQuery.ajax({
		url: ajaxparam.url,
		data: jQuery.extend({},ajaxparam.data),
		type: ((ajaxparam.type)?ajaxparam.type:"POST"),
		success: function(result){
			if(jQuery.trim(result)!=''){	 
				 dw.content.html(result);
				 if(optionsSettings.position=='center'){dw.center();}
				dw.content.addScroll(); 
			}
					
				},
		beforeSend: function(req){
			jQuery("#bookloader").show();
			
		},
		complete: function(req){
			jQuery("#bookloader").remove();
		}
	});
	
	return dw;
}



function inlineHTMLWindow(caller,title,content,optionsFrame,optionsContent){
	
}

function staticWindow(caller,title,url,optionsFrame,optionsContent){
	return ajaxDialog(caller,title,{url:url},optionsFrame,optionsContent,{oneInstance:1,position:'center'});
}
function staticWindow2(caller,title,url,optionsFrame,optionsContent,others){
	return ajaxDialog(caller,title,{url:url},optionsFrame,optionsContent,others);
}

function requestAppointment(caller,id,date,service){
	ajaxDialog(caller,'Appointment Request Form',{url:'/appointment/request',data:{proId:id,date:date,service:service,status:1}},{'width':'350px','height':'auto','left':'100px'},{'overflow-y':'auto'},{oneInstance:1,position:'center'});
}



function bookMeNow(caller,id,date,time,service,group,technician){
	ajaxDialog(caller,'Appointment Form',{url:'/appointment/make',data:{proId:id,date:date,service:service,time:time,status:2,group:group,technician:technician,cId:jQuery('#cId').val()}},{'width':'450px','height':'auto'},{'overflow-y':'auto'},{oneInstance:1,position:'center'});
}

function technicianDetails(caller,id,title){
	ajaxDialog(caller,'Services for '+title,{url:'/technician/serviceDetails',data:{tId:id}},null,{'height':'129px','overflow-y':'auto'},{});
}
function couponDetails(caller,id,title,withlink){
	if(!withlink)withlink=0;
	ajaxDialog(caller,''+title,{url:'/coupon/serviceDetails',data:{cId:id,withlink:withlink}},null,{'height':'129px','overflow-y':'auto'},{oneInstance:1});
}

function serviceDetails(caller,id,title){
	ajaxDialog(caller,title,{url:'/service/details',data:{id:id}},null,{'height':'129px','overflow-y':'auto'});
}


function addServiceCategory(caller){
	ajaxDialog(caller,'Add A Category',{url:'/service/addCategory',type:'GET'},{'height':'auto'},{'overflow-y':'auto'},{oneInstance:1});
}

function apptDetails(caller,id,title,options){
	ajaxDialog(caller,'Appointment Details',{url:'/appointment/details',data: {id:id}},{'width':'auto','height':'auto'},{'overflow-y':'auto'},{oneInstance:1,position:'center'});
}

function createAvailability(caller,params){
	
	ajaxDialog(caller,'Add an Availability',{url:'/availability/add',type:'GET',data:params},{'width':'500px','height':'auto','left':'100px'},{'overflow-y':'auto'},{oneInstance:1,position:'center'});
}
function editAvailability(caller,params){
	ajaxDialog(caller,'Edit an Availability',{url:'/availability/add',type:'GET',data:params},{'width':'500px','height':'auto','left':'100px'},{'overflow-y':'auto'},{oneInstance:1,position:'center'});
}
function createDiscount(caller,params){
	ajaxDialog(caller,'Add a Discount',{url:'/availability/addDiscount',type:'GET',data:params},{'width':'500px','height':'auto','left':'100px'},{'overflow-y':'auto'},{oneInstance:1,position:'center'});
}
function editDiscount(caller,params){
	ajaxDialog(caller,'Edit a Discount',{url:'/availability/addDiscount',type:'GET',data:params},{'width':'500px','height':'auto','left':'100px'},{'overflow-y':'auto'},{oneInstance:1,position:'center'});
}
function createBlocked(caller,params){
	ajaxDialog(caller,'Block a Time',{url:'/availability/addBlocked',type:'GET',data:params},{'width':'500px','height':'auto','left':'100px'},{'overflow-y':'auto'},{oneInstance:1,position:'center'});
}
function editBlocked(caller,params){
	ajaxDialog(caller,'Edit a Blocked Time',{url:'/availability/addBlocked',type:'GET',data:params},{'width':'500px','height':'auto','left':'100px'},{'overflow-y':'auto'},{oneInstance:1,position:'center'});
}



function groupSelect(myclass){
	var els = jQuery(myclass);
	
	els.each(function(key,val){
		var el=jQuery(this);
		el.mouseover(function(e){el.addClass('hover');});
		el.mouseout(function(e){el.removeClass('hover');});
		el.mousedown(function(e){els.removeClass('selected');el.addClass('selected');});
	});
	
	jQuery(els[0]).mousedown();
	//jQuery('#mbody').equalHeights();
}


function linkProfileTab(hash){
	var loc = hash.replace('#','');	
	if(loc=='') loc = 'description';
	loc = loc.substring(0,1).toUpperCase()+loc.substring(1,loc.length);
	if(jQuery('#tabMenu'+loc).length){
		jQuery('#tabMenu'+loc+' a').mousedown();
		jQuery('.tabMenu_content').hide();
		jQuery('#tabMenuContent'+loc).show();
	}
}

function addCategory(){
	var ind = jQuery("#business_category").val();
	var ind1 = jQuery("#business_subcategory").val();
	if(!(ind in categoryList)){ categoryList[ind]={};categoryList[ind][1]={};}
	categoryList[ind][0] =  jQuery("#business_category option:selected").text();
	if(ind1)categoryList[ind][1][ind1] =  jQuery("#business_subcategory option:selected").text();
	displayCategory();
}
function removeCategory(s1,s2){
	if(s1){
		if(s2){
			delete categoryList[s1][1][s2];
		}else{
			delete categoryList[s1];
		}
	}
	displayCategory();
}
function displayCategory(){
	var listC = jQuery("#listCategories").html("");
	var prev = jQuery("#p_category").html("");
	jQuery.each(categoryList,function(key,val){	
		if(val!=undefined){
			if(cCount(val[1])){
				prev.html(prev.html()+val[0]+' (');
				jQuery.each(val[1],function(key2,val2){
					listC.append('<div>'+val[0]+': '+val2+' (<a href="#" onclick=\'removeCategory("'+key+'","'+key2+'");return false;\' class=blue>remove</a>)</div>');
					prev.html(prev.html()+' '+val2+',');
				});
				prev.html(prev.html().substr(0,prev.html().length-1));
				prev.html(prev.html()+'),');
			}else{
				listC.append('<div>'+val[0]+' (<a href="#" onclick=\'removeCategory("'+key+'",'+0+');return false;\' class=blue>remove</a>)</div>');
				prev.html(prev.html()+' '+val[0]+',');
			}
		}
	});
	prev.html(prev.html().substr(0,prev.html().length-1));
	jQuery('#business_categoryList').val(JSON.stringify(categoryList));
}

function addTime(){
	var ind = jQuery("#d").val();
	var ind1 = jQuery("#f").val()+'_'+jQuery("#t").val();
	if(!(ind in hourList)){ hourList[ind]={};}
	hourList[ind][ind1] = {};
	hourList[ind][ind1][0]=jQuery("#f option:selected").text();
	hourList[ind][ind1][1]=jQuery("#t option:selected").text();
	
	displayTime();
}
function removeTime(s1,s2){
	if(s1){
		if(s2){
			delete hourList[s1][s2];
			if(!cCount(hourList[s1]))delete hourList[s1];
			
		}else{
			delete hourList[s1];
		}
	}
	displayTime();
}
function displayTime(){
	var listC = jQuery("#listTimes").html("");
	jQuery.each(hourList,function(key,val){	
		if(cCount(val)){
	
			jQuery.each(val,function(key2,val2){
				listC.append('<div>'+key+': '+val2[0]+'-'+val2[1]+' (<a href="#" onclick=\'removeTime("'+key+'","'+key2+'");return false;\' class=blue>remove</a>)</div>');
			});
	
		}else{
			//listC.append('<div>'+val[0]+' (<a href="#" onclick=removeCategory('+key+','+0+')>remove</a>)</div>')

		}
	});
	jQuery('#business_hourList').val(JSON.stringify(hourList));
}



function cCount(tab){
	var i=0;
	jQuery.each(tab,function(key,val){
		i++;	
	});
	return i;
}


function zoomWindow(caller,id){
	var el = jQuery(caller);
	var dw = new DialogWindow(caller,'Picture',{'width':'295px','height':'auto','left':'100px'},{'overflow-y':'auto'},{oneInstance:1,position:'center'});
	
	dw.content.append("<div id='bookloader' style='text-align:center;display: none;'><img  src='/images/loader/ajax-loader5.gif' ></div>");
	jQuery.ajax({
		url: '/photo/zoom',
		data: {pId:id},
		type:"POST",
		success: function(result){
					if(jQuery.trim(result)!=''){
						
						 dw.content.html(result);
						 //jQuery("#photo_"+id+" img").hide();
						 heavyImage = new Image(); 
						 heavyImage.src = jQuery("#photo_"+id+" img").attr('src');
						 
						 jQuery(heavyImage).load(function(){
						 	jQuery("#photo_"+id+"").fadeIn();
						 	dw.frame.width('auto');
						 	dw.center();
						 });
						 
						
						 
					}
				},
		beforeSend: function(req){
			jQuery("#bookloader").show();
			
		},
		complete: function(req){
			
		}
	});
	return false;
}

function displayLoading(text){
	var el = jQuery('#loading_screen');
	if(text==undefined) text = 'Loading';
	if(!el.length){
		jQuery('body').append('<div id=loading_screen><br>'+
  		'<span></span>'+'<img src=/images/main/loading_screen.gif>'+'</div>');
	}
	
  	jQuery('#loading_screen span').html(text);
	jQuery('#loading_screen').css({'left':jQuery(window).width()/2-100,'top':200});
	jQuery('#loading_screen').show();

}
function hideLoading(){
	setTimeout("jQuery('#loading_screen').hide()",500);
}


jQuery.fn.addScroll = function () {
	
	var freeScrolling = false;
	var cont = jQuery(this);
	var height = 0;
	var cpos = cont.scrollTop()
	var speed = 0;
	
	var sPos = cont.scrollTop();
	
	jQuery.each(cont.children(),function(key,val){
		height +=jQuery(val).outerHeight();
	
	});
	
	cont.scrollTop(100000);
	height = cont.scrollTop();
	cont.scrollTop(cpos);
	
	
	
	cont.bind('mousedown touchstart',function(e){
		cpos = cont.scrollTop();
		var sTime = new Date().getTime();
	
		
		
		freeScrolling = false;
		sPos = cont.scrollTop();
		
		if(isTouchScreen){
			e = e.originalEvent.touches[0];
		}
		
		var sY = e.pageY;
		cont.disableTextSelect();

		cont.bind('mousemove touchmove',function(ev){
			
			freeScrolling = false;
			
			if(isTouchScreen){
				ev.preventDefault();
				ev = ev.originalEvent.touches[0];
			}	
			var top = cpos-(ev.pageY-sY);
					
			cont.scrollTop(top);
			cpos = cont.scrollTop();
			sY = ev.pageY;
		});
		cont.bind('mouseup touchend',function(ev){	
			cont.enableTextSelect();
			cont.unbind('mousemove touchmove mouseup touchend');
			
			freeScrolling = true;
			speed = (cpos - sPos)/(new Date().getTime()-sTime);  	
			
			var tTime = new Date().getTime();
			var sT = tTime;
			var eTime = sT; 
			var tPos = 0;
			/*while((eTime-tTime)<3000 && Math.abs(speed)>0.1){
				
				
				if(!freeScrolling) {alert('dsd');break;}
				
				speed = speed * Math.exp(-0.01/1000*(eTime-tTime));
				cont.scrollTop(cpos+speed*(eTime-sT));
				tPos = cpos;
				cpos = cont.scrollTop();
				sT = eTime;
				temp = new Date().getTime();
				while ((new Date().getTime()) - temp <= 10) {  }
				
				eTime = eTime+10;
			} */
			freeScrolling = false;	
		});
	});


}


jQuery.fn.hint = function (blurClass) {
  if (!blurClass) { 
    blurClass = 'blur';
  }
  
  return this.each(function () {
    var $input = jQuery(this),
     title = $input.attr('title'),
     $form = jQuery(this.form),
     $win = jQuery(window);

    function remove() {
      if ( $input.hasClass(blurClass)) { //$input.val() === $input.attr('title') &&
        $input.val('').removeClass(blurClass);
      }
    }

    if ($input.attr('title')) { 
      $input.blur(function () {
        if (this.value === '') {
          $input.val($input.attr('title')).addClass(blurClass);
        }
      }).focus(remove).blur();
      $form.submit(remove);
      $win.unload(remove);
    }
  });
};



function searchTwitter(value,cont){
	el = jQuery(cont);
	jQuery.ajax({
		url:"/search/twitter",
		data:{q:value},
		success:function(data){
			el.fadeOut();
			el.html(data);
			el.fadeIn();
		}	
	});
}



jQuery.fn.enterKey=function(){
	var element = jQuery(this);
	var doubleenter = false;
	var isTextArea  = false;
	element.keydown(function(event){
		if(!isTextArea){
			if(doubleenter===false){
				if ((event.which && event.which == 13) ||    (event.keyCode && event.keyCode == 13)){
					jQuery('.submit',element).click();return false;
				//} else if((event.which && event.which == 8) ||    (event.keyCode && event.keyCode == 8)){
					//return false;
				
				}else{ return true;}
			} else {
				doubleenter = false;
				return false;
			}
		}
	});
	jQuery('input[type="text"]',element).keydown(function(event){
		if ((event.which && event.which == 40) ||    (event.keyCode && event.keyCode == 40)){
			doubleenter = true;
			return false;
		
		}else{ return true;}	
	});
	jQuery('textarea',element).focus(function(event){
		isTextArea = true;
	});
	jQuery('textarea',element).blur(function(event){
			isTextArea = false;
		
	});
};

jQuery.fn.fadeToggle = function(speed, easing, callback) {
   return this.animate({opacity: 'toggle'}, speed, easing, callback);

};

jQuery.fn.slideToggle = function() {
	if(jQuery(this).is(':visible')){ 
		jQuery(this).slideUp();
	}else{
		jQuery(this).slideDown();
	}
};
 jQuery.fn.addBookmark = function(id){
	this.parent().load('/user/addBookmark',{proId:id});
 };
  jQuery.fn.removeBookmark = function(id){
	this.parent().load('/user/removeBookmark',{proId:id});
 };

Date.prototype.daysInMonth = function()
 {
     return 32 - new Date(this.getFullYear(), this.getMonth(), 32).getDate();
 };
 
 Date.prototype.addMonths = function(nMonths){
 		var tempDate = new Date(this.getFullYear(), this.getMonth()+nMonths, 1);
 		var nb = tempDate.daysInMonth();
 		return new Date(this.getFullYear(), this.getMonth()+nMonths, Math.min(nb,this.getDate()));
 };

Date.prototype.displayMD=function(type){
	if(type===undefined){type='s';}
	if(userCulture=='fr'){
		dir = ' '+format2Digits(this.getDate())+'/'+format2Digits(this.getMonth()+1);
	} else {
		dir = ' '+format2Digits(this.getMonth()+1)+'/'+format2Digits(this.getDate());
	}
	if(type=='l'){ dir += '/'+ this.getFullYear();}
	return dir;
};

function posNumber(i){
	return Math.max(i,0);
}

Date.prototype.displayMD=function(type){
	if(type===undefined){type='s';}
	if(userCulture=='fr'){
		dir = ' '+format2Digits(this.getDate())+'/'+format2Digits(this.getMonth()+1);
	} else {
		dir = ' '+format2Digits(this.getMonth()+1)+'/'+format2Digits(this.getDate());
	}
	if(type=='l'){ dir += '/'+ this.getFullYear();}
	return dir;
};

String.prototype.strToDate=function(){
	var Year = this.substr(0,4);
	var Day = this.substr(6,2);
	var Month = this.substr(4,2)-1;
	return new Date(Year,Month,Day);
};

String.prototype.resizeMe=function(l){
	if(l>50){
		return this+'';
	}else if(l>25){
		return this.substring(0,3);
	}else{
		return this.substring(0,1);
	}
};





function timeToNumber(t){
	temp = t.split(':');
	return parseFloat(temp[0])+parseFloat(temp[1])/60;
}
function numberToTime(t){
	var hour = Math.floor(t);
	return format2Digits(hour)+':'+format2Digits(Math.round((t-hour)*60));
}




function formatTime(i){ 
	if(userCulture=='fr'){
		dTime = (i)+'h';
	} else {
		if(i<12){
			if(i===0){ i =12;} 
			dTime = i+' am'; 
		}else{ 
			if(i==12){ i=24;}
			dTime = (i-12)+' pm';
		}
	}
	return dTime;
}
function formatFullTime(i){ 
	var temp = i.split(':');
	if(userCulture=='fr'){
		dTime = format2Digits(temp[0])+':'+temp[1];
	} else {
		if(temp[0]<12){
			if(temp[0]===0){ temp[0] =12; }
			dTime = (temp[0]/1)+':'+temp[1]+' am'; 
		}else{ 
			if(temp[0]==12){ temp[0]=24;}
			dTime = (temp[0]-12)+':'+temp[1]+' pm';
		}
	}
	return dTime;
}
Date.prototype.formatFullDate=function(){ 
	
	if(userCulture=='fr'){
		return d_names[userCulture][this.getDay()]+' '+format2Digits(this.getDate())+' '+m_names[userCulture][this.getMonth()]+' '+this.getFullYear();
		
		
	} else {
		
		return d_names[userCulture][this.getDay()]+' '+m_names[userCulture][this.getMonth()]+' '+format2Digits(this.getDate())+', '+this.getFullYear();
	}
	return dTime;
};


function is_defined(v){
	return (v===undefined || v==0 || v=='' || v=='null' || v=='NULL');
}

function getCurrentHourPosition(){
	var d = new Date();
	return d.getHours()+d.getMinutes()/60;
	
}

Date.prototype.dateformat=function(l){
	var dir ='';
	if(userCulture=='fr'){
		dir = ' '+format2Digits(this.getDate())+'/'+format2Digits(this.getMonth()+1);
	} else {
		dir = ' '+format2Digits(this.getMonth()+1)+'/'+format2Digits(this.getDate());
	}
	
	if(l>150){
		return d_names[userCulture][this.getDay()]+dir;
	}else if(l>95){
		return d_names[userCulture][this.getDay()].substring(0,3)+dir;
	}else if(l>70){
		
		return d_names[userCulture][this.getDay()].substring(0,2)+dir;
	}else if(l>50){
		return dir;
	}else{
		
		return format2Digits(this.getDate());
	}
};
function days_between(date1, date2) {

    // The number of milliseconds in one day
    var ONE_DAY = 1000 * 60 * 60 * 24;

    // Convert both dates to milliseconds
    var date1_ms = date1.getTime();
    var date2_ms = date2.getTime();

    // Calculate the difference in milliseconds
    var difference_ms = Math.abs(date1_ms - date2_ms);
    
    // Convert back to days and return
    if(date1_ms>date2_ms)
    	return -Math.round(difference_ms/ONE_DAY);
    else
    	return Math.round(difference_ms/ONE_DAY);

}

function expandCategory(caller,dest){
	jQuery(dest).fadeToggle();
	
	var el =jQuery("span",jQuery(caller)); 
	if(el.hasClass("expanded")){
		el.removeClass("expanded");
	}else{
		el.addClass("expanded");
		
	}
}


function expandBlock(caller,dest){
	var dest = jQuery(dest);
	if(dest.is(':visible')){ 
		dest.slideUp();
	}else{
		dest.slideDown();
	}
	
	var el =jQuery(caller); 
	if(el.hasClass("expanded")){
		el.removeClass("expanded");
	}else{
		el.addClass("expanded");
	}
}


function checkAllServiceCategoty(dest,wrapper){
	var dest = jQuery(dest);
	var wrapper = jQuery(wrapper);
	dest.click(function(){
		jQuery('.checkbox',wrapper).attr('checked',jQuery(this).attr('checked'));
	});
	jQuery('.checkbox',wrapper).click(function(){dest.attr('checked','');});

}
function checkAllSubServiceCategoty(dest){
	var dest1 = jQuery(dest);
	dest1.each(function(key,val){
		var dest = jQuery(this);
		var wrapper = dest.parent().parent().next();
		dest.click(function(){
			jQuery('.checkbox',wrapper).attr('checked',jQuery(this).attr('checked'));
		});
		jQuery('.checkbox',wrapper).click(function(){dest.attr('checked','');});
	});
}
function inputAllSubServiceCategoty(dest){
	var dest1 = jQuery(dest);
	dest1.each(function(key,val){
		var dest = jQuery(this);
		var wrapper = dest.parent().parent().next();
		dest.keyup(function(){
			jQuery('.treetext',wrapper).val(jQuery(this).val());
		});
		
	});
}

Number.prototype.pxToEm = String.prototype.pxToEm = function(settings){
	//set defaults
	settings = jQuery.extend({
		scope: 'body',
		reverse: false
	}, settings);
	
	var pxVal = (this == '') ? 0 : parseFloat(this);
	var scopeVal;
	var getWindowWidth = function(){
		var de = document.documentElement;
		return self.innerWidth || (de && de.clientWidth) || document.body.clientWidth;
	};	
	
	/* When a percentage-based font-size is set on the body, IE returns that percent of the window width as the font-size. 
		For example, if the body font-size is 62.5% and the window width is 1000px, IE will return 625px as the font-size. 	
		When this happens, we calculate the correct body font-size (%) and multiply it by 16 (the standard browser font size) 
		to get an accurate em value. */
				
	if (settings.scope == 'body' && jQuery.browser.msie && (parseFloat(jQuery('body').css('font-size')) / getWindowWidth()).toFixed(1) > 0.0) {
		var calcFontSize = function(){		
			return (parseFloat(jQuery('body').css('font-size'))/getWindowWidth()).toFixed(3) * 16;
		};
		scopeVal = calcFontSize();
	}
	else { scopeVal = parseFloat(jQuery(settings.scope).css("font-size")); };
			
	var result = (settings.reverse == true) ? (pxVal * scopeVal).toFixed(2) + 'px' : (pxVal / scopeVal).toFixed(2) + 'em';
	return result;
};

jQuery.fn.equalHeights = function(px) {
	jQuery(this).each(function(){
		var currentTallest = 0;
		jQuery(this).children().each(function(i){
			if (jQuery(this).height() > currentTallest) { currentTallest = jQuery(this).height(); }
		});
		if (!px || !Number.prototype.pxToEm) currentTallest = currentTallest.pxToEm(); //use ems unless px is specified
		// for ie6, set height since min-height isn't supported
		if (jQuery.browser.msie && jQuery.browser.version == 6.0) { jQuery(this).children().css({'height': currentTallest}); }
		jQuery(this).children().css({'min-height': currentTallest}); 
	});
	return this;
};


jQuery.fn.flash = function(){
		
		//jQuery(this).each(function(){
			var ele = jQuery(this);
			//var bg = ele.css('backgroundColor');
			
			ele.animate( 
				{ backgroundColor: 'red' },
				{	duration:800,
					complete:function(){
						ele.css({'background':'none transparent'})
					}
				})
			
		//});
}


jQuery.fn.tagCloud = function(){
	jQuery(this).each(function(){
		var list = jQuery(this);
		var element = jQuery('a',list);;
		var offset = 0; 
		var stepping = 0.03;
		var jQuerylist = jQuery(list);
		var refreshIntervalId;
		jQuerylist.mousemove(function(e){
			var topOfList = jQuerylist.eq(0).offset().top;
			var listHeight = jQuerylist.height();
			stepping = (e.clientY+jQuery(window).scrollTop() - topOfList) /  listHeight * 0.2 - 0.1;
			//render();
		});

		jQuerylist.mouseover(function(e){
			clearInterval(refreshIntervalId);
			refreshIntervalId= setInterval(render, 50);

		});
		jQuerylist.mouseout(function(e){
			clearInterval(refreshIntervalId);
			

		});

		for (var i = element.length - 1; i >= 0; i--)
		{
			element[i].elemAngle = i * Math.PI * 2 / element.length;
		}
		
		
		refreshIntervalId= setInterval(render, 50);
		
		
		function render(){
			for (var i = element.length - 1; i >= 0; i--){
				
				var angle = element[i].elemAngle + offset;
				
				x = 120 + Math.sin(angle) * 30;
				y = 45 + Math.cos(angle) * 40;
				size = Math.round(40 - Math.sin(angle) * 40)/3;
				
				var elementCenter = jQuery(element[i]).width() / 2;
		
				var leftValue = ((jQuerylist.width()/2) * x / 100 - elementCenter) + "px";
		
				jQuery(element[i]).css("fontSize", size + "px");
				jQuery(element[i]).css("opacity",size/100*3);
				jQuery(element[i]).css("zIndex" ,size);
				jQuery(element[i]).css("left" ,leftValue);
				jQuery(element[i]).css("top", y + "%");
			}
			
			if(!list.is(":visible"))list.show();
			
			offset += stepping;
		}
		
	});
	
	
	
};
function selectServiceTime(t){
		if(t==1){
			jQuery("#tabaddtime").removeClass("selected");
			jQuery("#tabaddservice").addClass("selected");
			jQuery("#addService").show();jQuery("#addTime").hide();
		}
		if(t==2){
			jQuery("#tabaddtime").addClass("selected");
			jQuery("#tabaddservice").removeClass("selected");
			jQuery("#addService").hide();jQuery("#addTime").show();
		}

	}

function echeck(str) {
	var at="@";
	var dot=".";
	var lat=str.indexOf(at);
	var lstr=str.length;
	var ldot=str.indexOf(dot);
	var s='Your email is invalid.';
	if (str.indexOf(at)==-1){
	   alert(s);
	   return false;
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		alert(s);
	   return false;
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		alert(s);
	    return false;
	}

	 if (str.indexOf(at,(lat+1))!=-1){
		 alert(s);
	    return false;
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		 alert(s);
	    return false;
	 }

	 if (str.indexOf(dot,(lat+2))==-1){
		 alert(s);
	    return false;
	 }
	
	 if (str.indexOf(" ")!=-1){
		 alert(s);
	    return false;
	 }

		 return true;					
}

function obj_length(object){
	i=0;
	jQuery.each(object,function(){
		i++;
	});
	return i;
}

	jQuery.extend(jQuery.fn, {
		rightClick: function(handler) {
			jQuery(this).each( function() {
				jQuery(this).mousedown( function(e) {
					var evt = e;
					jQuery(this).mouseup( function() {
						jQuery(this).unbind('mouseup');
						if( evt.button == 2 ) {
							handler.call( jQuery(this), evt );
							return false;
						} else {
							return true;
						}
					});
				});
				jQuery(this)[0].oncontextmenu = function() {
					return false;
				};
			});
			return jQuery(this);
		},		
		rightMouseDown: function(handler) {
			jQuery(this).each( function() {
				jQuery(this).mousedown( function(e) {
					if( e.button == 2 ) {
						handler.call( jQuery(this), e );
						return false;
					} else {
						return true;
					}
				});
				jQuery(this)[0].oncontextmenu = function() {
					return false;
				};
			});
			return jQuery(this);
		},
		rightMouseUp: function(handler) {
			jQuery(this).each( function() {
				jQuery(this).mouseup( function(e) {
					if( e.button == 2 ) {
						handler.call( jQuery(this), e );
						return false;
					} else {
						return true;
					}
				});
				jQuery(this)[0].oncontextmenu = function() {
					return false;
				};
			});
			return jQuery(this);
		},
		noContext: function() {
			jQuery(this).each( function() {
				jQuery(this)[0].oncontextmenu = function() {
					return false;
				};
			});
			return jQuery(this);
		}
	});
	
	
	function updateGame(options,fields){
	
		var fields = jQuery.extend({},fields);
		var params = '';
		jQuery.each(options,function(key,val){
			var el = jQuery('#g_'+val); 
			params += val; 
			params+='|'+jQuery('.r_'+val).eq(0).text();
			params+='|'+jQuery('.e_'+val).eq(0).text();
			params+='|'+jQuery('.p_'+val).eq(0).text();
			params+='|'+jQuery('.w_'+val).eq(0).text();
			params+=',';
			
		});
	
		jQuery.ajax({
			url:'/game/update',
			type:'post',
			data:{ids:params},
			dataType:'json',
			success:function(data){
				
			
				
				jQuery.each(data,function(key,val){
					
					jQuery.each(val,function(key2,val2){
						if(key2!='wi'){
							jQuery('.f'+key2+'_'+key).flash();
							jQuery('.'+key2+'_'+key).text(val2);
						}else{
							jQuery('.'+key2+'_'+key).attr('src',val2);
						}
						if(key2=='t'){
							var newYear = new Date(val2+' EST'); 
							//newYear = new Date(newYear.getFullYear() + 1, 1 - 1, 1); 
							jQuery('#deal_timeleft_'+key).flash();
							jQuery('#deal_timeleft_'+key).countdown('change',{until: newYear,layout:"<b><span style='display: inline-block;width:50px' >{dn}</span><span style='display: inline-block;width:50px' >{hnn}</span><span style='display: inline-block;width:50px' >{mnn}</span><span style='display: inline-block;width:50px' >{snn}</span></b>"}); 					
						}
				
					})	
				})
				
				setTimeout(function(){updateGame(options,fields)},500);
			
			}
			
		});
	
	
	
	}
	
	
	(function($){var a=$([]),e=document,c="clickoutside",b="click."+c+"-special-event";$.event.special[c]={setup:function(){a=a.add(this);if(a.length===1){$(e).bind(b,d)}},teardown:function(){a=a.not(this);if(a.length===0){$(e).unbind(b)}},add:function(f){var g=f.handler;f.handler=function(i,h){i.target=h;g.apply(this,arguments)}}};function d(f){$(a).each(function(){var g=$(this);if(this!==f.target&&!g.has(f.target).length){g.triggerHandler(c,[f.target])}})}})(jQuery);
	;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
	
	//jQuery Color
	eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(l(d){d.O([\'B\',\'P\',\'Q\',\'R\',\'S\',\'T\',\'U\'],l(i,b){d.V.W[b]=l(a){7(!a.C){a.f=D(a.E,b);a.m=q(a.m);a.C=X}a.E.Y[b]="r("+[g.t(g.u(5((a.v*(a.m[0]-a.f[0]))+a.f[0]),4),0),g.t(g.u(5((a.v*(a.m[1]-a.f[1]))+a.f[1]),4),0),g.t(g.u(5((a.v*(a.m[2]-a.f[2]))+a.f[2]),4),0)].Z(",")+")"}});l q(a){w b;7(a&&a.10==11&&a.12==3)8 a;7(b=/r\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)/.n(a))8[5(b[1]),5(b[2]),5(b[3])];7(b=/r\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)/.n(a))8[x(b[1])*2.y,x(b[2])*2.y,x(b[3])*2.y];7(b=/#([a-h-j-9]{2})([a-h-j-9]{2})([a-h-j-9]{2})/.n(a))8[5(b[1],16),5(b[2],16),5(b[3],16)];7(b=/#([a-h-j-9])([a-h-j-9])([a-h-j-9])/.n(a))8[5(b[1]+b[1],16),5(b[2]+b[2],16),5(b[3]+b[3],16)];7(b=/13\\(0, 0, 0, 0\\)/.n(a))8 e[\'z\'];8 e[d.14(a).15()]}l D(a,b){w c;17{c=d.18(a,b);7(c!=\'\'&&c!=\'z\'||d.19(a,"1a"))1b;b="B"}1c(a=a.1d);8 q(c)};w e={1e:[0,4,4],1f:[F,4,4],1g:[G,G,1h],1i:[0,0,0],1j:[0,0,4],1k:[H,I,I],1l:[0,4,4],1m:[0,0,k],1n:[0,k,k],1o:[A,A,A],1p:[0,1q,0],1r:[1s,1t,J],1u:[k,0,k],1v:[1w,J,1x],1y:[4,K,0],1z:[1A,1B,1C],1D:[k,0,0],1E:[1F,1G,1H],1I:[1J,0,o],1K:[4,0,4],1L:[4,1M,0],1N:[0,6,0],1O:[1P,0,1Q],1R:[F,L,K],1S:[1T,1U,L],1V:[M,4,4],1W:[N,1X,N],1Y:[o,o,o],1Z:[4,20,21],22:[4,4,M],23:[0,4,0],24:[4,0,4],25:[6,0,0],26:[0,0,6],27:[6,6,0],28:[4,H,0],29:[4,p,2a],2b:[6,0,6],2c:[6,0,6],2d:[4,0,0],2e:[p,p,p],2f:[4,4,4],2g:[4,4,0],z:[4,4,4]}})(2h);',62,142,'||||255|parseInt|128|if|return|||||||start|Math|fA||F0|139|function|end|exec|211|192|getRGB|rgb||max|min|pos|var|parseFloat|55|transparent|169|backgroundColor|colorInit|getColor|elem|240|245|165|42|107|140|230|224|144|each|borderBottomColor|borderLeftColor|borderRightColor|borderTopColor|color|outlineColor|fx|step|true|style|join|constructor|Array|length|rgba|trim|toLowerCase||do|curCSS|nodeName|body|break|while|parentNode|aqua|azure|beige|220|black|blue|brown|cyan|darkblue|darkcyan|darkgrey|darkgreen|100|darkkhaki|189|183|darkmagenta|darkolivegreen|85|47|darkorange|darkorchid|153|50|204|darkred|darksalmon|233|150|122|darkviolet|148|fuchsia|gold|215|green|indigo|75|130|khaki|lightblue|173|216|lightcyan|lightgreen|238|lightgrey|lightpink|182|193|lightyellow|lime|magenta|maroon|navy|olive|orange|pink|203|purple|violet|red|silver|white|yellow|jQuery'.split('|'),0,{}))

