').html(linkify(value.text)+''+date+'')));
});
$('.latest_tweets a').attr('target','_blank');
list.carouFredSel({
direction: "up",
items: {
visible: 3
},
scroll: {
items: 1,
easing: "swing",
pauseOnHover: true,
height: "variable"
},
prev: '#latest_tweets_prev',
next: '#latest_tweets_next',
auto: {
play: false
}
});
$("abbr.timeago").timeago();
}
});*/
//timeago
$("abbr.timeago").timeago();
//footer recent posts, most commented, most viewed, scrolling list
$(".latest_tweets, .footer_recent_posts, .most_commented, .most_viewed, .scrolling_list_0").carouFredSel({
direction: "up",
items: {
visible: 3
},
scroll: {
items: 1,
easing: "swing",
pauseOnHover: true,
height: "variable"
},
auto: {
play: false
}
});
$(".latest_tweets").trigger("configuration", {
items: {
visible: ($(".latest_tweets").children().length>2 ? 3 : $(".latest_tweets").children().length)
},
prev: '#latest_tweets_prev',
next: '#latest_tweets_next'
});
$(".footer_recent_posts").trigger("configuration", {
prev: '#footer_recent_posts_prev',
next: '#footer_recent_posts_next'
});
$(".most_commented").trigger("configuration", {
prev: '#most_commented_prev',
next: '#most_commented_next'
});
$(".most_viewed").trigger("configuration", {
prev: '#most_viewed_prev',
next: '#most_viewed_next'
});
$(".scrolling_list_0").trigger("configuration", {
prev: '#scrolling_list_0_prev',
next: '#scrolling_list_0_next'
});
if($("#map").length)
{
//google map
var coordinate = new google.maps.LatLng(40.6327941, 22.9577282);
var mapOptions = {
zoom: 16,
center: coordinate,
mapTypeId: google.maps.MapTypeId.ROADMAP,
streetViewControl: false,
mapTypeControl: false
};
map = new google.maps.Map(document.getElementById("map"),mapOptions);
new google.maps.Marker({
position: new google.maps.LatLng(40.6327941, 22.9577282),
map: map,
// icon: new google.maps.MarkerImage("/front/hydrolab/images/map_pointer.png", new google.maps.Size(38, 45), null, new google.maps.Point(18, 44))
});
}
//window resize
$(window).resize(function(){
$(".training_classes").accordion("resize");
if(map!=null)
map.setCenter(coordinate);
if($(".gallery:not('.horizontal_carousel')").length)
{
$(".gallery:not('.horizontal_carousel')").isotope({
masonry: {
//columnWidth: 225,
gutterWidth: ($(".gallery:not('.horizontal_carousel')").width()>462 ? 30 : 12)
}
});
}
});
//scroll top
$("a[href='#top']").click(function() {
$("html, body").animate({scrollTop: 0}, "slow");
return false;
});
//comments number scroll
$(".single .comments_number").click(function(event){
event.preventDefault();
var offset = $("#comments_list").offset();
$("html, body").animate({scrollTop: offset.top-10}, 400);
});
//reply button scroll
$(".reply_button").click(function(event){
event.preventDefault();
var offset = $("#comment_form").offset();
$("html, body").animate({scrollTop: offset.top-10}, 400);
$("#cancel_comment").css('display', 'block');
});
//cancel comment button
$("#cancel_comment").click(function(event){
event.preventDefault();
$(this).css('display', 'none');
});
//hint
$(".search input[type='text']").hint();
//tooltip
$(".tooltip").bind("mouseover click", function(){
var position = $(this).position();
var tooltip_text = $(this).children(".tooltip_text");
tooltip_text.css("width", $(this).outerWidth() + "px");
tooltip_text.css("height", tooltip_text.height() + "px");
tooltip_text.css({"top": position.top-tooltip_text.innerHeight() + "px", "left": position.left + "px"});
});
//isotope
$(".gallery:not('.horizontal_carousel')").isotope({
masonry: {
//columnWidth: 225,
gutterWidth: ($(".gallery:not('.horizontal_carousel')").width()>462 ? 30 : 12)
}
});
//$(".timetable_isotope").isotope();
//fancybox
$(".fancybox").fancybox({
'speedIn': 600,
'speedOut': 200,
'transitionIn': 'elastic',
'cyclic': 'true'
});
$(".fancybox-video").bind('click',function()
{
$.fancybox(
{
'autoScale':false,
'speedIn': 600,
'speedOut': 200,
'transitionIn': 'elastic',
'width':(this.href.indexOf("vimeo")!=-1 ? 600 : 680),
'height':(this.href.indexOf("vimeo")!=-1 ? 338 : 495),
'href':(this.href.indexOf("vimeo")!=-1 ? this.href : this.href.replace(new RegExp("watch\\?v=", "i"), 'embed/')),
'type':'iframe',
'swf':
{
'wmode':'transparent',
'allowfullscreen':'true'
}
});
return false;
});
$(".fancybox-iframe").fancybox({
'speedIn': 600,
'speedOut': 200,
'transitionIn': 'elastic',
'width' : '75%',
'height' : '75%',
'autoScale' : false,
'titleShow': false,
'type' : 'iframe'
});
//contact form
if($(".contact_form").length)
$(".contact_form")[0].reset();
$(".contact_form").submit(function(event){
event.preventDefault();
var data = $(this).serializeArray();
$("#contact_form .block").block({
message: false,
overlayCSS: {
opacity:'0.3',
"backgroundColor": "#FFF"
}
});
$.ajax({
url: $(".contact_form").attr("action"),
data: data,
type: "post",
dataType: "json",
success: function(json){
$("#contact_form [name='submit'], #contact_form [name='first_name'], #contact_form [name='last_name'], #contact_form [name='email'], #contact_form [name='message']").qtip('destroy');
if(typeof(json.isOk)!="undefined" && json.isOk)
{
if(typeof(json.submit_message)!="undefined" && json.submit_message!="")
{
$("#contact_form [name='submit']").qtip(
{
style: {
classes: 'ui-tooltip-success'
},
content: {
text: json.submit_message
},
position: {
my: "right center",
at: "left center"
}
}).qtip('show');
$(".contact_form")[0].reset();
$(".contact_form [name='department']").val("");
$(".contact_form .tabs_box_navigation_selected>span").text("Select department");
}
}
else
{
if(typeof(json.submit_message)!="undefined" && json.submit_message!="")
{
$("#contact_form [name='submit']").qtip(
{
style: {
classes: 'ui-tooltip-error'
},
content: {
text: json.submit_message
},
position: {
my: "right center",
at: "left center"
}
}).qtip('show');
}
if(typeof(json.error_first_name)!="undefined" && json.error_first_name!="")
{
$("#contact_form [name='first_name']").qtip(
{
style: {
classes: 'ui-tooltip-error'
},
content: {
text: json.error_first_name
},
position: {
my: "bottom center",
at: "top center"
}
}).qtip('show');
}
if(typeof(json.error_last_name)!="undefined" && json.error_last_name!="")
{
$("#contact_form [name='last_name']").qtip(
{
style: {
classes: 'ui-tooltip-error'
},
content: {
text: json.error_last_name
},
position: {
my: "bottom center",
at: "top center"
}
}).qtip('show');
}
if(typeof(json.error_email)!="undefined" && json.error_email!="")
{
$("#contact_form [name='email']").qtip(
{
style: {
classes: 'ui-tooltip-error'
},
content: {
text: json.error_email
},
position: {
my: "bottom center",
at: "top center"
}
}).qtip('show');
}
if(typeof(json.error_message)!="undefined" && json.error_message!="")
{
$("#contact_form [name='message']").qtip(
{
style: {
classes: 'ui-tooltip-error'
},
content: {
text: json.error_message
},
position: {
my: "bottom center",
at: "top center"
}
}).qtip('show');
}
}
$("#contact_form").unblock();
}
});
});
//translation
/*
$.datepicker.regional['fr'] = {
renderer: $.ui.datepicker.defaultRenderer,
monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin',
'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun',
'Jul','Aoû','Sep','Oct','Nov','Déc'],
dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'],
dateFormat: 'dd/mm/yyyy',
firstDay: 1,
prevText: '<Préc', prevStatus: 'Voir le mois précédent',
prevJumpText: '<<', prevJumpStatus: 'Voir l\'année précédent',
nextText: 'Suiv>', nextStatus: 'Voir le mois suivant',
nextJumpText: '>>', nextJumpStatus: 'Voir l\'année suivant',
currentText: 'Courant', currentStatus: 'Voir le mois courant',
todayText: 'Aujourd\'hui', todayStatus: 'Voir aujourd\'hui',
clearText: 'Effacer', clearStatus: 'Effacer la date sélectionnée',
closeText: 'Fermer', closeStatus: 'Fermer sans modifier',
yearStatus: 'Voir une autre année', monthStatus: 'Voir un autre mois',
weekText: 'Sm', weekStatus: 'Semaine de l\'année',
dayStatus: '\'Choisir\' le DD d MM',
defaultStatus: 'Choisir la date',
isRTL: false
};
$.datepicker.setDefaults($.datepicker.regional['fr']);*/
$(".contact_form [name='date_of_birth']").datepicker({
dateFormat: "mm-dd-yy"
});
$(".closing_in").each(function(){
var self = $(this);
var time = parseInt(self.children(".seconds").text());
var id = setInterval(function(){
time--;
self.children(".seconds").text(time);
if(time==0)
{
self.parent().prev(".notification_box").fadeOut(500, function(){
$(this).remove();
});
self.remove();
clearInterval(id);
}
}, 1000);
});
function animateElements()
{
$('.animated_element').each(function(){
var elementPos = $(this).offset().top;
var topOfWindow = $(window).scrollTop();
if(elementPos