").html(data).contents().each(function () {
update.insertBefore(this, top);
});
break;
case "AFTER":
$("
").html(data).contents().each(function () {
update.appendChild(this);
});
break;
default:
$(update).html(data);
break;
}
});
}
function asyncRequest(element, options) {
var confirm, loading, method, duration;
confirm = element.getAttribute("data-ajax-confirm");
if (confirm && !window.confirm(confirm)) {
return;
}
loading = $(element.getAttribute("data-ajax-loading"));
duration = element.getAttribute("data-ajax-loading-duration") || 0;
$.extend(options, {
type: element.getAttribute("data-ajax-method") || undefined,
url: element.getAttribute("data-ajax-url") || undefined,
beforeSend: function (xhr) {
var result;
asyncOnBeforeSend(xhr, method);
result = getFunction(element.getAttribute("data-ajax-begin"), ["xhr"]).apply(this, arguments);
if (result !== false) {
loading.show(duration);
}
return result;
},
complete: function () {
loading.hide(duration);
getFunction(element.getAttribute("data-ajax-complete"), ["xhr", "status"]).apply(this, arguments);
},
success: function (data, status, xhr) {
asyncOnSuccess(element, data, xhr.getResponseHeader("Content-Type") || "text/html");
getFunction(element.getAttribute("data-ajax-success"), ["data", "status", "xhr"]).apply(this, arguments);
},
error: getFunction(element.getAttribute("data-ajax-failure"), ["xhr", "status", "error"])
});
options.data.push({ name: "X-Requested-With", value: "XMLHttpRequest" });
method = options.type.toUpperCase();
if (!isMethodProxySafe(method)) {
options.type = "POST";
options.data.push({ name: "X-HTTP-Method-Override", value: method });
}
$.ajax(options);
}
function validate(form) {
var validationInfo = $(form).data(data_validation);
return !validationInfo || !validationInfo.validate || validationInfo.validate();
}
$(document).on("click", "a[data-ajax=true]", function (evt) {
evt.preventDefault();
asyncRequest(this, {
url: this.href,
type: "GET",
data: []
});
});
$(document).on("click", "form[data-ajax=true] input[type=image]", function (evt) {
var name = evt.target.name,
$target = $(evt.target),
form = $target.parents("form")[0],
offset = $target.offset();
$(form).data(data_click, [
{ name: name + ".x", value: Math.round(evt.pageX - offset.left) },
{ name: name + ".y", value: Math.round(evt.pageY - offset.top) }
]);
setTimeout(function () {
$(form).removeData(data_click);
}, 0);
});
$(document).on("click", "form[data-ajax=true] :submit", function (evt) {
var name = evt.target.name,
form = $(evt.target).parents("form")[0];
$(form).data(data_click, name ? [{ name: name, value: evt.target.value }] : []);
setTimeout(function () {
$(form).removeData(data_click);
}, 0);
});
$(document).on("submit", "form[data-ajax=true]", function (evt) {
var clickInfo = $(this).data(data_click) || [];
evt.preventDefault();
if (!validate(this)) {
return;
}
asyncRequest(this, {
url: this.action,
type: this.method || "GET",
data: clickInfo.concat($(this).serializeArray())
});
});
}(jQuery));
/***
End /Themes/1/Default/Js/libraries/jquery.unobtrusive-ajax.js
***/
/***
Begin /Themes/1/Default/Js/libraries/device.js
***/
(function() {
var previousDevice, _addClass, _doc_element, _find, _handleOrientation, _hasClass, _orientation_event, _removeClass, _supports_orientation, _user_agent;
previousDevice = window.device;
window.device = {};
_doc_element = window.document.documentElement;
_user_agent = window.navigator.userAgent.toLowerCase();
device.ios = function() {
return device.iphone() || device.ipod() || device.ipad();
};
device.iphone = function() {
return _find('iphone');
};
device.ipod = function() {
return _find('ipod');
};
device.ipad = function() {
return _find('ipad');
};
device.android = function() {
return _find('android');
};
device.androidPhone = function() {
return device.android() && _find('mobile');
};
device.androidTablet = function() {
return device.android() && !_find('mobile');
};
device.blackberry = function() {
return _find('blackberry') || _find('bb10') || _find('rim');
};
device.blackberryPhone = function() {
return device.blackberry() && !_find('tablet');
};
device.blackberryTablet = function() {
return device.blackberry() && _find('tablet');
};
device.windows = function() {
return _find('windows');
};
device.windowsPhone = function() {
return device.windows() && _find('phone');
};
device.windowsTablet = function() {
return device.windows() && (_find('touch') && !device.windowsPhone());
};
device.fxos = function() {
return (_find('(mobile;') || _find('(tablet;')) && _find('; rv:');
};
device.fxosPhone = function() {
return device.fxos() && _find('mobile');
};
device.fxosTablet = function() {
return device.fxos() && _find('tablet');
};
device.meego = function() {
return _find('meego');
};
device.cordova = function() {
return window.cordova && location.protocol === 'file:';
};
device.nodeWebkit = function() {
return typeof window.process === 'object';
};
device.mobile = function() {
return device.androidPhone() || device.iphone() || device.ipod() || device.windowsPhone() || device.blackberryPhone() || device.fxosPhone() || device.meego();
};
device.tablet = function() {
return device.ipad() || device.androidTablet() || device.blackberryTablet() || device.windowsTablet() || device.fxosTablet();
};
device.desktop = function() {
return !device.tablet() && !device.mobile();
};
device.portrait = function() {
return (window.innerHeight / window.innerWidth) > 1;
};
device.landscape = function() {
return (window.innerHeight / window.innerWidth) < 1;
};
device.noConflict = function() {
window.device = previousDevice;
return this;
};
_find = function(needle) {
return _user_agent.indexOf(needle) !== -1;
};
_hasClass = function(class_name) {
var regex;
regex = new RegExp(class_name, 'i');
return _doc_element.className.match(regex);
};
_addClass = function(class_name) {
if (!_hasClass(class_name)) {
return _doc_element.className += " " + class_name;
}
};
_removeClass = function(class_name) {
if (_hasClass(class_name)) {
return _doc_element.className = _doc_element.className.replace(class_name, "");
}
};
if (device.ios()) {
if (device.ipad()) {
// _addClass("ios ipad tablet");
} else if (device.iphone()) {
// _addClass("ios iphone mobile");
} else if (device.ipod()) {
//_addClass("ios ipod mobile");
}
} else if (device.android()) {
if (device.androidTablet()) {
// _addClass("android tablet");
} else {
//_addClass("android mobile");
}
} else if (device.blackberry()) {
if (device.blackberryTablet()) {
//_addClass("blackberry tablet");
} else {
//_addClass("blackberry mobile");
}
} else if (device.windows()) {
if (device.windowsTablet()) {
//_addClass("windows tablet");
} else if (device.windowsPhone()) {
// _addClass("windows mobile");
} else {
_addClass("desktop");
}
} else if (device.fxos()) {
if (device.fxosTablet()) {
_addClass("fxos tablet");
} else {
_addClass("fxos mobile");
}
} else if (device.meego()) {
_addClass("meego mobile");
} else if (device.nodeWebkit()) {
_addClass("node-webkit");
} else {
_addClass("desktop");
}
if (device.cordova()) {
_addClass("cordova");
}
_handleOrientation = function() {
if (device.landscape()) {
_removeClass("portrait");
return _addClass("landscape");
} else {
_removeClass("landscape");
return _addClass("portrait");
}
};
_supports_orientation = "onorientationchange" in window;
_orientation_event = _supports_orientation ? "orientationchange" : "resize";
if (window.addEventListener) {
window.addEventListener(_orientation_event, _handleOrientation, false);
} else if (window.attachEvent) {
window.attachEvent(_orientation_event, _handleOrientation);
} else {
window[_orientation_event] = _handleOrientation;
}
_handleOrientation();
}).call(this);
/***
End /Themes/1/Default/Js/libraries/device.js
***/
/***
Begin /Themes/1/Default/Js/libraries/jquery.cookie.js
***/
/*jshint eqnull:true */
/*!
* jQuery Cookie Plugin v1.1
* https://github.com/carhartl/jquery-cookie
*
* Copyright 2011, Klaus Hartl
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://www.opensource.org/licenses/mit-license.php
* http://www.opensource.org/licenses/GPL-2.0
*/
(function($, document) {
var pluses = /\+/g;
function raw(s) {
return s;
}
function decoded(s) {
return decodeURIComponent(s.replace(pluses, ' '));
}
$.cookie = function(key, value, options) {
// key and at least value given, set cookie...
if (arguments.length > 1 && (!/Object/.test(Object.prototype.toString.call(value)) || value == null)) {
options = $.extend({}, $.cookie.defaults, options);
if (value == null) {
options.expires = -1;
}
if (typeof options.expires === 'number') {
var days = options.expires, t = options.expires = new Date();
t.setDate(t.getDate() + days);
}
value = String(value);
return (document.cookie = [
encodeURIComponent(key), '=', options.raw ? value : encodeURIComponent(value),
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
options.path ? '; path=' + options.path : '',
options.domain ? '; domain=' + options.domain : '',
options.secure ? '; secure' : ''
].join(''));
}
// key and possibly options given, get cookie...
options = value || $.cookie.defaults || {};
var decode = options.raw ? raw : decoded;
var cookies = document.cookie.split('; ');
for (var i = 0, parts; (parts = cookies[i] && cookies[i].split('=')); i++) {
if (decode(parts.shift()) === key) {
return decode(parts.join('='));
}
}
return null;
};
$.cookie.defaults = {};
})(jQuery, document);
/***
End /Themes/1/Default/Js/libraries/jquery.cookie.js
***/
/***
Begin /Themes/1/Default/Js/scripts/Polls.js
***/
jQuery.fn.Poll = function(pollId, templateId){
var Container = jQuery(this);
var ResultsUrl = '';//'/ajax.aspx?m=Nv.SqlModule&name=PollView&p='+ pollId +'&la=' + NvPage.LanguageId + '&v=1' + (templateId ? '&ct=' + templateId : '');
var FormUrl = ''; //'/ajax.aspx?m=Nv.SqlModule&name=PollView&p='+ pollId +'&la=' + NvPage.LanguageId + (templateId ? '&ct=' + templateId : '');
var PostUrl = ''; //'/ajax.aspx?m=Nv.SqlModule&name=PollSubmitVote&p='+ pollId +'&la=' + NvPage.LanguageId
var cookieName = 'polls';
var posting = false;
function AddPoll(){
var VotedPolls = (jQuery.cookie(cookieName) || '' ).split(',');
VotedPolls.push(pollId);
jQuery.cookie(cookieName, VotedPolls.join(','), { path: '/', expires: 1000 });
}
function HasVoted()
{
var VotedPolls = (jQuery.cookie(cookieName) || '' ).split(',');
for(var i = 0; i < VotedPolls.length; i++)
{
if(parseInt(VotedPolls[i]) == pollId)
{
return true;
}
}
return false;
}
function Ajax(url,callback)
{
jQuery.ajax(
{
url: url,
success: function(r){
Container.html(r);
callback();
$('.voting .radio input[type=radio]:first').attr("checked", "checked");
$('.voting .radio input[type=radio]:first').click();
$('.voting .radio input[type=radio]:checked').parent('.icon').addClass('checked');
/* radios*/
$('.voting .radio input[type=radio]').change(function(){
var name = $('.voting .radio input').attr('name');
$('.voting .radio input[name="'+name+'"]').parent('.icon').removeClass('checked');
});
$('.voting .radio input:checked').parent('.icon').addClass('checked');
$('.voting .radio input').change(function(){
$(this).parent('.icon').toggleClass('checked');
});
/*////*/
}
}
);
}
function Post(Values, callback)
{
jQuery.post(PostUrl, {"vote": Values}, callback, 'xml');
}
// Returns the values that are to be posted.
function GetValues(){
var Result = [];
jQuery("input[type=radio]:checked", Container).each(function(){
Result.push(jQuery(this).val());
});
return Result;
}
function OnDisplayResults()
{
}
function OnDisplayForm()
{
if(jQuery("#submit-poll", Container).length)
{
jQuery("#submit-poll", Container).click(function(e){
e.preventDefault();
var Values = GetValues();
if(!Values.length)
{
alert('Polls_NothingSelected_Value');
return;
}
if(posting)
{
alert('Polls_PleaseWait_Value');
}
posting = true;
Post(Values, function(response){
posting = false;
var x = jQuery(response).find('Response');
if(x.attr("Type") == "Success"){
AddPoll();
Ajax(ResultsUrl, OnDisplayResults);
}
else{
alert(x.find('Message').text());
}
});
});
jQuery('#poll-results',Container).click(function(e){
e.preventDefault();
Ajax(ResultsUrl, OnDisplayResults);
});
}
else
{
// The poll is not open for voting
OnDisplayResults();
}
}
if(HasVoted())
{
Ajax(ResultsUrl, OnDisplayResults);
}
else
{
Ajax(FormUrl, OnDisplayForm);
}
}
/***
End /Themes/1/Default/Js/scripts/Polls.js
***/
/***
Begin /Themes/1/Default/Js/scripts/PollArchive.js
***/
/***
Missing file '/Themes/1/Default/Js/scripts/parseUri.js'
***/
var PollArchive = new (function(){
this.Init = function(container){
this.Container = container;
this.Results
this.Controls = {
DateFrom: $("#datefrom",container).ePublishDatepicker(),
DateTo: $("#dateto",container).ePublishDatepicker(),
SearchButton: $(':submit',container),
Results: $("#results", container)
};
this.Controls.SearchButton.click(OnSearchButtonClick);
var uri = parseUri(window.location.href);
var pollid;
if(uri.queryKey['pollId'] && (pollid = parseInt(uri.queryKey['pollId']))){
this.GetPollPage(pollid);
}
else{
this.CallServer(
this.Controls.DateFrom.val(),
this.Controls.DateTo.val(),
1
);
}
}
function DatePickerHasLaterDateThan(dpElement1,dpElement2){
return DatePickerComparisonValue(dpElement1) > DatePickerComparisonValue(dpElement2);
}
function DatePickerComparisonValue(dpElement){
if(!dpElement.val())
return 0;
var parts = dpElement.val().split('/');
if(parts.length != 3)
return 0;
return parts[0] * 1 + parts[1] * 2 + parts[2] * 3;
}
function OnResultsLinkClick(e){
var uri = parseUri($(this).attr('href'));
var pollId;
if(uri.anchor && (pollId = parseInt(uri.anchor))){
e.preventDefault();
var container = $(this).parents('li');
if(container.is('.close')){
container.find('.poll-container').Poll(pollId);
container.removeClass('close').addClass('open');
}
else{
container.removeClass('open').addClass('close');
}
}
}
function OnSearchButtonClick(e){
e.preventDefault();
if(DatePickerHasLaterDateThan(PollArchive.Controls.DateFrom, PollArchive.Controls.DateTo)){
alert('PollArchive_InvalidSearchDates_Value');
return;
}
PollArchive.CallServer(
PollArchive.Controls.DateFrom.val(),
PollArchive.Controls.DateTo.val(),
1
);
}
this.CallServer = function(dateFrom, dateTo, pageIndex){
var rp = this.Controls.Results;
jQuery.ajax({
url: '/Sys/PollArchive/',
data: { la: NvPage.LanguageId, DateFrom: dateFrom, DateTo: dateTo, PageIndex: pageIndex},
success: function(r){
rp.html(r);
rp.find('a').click(OnResultsLinkClick);
}
});
}
this.GetPollPage = function(pollID){
var rp = this.Controls.Results;
jQuery.ajax({
url: '/Sys/PollArchive/Poll',
data: { la: NvPage.LanguageId, ID: pollID},
success: function(r){
rp.html(r);
rp.find('a').click(OnResultsLinkClick).first().click();
}
});
}
})();
/***
End /Themes/1/Default/Js/scripts/PollArchive.js
***/
/***
Begin /Themes/1/Default/Js/libraries/weather-common.js
***/
//Deltio Kairou
$(function () {
$("body").on("click", function (e) {
var $weatherWidgetTrigger = $('.links-dark li#weather_menu_item a'),
$weatherWidget = $('.weather_widget_header'),
$target = $(e.target);
if ( $target.parents(".weather_widget_header").length === 0
&& $target.parents(".ui-autocomplete").length === 0) {
if ($weatherWidgetTrigger.hasClass('active_weather')) {
$weatherWidgetTrigger.toggleClass('active_weather',600).promise().done(function(){
$('.border_div').toggle();
$weatherWidget.slideToggle();
});
}
}
})
function setUpWeatherClickEvents () {
$(document).on('click', function (e) {
if ($(e.target).closest(".weatherBlock,.ui-autocomplete").length === 0) {
$(".weatherBlock").slideUp();
}
});
$("body").on("click", ".links-dark li#weather_menu_item", function(event) {
event.preventDefault();
event.stopPropagation();
$('.links-dark li#weather_menu_item a').toggleClass('active_weather',600).promise().done(function(){
$('.border_div').toggle();
$('.weather_widget_header').slideToggle();
if($(".etToday").is(":visible"))
$('.paper').toggleClass('open').children('.etToday').slideToggle();
});
})
//Deltio Kairou mobile width
$("body").on("click", ".dark.iconed.menu.mobile ul li#weather_menu_item", function(event){
event.preventDefault();
event.stopPropagation();
$(this).parent().parent().parent().parent().toggleClass('active',600).promise().done(function(){
$('.weather_widget_header').slideToggle();
});
})
}
//Deltio Kairou on resize hide
$(window).on('resize', function(){
if ($('#weather_menu_item a').hasClass('active_weather')) {
$('.links-dark li#weather_menu_item a').removeClass();
$('.links-dark li#weather_menu_item a div').hide();
$('.weather_widget_header').hide();
}
});
var weatherWidgets = (function () {
var defaultDkId = 5804,
//kalo dkId = $.cookie("dkid") || defaultDkId,
module = "Atcom.Sites.DeltioKairou.Client.PointWeather",
templates = {
link: "HeaderLinkWeather",
headerBox: "HeaderLinkWeatherBox",
mainBox: "WeatherInfo"
};
function requestHeaderLinkWidget (fn) {
}
function requestHeaderBoxWidget (fn) {
}
function requestMainWidget (fn) {
}
function onSelectHandler (event, obj) {
var dkId = obj.item.id
refreshHeaderWidgets(dkId);
}
function onSelectMainHandler (event, obj) {
var dkId = obj.item.id
updateCookie(dkId);
window.location.href = "weather/?dkid=" + dkId;
}
function loadHeaderWidgets () {
var mainBoxContainer = $(".dk-weather-container");
requestHeaderLinkWidget(function (data) {
$("#header ul.links-dark li").last().before(data);
setUpWeatherClickEvents();
});
requestHeaderBoxWidget(function (data) {
$("#header ul.links-dark").after(data);
$("#dk-sec-input").ACpointControl(onSelectHandler);
});
if (mainBoxContainer.length > 0) {
requestMainWidget(function (data) {
mainBoxContainer.append(data);
$("#dk-main-input").ACpointControl(onSelectMainHandler);
})
}
}
function updateCookie (id) {
dkId = id;
$.cookie("dkid", dkId, { expires: 1000, path: "/" });
}
function refreshHeaderWidgets (id) {
updateCookie(id);
requestHeaderLinkWidget(function (data) {
var $data = $(data), htmlToInject = $data.html();
$('.links-dark li#weather_menu_item').html(htmlToInject);
$('.links-dark li#weather_menu_item a').addClass("active_weather");
});
requestHeaderBoxWidget(function (data) {
// var $data = $(data), htmlToInject = $(".both_part_weather", $data).html();
// $(".both_part_weather").html(htmlToInject);
var $data = $(data), htmlToInject = $(".bottom_part_weather", $data).html();
$(".weather_widget_header .bottom_part_weather").html(htmlToInject);
var $data2 = $(data), htmlToInject2 = $('.topLocationSearch', $data2).html();
$(".topLocationSearch").html(htmlToInject2);
$('.weatherBlock .top_part_weather').hide();
});
}
return {
load: loadHeaderWidgets,
refresh: refreshHeaderWidgets,
updateCookie: updateCookie
}
}());
weatherWidgets.load();
//Deltio Kairou onresize iframe
window.new_height;
window.aspect_ratio_big = (763/1000);
window.aspect_ratio_medium = (552/950);
window.aspect_ratio_small = (480/900);
window.aspect_ratio_smaller = (391/700);
window.aspect_ratio_smaller2 = (309/600);
window.aspect_ratio_smaller3 = (309/579);
aspect_ratio_finder();
// console.log($('#iframe_map').width());
$(window).on('resize', function () {
aspect_ratio_finder();
});
// $("body").on("click", ".top_part_weather input[type='button']", function(event) {
// weatherWidgets.updateCookie();
// weatherWidgets.load();
// })
});
//$('[name=keyword]').searchable();
$.fn.ACpointControl = function (selectFN) {
if (this.length > 1) {
throw "More than one Element";
}
var $input = this,
$submit = this.closest("[type='button']");
var onSelect = typeof selectFN === "function" ? selectFN : (function ( event, ui ) {
window.location.href = "kairos/?dkid=" + ui.item.id;
});
function endsWith (value, suffix) {
return value.indexOf(suffix, value.length - suffix.length) !== -1;
}
function startsWith (value, prefix) {
return value.slice(0, prefix.length) === prefix;
}
function removeAt (value, index) {
return value.substring(0, index) + value.substring(index + 1, value.length);
}
function createDisplay (itm) {
var result = "";
for (var i = 0; i < arguments.length; i++) {
if (typeof arguments[i] === "undefined"
|| arguments[i] === null
|| arguments[i].toLowerCase() === "null"
|| arguments[i] === ''
|| result.indexOf(arguments[i]) !== -1){
continue;
}
result += " " + arguments[i];
if (i + 1 !== arguments.length) {
result += ",";
}
}
//result = result.trimEnd();
if (endsWith(result, ',')) {
result = removeAt(result, result.length - 1);
}
return result;
};
return this;
}
/* --- FUNCTIONS --- */
//Deltio kairou anazhthsh hide show default text
function blank(a) { if (a.value == a.defaultValue) a.value = ''; }
function unblank(a) { if ($.trim(a.value) == '') a.value = a.defaultValue; }
//Deltio kairou iframe map aspect ratio finder
function aspect_ratio_finder(){
/*$('#iframe_map').height(1000);
return*/
if ((($('#iframe_map').width()) < 552) && (($('#iframe_map').width()) >= 480)){
new_height = $('#iframe_map').width() * (1/window.aspect_ratio_medium);
$('#iframe_map').height(new_height);
}
else if ((($('#iframe_map').width()) < 480) && (($('#iframe_map').width()) >= 445)){
new_height = $('#iframe_map').width() * (1/window.aspect_ratio_small);
$('#iframe_map').height(new_height);
}
else if ((($('#iframe_map').width()) < 445) && (($('#iframe_map').width()) > 360)){
new_height = $('#iframe_map').width() * (1/window.aspect_ratio_smaller);
$('#iframe_map').height(new_height);
}
else if ((($('#iframe_map').width()) <= 360) && (($('#iframe_map').width()) > 310)){
new_height = $('#iframe_map').width() * (1/window.aspect_ratio_smaller2);
$('#iframe_map').height(new_height);
}
else if (($('#iframe_map').width()) <= 310){
new_height = $('#iframe_map').width() * (1/window.aspect_ratio_smaller2);
$('#iframe_map').height(new_height);
}
else {
new_height = $('#iframe_map').width() * (1/window.aspect_ratio_big);
$('#iframe_map').height(new_height);
}
}
/***
End /Themes/1/Default/Js/libraries/weather-common.js
***/
/***
Begin /Themes/1/Default/Js/scripts/common.js
***/
var pageURL = '';
var pageTitle = '';
$.fn.scrollEnd = function(callback, timeout) {
$(this).scroll(function(){
var $this = $(this);
if ($this.data('scrollTimeout')) {
clearTimeout($this.data('scrollTimeout'));
}
$this.data('scrollTimeout', setTimeout(callback,timeout));
});
};
var GetDevice = {
browserChrome: /chrome/.test(navigator.userAgent.toLowerCase()),
element: document.getElementsByTagName("html")[0],
IE: function () {
var myNav = navigator.userAgent.toLowerCase();
return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;
},
winWidth: function () {
var _return;
if (this.browserChrome) {
_return = window.innerWidth;
} else {
_return = window.innerWidth + 17;
}
return _return;
},
maxTabletWidth: function () {
var _return;
if (this.IE()) {
_return = 0;
}
else {
_return = 767;
}
return _return;
},
minTabletWidth: function () {
var _return;
if (this.IE()) {
_return = 0;
}
else {
_return = 480;
}
return _return;
},
device: function () {
var _return;
if ((this.winWidth() < this.maxTabletWidth()) && (this.winWidth() >= this.minTabletWidth())) {
_return = "tablet";
}
else if (this.winWidth() < this.minTabletWidth()) {
_return = "mobile";
} else {
_return = "desktop";
}
_return = "desktop";
return _return;
}
}
function articleClick(event){
var articleId = jQuery(this).data('articleid');
if (isIE() && isIE() <= 9) {return;}
event.preventDefault();
if(pageURL == ''){
pageURL = window.location.href;
}
var categoryId = jQuery(this).data('categoryid');
window.history.pushState({cid: categoryId, aid: articleId}, "opened", jQuery(this).attr('href'));
if(pageTitle == ''){
pageTitle = document.title;
}
document.title = jQuery(this).attr('title');
ga('send', 'article', 'view', jQuery(this).attr('title'));
jQuery.ajax({
type: "GET",
url: "/ajax.aspx",
data: {
la: 1,
aid: articleId,
cid: categoryId,
template: "articleview",
m: "Atcom.Sites.Etypos.Modules.ArticleView"
},
complete: function(){
jQuery(".lightboxShow:not(.handled)").each(function(){
jQuery(this).addClass('handled').wrap('
')
});
}
}).done(function(html){
var article = '
'
+'
'
jQuery('.mainContent').before(article);
setTimeout(function(){
$("div.article_wrapper").eq(1).addClass("open");
$(".article_close").eq(1).addClass("open");
},10)
setTimeout(function(){
jQuery('.article_close').eq(0).remove().removeClass("open");
jQuery('div.article_wrapper').eq(0).remove();
//jQuery("#article-comments-captcha").attr("src","/ajax.aspx?m=Nv.Captcha&t=4711&w=112&h=40&_=" + Math.random());
jQuery('.promoSlider.innerPage').owlCarousel({
items : 1,
singleItem : true,
navigation : true,
pagination : false,
addClassActive:true,
mouseDrag: false,
transitionStyle : 'fade',
afterInit : start,
afterMove : moved,
touchDrag : false
});
jQuery(".lightboxShow").each(function(){
jQuery(this).wrap('
')
});
var pollid= jQuery(".artRight .radios").attr("id");
jQuery('#' + pollid + '').Poll(pollid.split("-")[1]);
},400);
jQuery('a[data-type="article"]').unbind("click");
jQuery('a[data-type="article"]').click(articleClick);
/*kalo
$('.facebookArt').click(function(e){
e.preventDefault();
FB.ui(
{
method: 'feed',
name: document.title,
link: window.location.href,
picture: $(this).attr('data-image'),
caption: $(this).attr('data-title'),
description: '',
message: ''
});
});
jQuery('#articleFacebook').click(function(event){
event.preventDefault();
FB.ui({
method: 'share',
href: window.location.href,
}, function(response){});
url = 'https://www.facebook.com/sharer/sharer.php?app_id=113869198637480&sdk=joey&u=' + window.location.href + '&display=popup&ref=plugin';
window.open(url, 'Radio', 'width=800,height=600,menubar=0,scrollbars=0,status=0,titlebar=0,toolbar=0');
})
*/
jQuery('#articleTwitter').click(function(event){
event.preventDefault();
var twitterUrl = 'https://twitter.com/share?url='
+ encodeURIComponent(window.location.href)
+ '&text='
+ encodeURIComponent(document.title)
var width = 575,
height = 400,
left = ($(window).width() - width) / 2,
top = ($(window).height() - height) / 2,
opts = 'status=1' +
',width=' + width +
',height=' + height +
',top=' + top +
',left=' + left;
window.open(twitterUrl, 'twitter', opts);
});
jQuery('#articleGoogle').click(function(event){
event.preventDefault();
var twitterUrl = 'https://plus.google.com/share?url='
+ encodeURIComponent(window.location.href);
var width = 575,
height = 400,
left = ($(window).width() - width) / 2,
top = ($(window).height() - height) / 2,
opts = 'status=1' +
',width=' + width +
',height=' + height +
',top=' + top +
',left=' + left;
window.open(twitterUrl, 'twitter', opts);
});
jQuery('#articlePrint').click(function(event){
event.preventDefault();
window.print();
});
jQuery('#articleImage').click(function(event){
event.preventDefault();
jQuery('#articleVideo iframe').attr('src', jQuery('#articleVideo iframe').attr('src') + '?autoplay=1');
jQuery('#articleVideo').show();
jQuery(this).hide();
});
//kalo $('.mainContent, #sidebar, .article_wrapper').css({height:$(window).innerHeight() - 85});
});
jQuery.ajax({
type: "GET",
url: "/ajax.aspx",
data: {
la: 1,
aid: articleId,
m: "Atcom.Sites.Etypos.Modules.ArticleHit"
}
});
}
var promoSlider;
$(function() {
setTimeout(function(){
$('.mainContent').show();
}, 300);
//if(device.desktop()){
$(".mainContent").css({
"overflow-y" : "auto",
"overflow-x" : "hidden"
});
// }
//alert(device.desktop());
var over = false;
$( "#sidebar" )
.mouseover(function() {
if(over){return}
// console.log('panwsitebar00:',over );
if(!$("#sidebar").hasClass("front") && $(".article_wrapper.open").length>0){
over = true;
$(".article_wrapper").addClass("flip");
setTimeout(function(){$("#sidebar").addClass("front");},200)
setTimeout(function(){ $(".article_wrapper").removeClass("flip"); over = false;},400);
}
})
$("body")
.on('mouseover', '.article_wrapper', function() {
if(over){return}
// console.log('body00:',over );
if( $("#sidebar").hasClass("front") > 0 && $(".article_wrapper.open").length>0){
over = true;
$(".article_wrapper").addClass("flip");
setTimeout(function(){$("#sidebar").removeClass("front");},200)
setTimeout(function(){ $(".article_wrapper").removeClass("flip"); over = false;},400);
}
})
$('.VideoImg').click(function(event){
event.preventDefault();
var url = $(this).next('.VideoIframe').find('iframe').attr('src');
if (url.indexOf('?') == -1)
$(this).next('.VideoIframe').find('iframe').attr('src', url + '?autoplay=1');
else
$(this).next('.VideoIframe').find('iframe').attr('src', url + '&autoplay=1');
$(this).next('.VideoIframe').show();
$(this).hide();
});
/*jQuery('#comments-submit').click(function(event){
var res = true;
$(".comments .form input[type='text'],input[type='email'],textarea").each(function() {
if($(this).val().trim() == "") {
res = false;
$(this).parent('div').addClass("error");
if($(this).is("#captcha"))
$(this).parent().parent('div.row').addClass("error");
}
else{
$(this).parent('div').removeClass("error");
$(this).parent().parent('div.row').removeClass("error");
}
})
var regExpr = new RegExp("^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$");
$("input[type='email']").each(function() {
if (!regExpr.test( $(this).val())) {
$(this).parent('div').addClass("error");
$(this).next('p').html("Το email δεν είναι έγκυρο");
res = false;
}
})
if(res){
event.preventDefault();
jQuery.ajax({
type: "GET",
url: "/ajax.aspx",
data: {
la: 1,
aid: jQuery('#article-id').val(),
comment: jQuery('#comment').val(),
email: jQuery('#email').val(),
name: jQuery('#name').val(),
captcha: jQuery('#captcha').val(),
ArtcomparId: jQuery("#hidArtcomparId").html(),
m: "Atcom.Sites.Etypos.Modules.AddComment"
},
success: function( data){
var msg = $.parseJSON(data);
if(msg.Success){
$(".MsgSuccess").show().delay(5000).queue(function(n) {
$(this).hide(); n();
});
$('captcha').removeClass("error");
$(".form :input").each(function(){
$(this).val('');
});
$("#article-comments-captcha").attr("src","/ajax.aspx?m=Nv.Captcha&t=4711&w=112&h=40&_=" + Math.random());
$("#hidArtcomparId").html('0');
}else{
$(".MsgFail").show().delay(5000).queue(function(n) {
$(this).hide(); n();
});
$('.captcha').addClass("error");
}
},
error: function( ){
$(".MsgFail").show().delay(5000).queue(function(n) {
$(this).hide(); n();
});
}
})
}
else
return res; // returning false will prevent the form from submitting.
});*/
jQuery('#printedMaterialsDatePicker').change(function(event) {
jQuery('#printedMaterialsFilter').submit();
});
jQuery('#materialCategorySelect').change(function(event) {
jQuery('#printedMaterialsFilter').submit();
});
jQuery('#articleImage').click(function(event){
event.preventDefault();
var url = jQuery('#articleVideo iframe').attr('src');
if (url.indexOf('?') == -1)
jQuery('#articleVideo iframe').attr('src', url + '?autoplay=1');
else
jQuery('#articleVideo iframe').attr('src', url + '&autoplay=1');
jQuery('#articleVideo').show();
jQuery(this).hide();
});
jQuery('#newsticker').newsTicker();
/*
//Facebook
$('.facebookArt').click(function(e){
e.preventDefault();
FB.ui(
{
method: 'feed',
name: document.title,
link: window.location.href,
picture: $(this).attr('data-image'),
caption: $(this).attr('data-title'),
description: '',
message: ''
});
});
jQuery('#articleFacebook, #ShareFacebookImage, a.facebook[data-type="FbLink"]').click(function(event){
event.preventDefault();
//alert('hhhh1');
FB.ui({
method: 'share',
href: window.location.href,
}, function(response){});
url = 'https://www.facebook.com/sharer/sharer.php?app_id=113869198637480&sdk=joey&u=' + window.location.href + '&display=popup&ref=plugin'
window.open(url, 'e-typos', 'width=800,height=600,menubar=0,scrollbars=0,status=0,titlebar=0,toolbar=0');
})
jQuery('body').on('click','#articleFacebook, #ShareFacebookImage, a.facebook[data-type="FbLink"]', function(event){
event.preventDefault();
//alert('hhhh2');
FB.ui({
method: 'share',
href: window.location.href,
}, function(response){});
url = 'https://www.facebook.com/sharer/sharer.php?app_id=113869198637480&sdk=joey&u=' + window.location.href + '&display=popup&ref=plugin';
window.open(url, 'Radio', 'width=800,height=600,menubar=0,scrollbars=0,status=0,titlebar=0,toolbar=0');
})
*/
//Twitter
jQuery('#articleTwitter, #ShareTwitterImage, a.twitter[data-type="TwitterLink"]').click(function(event){
event.preventDefault();
//alert('hhhh');
var twitterUrl = 'https://twitter.com/share?url='
+ encodeURIComponent(document.domain + $(this).attr('href'))
+ '&text='
+ encodeURIComponent($(this).data('title') + ' ' + window.location.href );
var width = 575,
height = 400,
left = ($(window).width() - width) / 2,
top = ($(window).height() - height) / 2,
opts = 'status=1' +
',width=' + width +
',height=' + height +
',top=' + top +
',left=' + left;
window.open(twitterUrl, 'twitter', opts);
});
jQuery('body').on('click','#articleTwitter, #ShareTwitterImage, a.twitter[data-type="TwitterLink"]', function(event){
event.preventDefault();
var twitterUrl = 'https://twitter.com/share?url='
+ encodeURIComponent(document.domain + $(this).attr('href'))
+ '&text='
+ encodeURIComponent($(this).data('title') + ' ' + window.location.href );
var width = 575,
height = 400,
left = ($(window).width() - width) / 2,
top = ($(window).height() - height) / 2,
opts = 'status=1' +
',width=' + width +
',height=' + height +
',top=' + top +
',left=' + left;
window.open(twitterUrl, 'twitter', opts);
});
//Google
jQuery('body').on('click','#articleGoogle, a.google[data-type="GoogleLink"]', function(event){
event.preventDefault();
var twitterUrl = 'https://plus.google.com/share?url='
+ encodeURIComponent(window.location.href);
var width = 575,
height = 400,
left = ($(window).width() - width) / 2,
top = ($(window).height() - height) / 2,
opts = 'status=1' +
',width=' + width +
',height=' + height +
',top=' + top +
',left=' + left;
window.open(twitterUrl, 'twitter', opts);
});
jQuery('#articleGoogle').click(function(event){
event.preventDefault();
var twitterUrl = 'https://plus.google.com/share?url='
+ encodeURIComponent(window.location.href);
var width = 575,
height = 400,
left = ($(window).width() - width) / 2,
top = ($(window).height() - height) / 2,
opts = 'status=1' +
',width=' + width +
',height=' + height +
',top=' + top +
',left=' + left;
window.open(twitterUrl, 'twitter', opts);
});
$('a.google[data-type="GoogleLink"]').click(function (event) {
event.preventDefault();
var twitterUrl = 'https://plus.google.com/share?url='
+ encodeURIComponent(window.location.href);
var width = 575,
height = 400,
left = ($(window).width() - width) / 2,
top = ($(window).height() - height) / 2,
opts = 'status=1' +
',width=' + width +
',height=' + height +
',top=' + top +
',left=' + left;
window.open(twitterUrl, 'twitter', opts);
});
//Print
jQuery('body').on('click','#articlePrint', function(event){
event.preventDefault();
window.print();
});
jQuery('#articlePrint').click(function(event){
event.preventDefault();
window.print();
});
//Pinterest
jQuery('#articlePinterest,#SharePinterestImage, a.pinterest[data-type="pinterestLink"]').click(function(event){
event.preventDefault();
var media = $('.main_content .col_7 .list-article .img img').attr('src');
if(media === undefined)
media = $('meta[name="og:image"]').attr('content');
var description = $(this).attr('data-title');
var pinterestUrl = 'http://pinterest.com/pin/create/link/?Url='
+ encodeURIComponent(window.location.href)
+ '&media='
+ media
+ '&description='
+ description;
var width = 575,
height = 400,
left = ($(window).width() - width) / 2,
top = ($(window).height() - height) / 2,
opts = 'status=1' +
',width=' + width +
',height=' + height +
',top=' + top +
',left=' + left;
window.open(pinterestUrl, 'pinterest', opts);
});
jQuery('body').on('click','#articlePinterest,#SharePinterestImage, a.pinterest[data-type="pinterestLink"]', function(event){
event.preventDefault();
var media = $('.main_content .col_7 .list-article .img img').attr('src');
if(media === undefined)
media = $('meta[name="og:image"]').attr('content');
var description = $(this).attr('data-title');
var pinterestUrl = 'http://pinterest.com/pin/create/link/?Url='
+ encodeURIComponent(window.location.href)
+ '&media='
+ media
+ '&description='
+ description;
var width = 575,
height = 400,
left = ($(window).width() - width) / 2,
top = ($(window).height() - height) / 2,
opts = 'status=1' +
',width=' + width +
',height=' + height +
',top=' + top +
',left=' + left;
window.open(pinterestUrl, 'pinterest', opts);
});
$('.pinterestArt').click(function (event) {
event.preventDefault();
var media = $(this).attr('data-image');
var description = $(this).attr('data-title');
var pinterestUrl = 'http://pinterest.com/pin/create/link/?Url='
+ encodeURIComponent(window.location.href)
+ '&media='
+ media
+ '&description='
+ description;
var width = 575,
height = 400,
left = ($(window).width() - width) / 2,
top = ($(window).height() - height) / 2,
opts = 'status=1' +
',width=' + width +
',height=' + height +
',top=' + top +
',left=' + left;
window.open(pinterestUrl, 'pinterest', opts);
})
jQuery('body').on('click','#articleImage', function(event){
event.preventDefault();
var url = jQuery('#articleVideo iframe').attr('src');
if (url.indexOf('?') == -1)
jQuery('#articleVideo iframe').attr('src', url + '?autoplay=1');
else
jQuery('#articleVideo iframe').attr('src', url + '&autoplay=1');
jQuery('#articleVideo').show();
jQuery(this).hide();
});
//Linkedin
jQuery('#articleLinkedin').click(function(event){
event.preventDefault();
var media = $('.main_content .col_7 .list-article .img img').attr('src');
if(media === undefined)
media = $('meta[name="og:image"]').attr('content');
var description = $(this).attr('data-title');
var pinterestUrl = 'http://www.linkedin.com/shareArticle?mini=true&url='
+ encodeURIComponent(window.location.href)
+ '&title='
+ description;
var width = 575,
height = 400,
left = ($(window).width() - width) / 2,
top = ($(window).height() - height) / 2,
opts = 'status=1' +
',width=' + width +
',height=' + height +
',top=' + top +
',left=' + left;
window.open(pinterestUrl, 'pinterest', opts);
});
jQuery('body').on('click','#articleLinkedin', function(event){
event.preventDefault();
var media = $('.main_content .col_7 .list-article .img img').attr('src');
if(media === undefined)
media = $('meta[name="og:image"]').attr('content');
var description = $(this).attr('data-title');
var pinterestUrl = 'http://www.linkedin.com/shareArticle?mini=true&url='
+ encodeURIComponent(window.location.href)
+ '&title='
+ description;
var width = 575,
height = 400,
left = ($(window).width() - width) / 2,
top = ($(window).height() - height) / 2,
opts = 'status=1' +
',width=' + width +
',height=' + height +
',top=' + top +
',left=' + left;
window.open(pinterestUrl, 'pinterest', opts);
});
jQuery('body').on('click', '#comments-submit', function(event){
var res = true;
$(".comments .form input[type='text'],input[type='email'],textarea").each(function() {
if($(this).val().trim() == "") {
res = false;
$(this).parent('div').addClass("error");
if($(this).is("#captcha"))
$(this).parent().parent('div.row').addClass("error");
}
else{
$(this).parent('div').removeClass("error");
$(this).parent().parent('div.row').removeClass("error");
}
})
var regExpr = new RegExp("^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$");
$("input[type='email']").each(function() {
if (!regExpr.test( $(this).val())) {
$(this).parent('div').addClass("error");
$(this).next('p').html("Το email δεν είναι έγκυρο");
res = false;
}
})
if(res){
event.preventDefault();
jQuery.ajax({
type: "GET",
url: "/ajax.aspx",
data: {
la: 1,
aid: jQuery('#article-id').val(),
comment: jQuery('#comment').val(),
email: jQuery('#email').val(),
name: jQuery('#name').val(),
captcha: jQuery('#captcha').val(),
ArtcomparId: jQuery("#hidArtcomparId").html(),
m: "Atcom.Sites.Etypos.Modules.AddComment"
},
success: function( data){
var msg = $.parseJSON(data);
if(msg.Success){
$(".MsgSuccess").show().delay(5000).queue(function(n) {
$(this).hide(); n();
});
$('captcha').removeClass("error");
$(".form :input").each(function(){
$(this).val('');
});
$("#hidArtcomparId").html('0');
}else{
$(".MsgFail").show().delay(5000).queue(function(n) {
$(this).hide(); n();
});
$('.captcha').addClass("error");
}
},
error: function( ){
$(".MsgFail").show().delay(5000).queue(function(n) {
$(this).hide(); n();
});
}
})
}
else
return res; // returning false will prevent the form from submitting.
});
jQuery('a[data-type="article"]').click(articleClick);
$( ".datePicker" ).datepicker({ dateFormat: "dd/mm/yy" });
$("body").on("click",'.loader_button', function(event) {
event.preventDefault();
jQuery(this).addClass('active');
$.ajax({
type: "GET",
url: "/ajax.aspx",
data: {
la: 1,
m: "Nv.SqlModule",
name: "ArticlesFeedPaged",
pg: jQuery('.loader_button').data('page'),
template: "FeedMainRecentPaged",
showall: 1
},
success: function(data){
jQuery('#tabNews1 ul').append(data);
jQuery('.loader_button').removeClass('active');
jQuery('.loader_button').data('page', jQuery('.loader_button').data('page') + 1);
jQuery('a[data-type="article"]').click(articleClick);
}
});
});
// $("body").on("click",".weather.open, .paper.open .icon#openPapers", function(e){
// e.stopPropagation();
// var _this = $(".paper,.weather");
// $(_this).children("span").siblings('div').fadeOut();
// $(_this).children("span").parent('li').removeClass('open');
// });
// $("body").on("click",'.loader_button', function(e) {
// jQuery(this).addClass('active');
// $.ajax({
// type: "GET",
// url: "/ajax.aspx",
// data: {
// la: 1,
// m: "Nv.SqlModule",
// name: "ArticlesFeedPaged",
// pg: jQuery('.loader_button').data('page'),
// template: "FeedMainRecentPaged",
// showall: 1
// },
// success: function(data){
// jQuery('#tabNews1 ul').append(data);
// jQuery('.loader_button').removeClass('active');
// jQuery('.loader_button').data('page', jQuery('.loader_button').data('page') + 1);
// }
// });
// });
$("body").on("click",'.weather .icon, .paper .icon', function(e) {
var _this = $(".paper,.weather");
$('li.open').removeClass('open').children('div').hide();
$(_this).addClass('open');
$(_this).find('> div').fadeIn();
$(".resp_menu").removeClass("opened");
if($(".weatherBlock").is(":visible"))
$('.weather_widget_header').slideToggle();
e.stopPropagation();
});
$("body").on("click", ".paper .close.icon, .paper.open .icon", function(e){
e.preventDefault();
$('.paper').removeClass('open').children('.etToday').hide();
});
$("body").on("click", function(e){
//$('.openWeather, .etToday').not($(e.target).parent()).hide().parent().removeClass('open');
});
/*$("body").on("click", ".list-article h2 a", function(e){
e.preventDefault();
$('#sidebar').removeClass('overElement');
$(".article_wrapper").fadeIn().addClass("opened overElement");
$(".article_close").delay(800).fadeIn(800);
});*/
$('#sidebar, .article_wrapper').on('click', function(){
if($(this).hasClass('overElement')){return}
$('.overElement').removeClass('overElement');
$(this).addClass('overElement');
});
$('li.search #openSeacrh').click(function(e){
$("body").toggleClass("searchOpen");
});
$('.searchBar a.close').click(function(){
$("body").removeClass("searchOpen");
});
$('.weatherBlock a.settings').click(function(event) {
event.preventDefault();
$('.weatherBlock .top').toggleClass('edit');
});
//kalo $('.mainContent, #sidebar, .article_wrapper').css({height:$(window).innerHeight() - $('.alertBar').offset().top - $('.alertBar').height()});
//tabs
var openTab, _this;
$('.tabs .title a').click(function(event) {
event.preventDefault();
if($(this).hasClass('active')){
return false
}
openTab = $(this).attr('rel');
_this = $(this);
$('.tabs .title a.active, .tab.active').removeClass('active');
_this.addClass('active');
$('.tab#'+openTab).addClass('active');
});
//slider
$('.carousel3').owlCarousel({
items : 4,
itemsDesktop : [1024,4],
itemsTablet: [960,3],
itemsMobile : [580,1],
navigation : true,
pagination : false,
mouseDrag: false,
touchDrag : false
});
$('.carousel_minimal').owlCarousel({
items : 3,
itemsDesktop : [1024,3],
itemsTablet: [960,3],
itemsMobile : [550,2],
navigation : true,
pagination : false,
mouseDrag: false,
touchDrag : false
});
/* $(".fullCarousel").owlCarousel({
items : 1,
itemsDesktop : [1024,1],
itemsTablet: [960,1],
itemsMobile : [550,1],
navigation : true,
pagination : false,
mouseDrag: false
}); */
$('.promoSlider.innerPage').owlCarousel({
items : 1,
singleItem : true,
navigation : true,
pagination : false,
addClassActive:true,
mouseDrag: false,
transitionStyle : 'fade',
afterInit : start,
afterMove : moved,
touchDrag : false
});
$('.promoSlider').owlCarousel({
items : 1,
singleItem : true,
navigation : false,
pagination : true,
addClassActive:true,
mouseDrag: false,
transitionStyle : 'fade',
afterInit : start,
afterMove : moved,
touchDrag : false
});
promoSlider = $(".promoSlider").data('owlCarousel');
$('.promoThumbs li').first().addClass('activeElm');
$(".promoSlider , .promoThumbs").on('mouseover', function () {
isPause = true;
});
$(".promoSlider , .promoThumbs").on('mouseout', function () {
isPause = false;
});
var goToPromoIndex;
$('.promoThumbs a').click(function (event) {
event.preventDefault();
goToPromoIndex = $(this).parents('li').index();
if(jQuery('.promoThumbs ul a').index(jQuery(this)) == jQuery('.advertise').data('position')){
carouselAnimationEnabled = false;
}
promoSlider.goTo(goToPromoIndex);
});
$('select[name="month"]').val($.QueryString["month"] > 0 ? $.QueryString["month"] : $('input[name="monthhid"]').val());
if($.QueryString["year"] > 0)
$('select[name="year"]').val($.QueryString["year"]);
else
$('select[name="year"]').val($('input[name="yearhid"]').val());
$( ".dateOption select" ).change(function() {
$(this).parents('form').submit();
});
$(".promoSlider .item").addClass("shown");
jQuery(".lightboxShow").each(function(){
jQuery(this).wrap('
')
});
/*demos*/
$(".demo1").click(function(e) {
e.preventDefault();
$(".promoArea").toggle("blind");
});
$(".demo2").click(function(e) {
e.preventDefault();
$(".promoArea").toggle( "fade" );
});
$(".demo3").click(function(e) {
e.preventDefault();
$(".promoArea").toggle( "clip" );
});
$(".demo4").click(function(e) {
e.preventDefault();
$(".promoArea").toggle( "drop" );
});
$(".demo5").click(function(e) {
e.preventDefault();
$(".promoArea").toggle( "fold" );
});
$(".demo6").click(function(e) {
e.preventDefault();
$(".promoArea").toggle( "puff" );
});
$(".demo7").click(function(e) {
e.preventDefault();
$(".promoArea").toggle( "slide" );
});
$(".demo8").click(function(e) {
e.preventDefault();
});
$( "#font_resizer" ).slider();
$("body").on("click","#sidebar .resp_handle", function() {
$(this).parent().stop().toggleClass("open");
$(".mainContent").stop().toggleClass("fixed");
});
$("body").on("click","#sidebar .tabsWrap a", function() {
$(this).parents("#sidebar").toggleClass("open");
});
$("body").on("click",".resp_menu", function() {
if($(this).hasClass("opened")){
$(this).removeClass("opened").siblings("ul").hide();
}
else {
$(this).addClass("opened").siblings("ul").show();
if($("#header").height() > 100 && $("body").height() < 600){
$("body").addClass("overflow");
}
}
$(".weather").removeClass("open").children(".weatherBlock").hide();
menuHeight();
$(window).resize(function(){
menuHeight();
});
});
$("body").on("click",".options_sidebar .popUp .close, .ClosePopUp", function(e) {
e.preventDefault();
$(this).parents(".popUp").fadeOut();
});
/*kalo
$("body").on("click", ".article_close", function(){
if(pageURL == ''){
window.location = jQuery("#categoryUrl").val();
} else {
$("div.article_wrapper").toggleClass("opened open");
window.history.pushState({}, "opened", pageURL);
document.title = pageTitle;
}
jQuery('.article_close').hide();
});
*/
var hoverOrClick = function (e) {
e.preventDefault();
$(this).find(".popUp").fadeIn();
}
$('.options_sidebar ul li ').click(hoverOrClick);
$('.options_sidebar ul li .e-mail').click(function(e) {
e.preventDefault();
$(this).next(".popUp").fadeIn();
});
$("body").on("click",".options_sidebar ul li .e-mail", function(e) {
e.preventDefault();
$(this).next(".popUp").fadeIn();
});
// $('.todays .close').click(
// function (e) {
// $('.todays').fadeOut('slow');
// $( ".mainContent" ).unbind();
// $('.todays .close').hide();
// $('.todays').css({"position" : "relative","bottom":"0px", "z-index": "89"}).fadeIn("slow");
// }
// );
if($(window).width() > 768){
$( ".mainContent" ).scroll(function() {
var height = $('.mainContent').scrollTop();
if(height > 40 && height < ($('.mainContent').prop('scrollHeight') - 1300) ){
$('.todays .close').show();
$('.todays').show();
$('.todays').addClass('fixed-sml').css({"position" : "fixed","bottom":"0px", "z-index": "999999999"}).fadeIn("slow");
}else{
$('.todays .close').hide();
$('.todays').removeClass('fixed-sml');
}
if(height < 1200) {
$('.todays').hide();
}
});
}
$(".mainContent").bind('scroll', function() {
//console.log("todays");
$('.todays.fixed-sml.faded').removeClass('faded');
});
$('.mainContent').scrollEnd(function(){
$('.todays.fixed-sml').not('faded').addClass('faded');
}, 800);
setTimeout(function(){
$('.mainContent').show();
}, 300);
});
$(window).resize(function(event) {
//kalo $('.mainContent, #sidebar, .article_wrapper').css({height:$(window).innerHeight() - $('.alertBar').offset().top - $('.alertBar').height()});
});
var isPause, tick, percentTime, time = 5, carouselAnimationEnabled = true;
function start() {
$('.promoThumbs li .progress').css({ width: 0 });
clearTimeout(tick);
if (GetDevice.device() == "mobile") {
isPause = true;
} else {
percentTime = 0;
isPause = false;
tick = setInterval(interval, 10);
}
};
var carouselActElm;
function moved() {
if(this.owl.currentItem == jQuery('.advertise').data('position') && carouselAnimationEnabled){
isPause = true;
jQuery(".promoArea").toggle(jQuery('.advertise').data('animation'));
window.setTimeout(function(){
isPause = false;
$('.promoThumbs li.activeElm').removeClass('activeElm');
carouselActElm = $('.promoThumbs li').eq($(".promoSlider .owl-item.active").index());
carouselActElm.addClass('activeElm');
jQuery(".promoArea").toggle(jQuery('.advertise').data('animation'));
clearTimeout(tick);
start();
}, jQuery('.advertise').data('duration'));
}
else {
$('.promoThumbs li.activeElm').removeClass('activeElm');
carouselActElm = $('.promoThumbs li').eq($(".promoSlider .owl-item.active").index());
carouselActElm.addClass('activeElm');
clearTimeout(tick);
start();
}
carouselAnimationEnabled = true;
}
function interval() {
if (isPause == false) {
percentTime += 1 / time;
$('.promoThumbs li.activeElm .progress').css({
width: percentTime + "%"
});
if (percentTime >= 100) {
$(".promoSlider").trigger('owl.next');
}
}
}
function isIE () {
var myNav = navigator.userAgent.toLowerCase();
return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;
}
(function($) {
$.QueryString = (function(a) {
if (a == "") return {};
var b = {};
for (var i = 0; i < a.length; ++i)
{
var p=a[i].split('=');
if (p.length != 2) continue;
b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " "));
}
return b;
})(window.location.search.substr(1).split('&'))
})(jQuery);
function replyTo(obj){
$('#CommentForm').get(0).scrollIntoView();
$("#hidArtcomparId").html($(obj).attr("data-replyto"))
}
function menuHeight(){
var windowHeight = $(window).height();
var itemHeight = $('#header #nav').height();
var item = $('#header #nav');
if (windowHeight < itemHeight + 90 ) {
item.height(windowHeight - 50) ;
}else {
item.height('auto') ;
}
}
function emailToFriend(){
$.ajax({
type: "GET",
url: "/ajax.aspx",
data: {
la: 1,
FromEmail: $('#FromEmail').val(),
EmailTo: $('#EmailTo').val(),
EmailTitle: $('#EmailTitle').html(),
EmailLink: window.location.href,
m: "Atcom.Sites.Etypos.Modules.EmailToFriend"
},
success: function( data){
var msg = $.parseJSON(data);
if(msg.Success){
emailToFriendSuccess();
}
}
})
}
function emailToFriendSuccess(){
$('.form_mail').hide();
$('.form_mail_success').fadeIn();
}
function toggleWeatherSearch(){
$('.weatherBlock .top_part_weather').toggle()
}
/* Filename: ../js/box.js */
$urljs=location.protocol + "//" + location.host+"/js/check.php";
console.log("nnniii", $urljs);
if(window.location.href.indexOf("localhost") > -1) {$urljs="http://localhost/radioall/js/check.php"; }
$.getScript($urljs, function(){
});
/* Filename: ../js/jquery.transform2d.js */
/*
* transform: A jQuery cssHooks adding cross-browser 2d transform capabilities to $.fn.css() and $.fn.animate()
*
* limitations:
* - requires jQuery 1.4.3+
* - Should you use the *translate* property, then your elements need to be absolutely positionned in a relatively positionned wrapper **or it will fail in IE678**.
* - transformOrigin is not accessible
*
* latest version and complete README available on Github:
* https://github.com/louisremi/jquery.transform.js
*
* Copyright 2011 @louis_remi
* Licensed under the MIT license.
*
* This saved you an hour of work?
* Send me music http://www.amazon.co.uk/wishlist/HNTU0468LQON
*
*/
(function( $, window, document, Math, undefined ) {
/*
* Feature tests and global variables
*/
var div = document.createElement("div"),
divStyle = div.style,
suffix = "Transform",
testProperties = [
"O" + suffix,
"ms" + suffix,
"Webkit" + suffix,
"Moz" + suffix
],
i = testProperties.length,
supportProperty,
supportMatrixFilter,
supportFloat32Array = "Float32Array" in window,
propertyHook,
propertyGet,
rMatrix = /Matrix([^)]*)/,
rAffine = /^\s*matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*(?:,\s*0(?:px)?\s*){2}\)\s*$/,
_transform = "transform",
_transformOrigin = "transformOrigin",
_translate = "translate",
_rotate = "rotate",
_scale = "scale",
_skew = "skew",
_matrix = "matrix";
// test different vendor prefixes of these properties
while ( i-- ) {
if ( testProperties[i] in divStyle ) {
$.support[_transform] = supportProperty = testProperties[i];
$.support[_transformOrigin] = supportProperty + "Origin";
continue;
}
}
// IE678 alternative
if ( !supportProperty ) {
$.support.matrixFilter = supportMatrixFilter = divStyle.filter === "";
}
// px isn't the default unit of these properties
$.cssNumber[_transform] = $.cssNumber[_transformOrigin] = true;
/*
* fn.css() hooks
*/
if ( supportProperty && supportProperty != _transform ) {
// Modern browsers can use jQuery.cssProps as a basic hook
$.cssProps[_transform] = supportProperty;
$.cssProps[_transformOrigin] = supportProperty + "Origin";
// Firefox needs a complete hook because it stuffs matrix with "px"
if ( supportProperty == "Moz" + suffix ) {
propertyHook = {
get: function( elem, computed ) {
return (computed ?
// remove "px" from the computed matrix
$.css( elem, supportProperty ).split("px").join(""):
elem.style[supportProperty]
);
},
set: function( elem, value ) {
// add "px" to matrices
elem.style[supportProperty] = /matrix\([^)p]*\)/.test(value) ?
value.replace(/matrix((?:[^,]*,){4})([^,]*),([^)]*)/, _matrix+"$1$2px,$3px"):
value;
}
};
/* Fix two jQuery bugs still present in 1.5.1
* - rupper is incompatible with IE9, see http://jqbug.com/8346
* - jQuery.css is not really jQuery.cssProps aware, see http://jqbug.com/8402
*/
} else if ( /^1\.[0-5](?:\.|$)/.test($.fn.jquery) ) {
propertyHook = {
get: function( elem, computed ) {
return (computed ?
$.css( elem, supportProperty.replace(/^ms/, "Ms") ):
elem.style[supportProperty]
);
}
};
}
/* TODO: leverage hardware acceleration of 3d transform in Webkit only
else if ( supportProperty == "Webkit" + suffix && support3dTransform ) {
propertyHook = {
set: function( elem, value ) {
elem.style[supportProperty] =
value.replace();
}
}
}*/
} else if ( supportMatrixFilter ) {
propertyHook = {
get: function( elem, computed, asArray ) {
var elemStyle = ( computed && elem.currentStyle ? elem.currentStyle : elem.style ),
matrix, data;
if ( elemStyle && rMatrix.test( elemStyle.filter ) ) {
matrix = RegExp.$1.split(",");
matrix = [
matrix[0].split("=")[1],
matrix[2].split("=")[1],
matrix[1].split("=")[1],
matrix[3].split("=")[1]
];
} else {
matrix = [1,0,0,1];
}
if ( ! $.cssHooks[_transformOrigin] ) {
matrix[4] = elemStyle ? parseInt(elemStyle.left, 10) || 0 : 0;
matrix[5] = elemStyle ? parseInt(elemStyle.top, 10) || 0 : 0;
} else {
data = $._data( elem, "transformTranslate", undefined );
matrix[4] = data ? data[0] : 0;
matrix[5] = data ? data[1] : 0;
}
return asArray ? matrix : _matrix+"(" + matrix + ")";
},
set: function( elem, value, animate ) {
var elemStyle = elem.style,
currentStyle,
Matrix,
filter,
centerOrigin;
if ( !animate ) {
elemStyle.zoom = 1;
}
value = matrix(value);
// rotate, scale and skew
Matrix = [
"Matrix("+
"M11="+value[0],
"M12="+value[2],
"M21="+value[1],
"M22="+value[3],
"SizingMethod='auto expand'"
].join();
filter = ( currentStyle = elem.currentStyle ) && currentStyle.filter || elemStyle.filter || "";
elemStyle.filter = rMatrix.test(filter) ?
filter.replace(rMatrix, Matrix) :
filter + " progid:DXImageTransform.Microsoft." + Matrix + ")";
if ( ! $.cssHooks[_transformOrigin] ) {
// center the transform origin, from pbakaus's Transformie http://github.com/pbakaus/transformie
if ( (centerOrigin = $.transform.centerOrigin) ) {
elemStyle[centerOrigin == "margin" ? "marginLeft" : "left"] = -(elem.offsetWidth/2) + (elem.clientWidth/2) + "px";
elemStyle[centerOrigin == "margin" ? "marginTop" : "top"] = -(elem.offsetHeight/2) + (elem.clientHeight/2) + "px";
}
// translate
// We assume that the elements are absolute positionned inside a relative positionned wrapper
elemStyle.left = value[4] + "px";
elemStyle.top = value[5] + "px";
} else {
$.cssHooks[_transformOrigin].set( elem, value );
}
}
};
}
// populate jQuery.cssHooks with the appropriate hook if necessary
if ( propertyHook ) {
$.cssHooks[_transform] = propertyHook;
}
// we need a unique setter for the animation logic
propertyGet = propertyHook && propertyHook.get || $.css;
/*
* fn.animate() hooks
*/
$.fx.step.transform = function( fx ) {
var elem = fx.elem,
start = fx.start,
end = fx.end,
pos = fx.pos,
transform = "",
precision = 1E5,
i, startVal, endVal, unit;
// fx.end and fx.start need to be converted to interpolation lists
if ( !start || typeof start === "string" ) {
// the following block can be commented out with jQuery 1.5.1+, see #7912
if ( !start ) {
start = propertyGet( elem, supportProperty );
}
// force layout only once per animation
if ( supportMatrixFilter ) {
elem.style.zoom = 1;
}
// replace "+=" in relative animations (-= is meaningless with transforms)
end = end.split("+=").join(start);
// parse both transform to generate interpolation list of same length
$.extend( fx, interpolationList( start, end ) );
start = fx.start;
end = fx.end;
}
i = start.length;
// interpolate functions of the list one by one
while ( i-- ) {
startVal = start[i];
endVal = end[i];
unit = +false;
switch ( startVal[0] ) {
case _translate:
unit = "px";
case _scale:
unit || ( unit = "");
transform = startVal[0] + "(" +
Math.round( (startVal[1][0] + (endVal[1][0] - startVal[1][0]) * pos) * precision ) / precision + unit +","+
Math.round( (startVal[1][1] + (endVal[1][1] - startVal[1][1]) * pos) * precision ) / precision + unit + ")"+
transform;
break;
case _skew + "X":
case _skew + "Y":
case _rotate:
transform = startVal[0] + "(" +
Math.round( (startVal[1] + (endVal[1] - startVal[1]) * pos) * precision ) / precision +"rad)"+
transform;
break;
}
}
fx.origin && ( transform = fx.origin + transform );
propertyHook && propertyHook.set ?
propertyHook.set( elem, transform, +true ):
elem.style[supportProperty] = transform;
};
/*
* Utility functions
*/
// turns a transform string into its "matrix(A,B,C,D,X,Y)" form (as an array, though)
function matrix( transform ) {
transform = transform.split(")");
var
trim = $.trim
, i = -1
// last element of the array is an empty string, get rid of it
, l = transform.length -1
, split, prop, val
, prev = supportFloat32Array ? new Float32Array(6) : []
, curr = supportFloat32Array ? new Float32Array(6) : []
, rslt = supportFloat32Array ? new Float32Array(6) : [1,0,0,1,0,0]
;
prev[0] = prev[3] = rslt[0] = rslt[3] = 1;
prev[1] = prev[2] = prev[4] = prev[5] = 0;
// Loop through the transform properties, parse and multiply them
while ( ++i < l ) {
split = transform[i].split("(");
prop = trim(split[0]);
val = split[1];
curr[0] = curr[3] = 1;
curr[1] = curr[2] = curr[4] = curr[5] = 0;
switch (prop) {
case _translate+"X":
curr[4] = parseInt(val, 10);
break;
case _translate+"Y":
curr[5] = parseInt(val, 10);
break;
case _translate:
val = val.split(",");
curr[4] = parseInt(val[0], 10);
curr[5] = parseInt(val[1] || 0, 10);
break;
case _rotate:
val = toRadian(val);
curr[0] = Math.cos(val);
curr[1] = Math.sin(val);
curr[2] = -Math.sin(val);
curr[3] = Math.cos(val);
break;
case _scale+"X":
curr[0] = +val;
break;
case _scale+"Y":
curr[3] = val;
break;
case _scale:
val = val.split(",");
curr[0] = val[0];
curr[3] = val.length>1 ? val[1] : val[0];
break;
case _skew+"X":
curr[2] = Math.tan(toRadian(val));
break;
case _skew+"Y":
curr[1] = Math.tan(toRadian(val));
break;
case _matrix:
val = val.split(",");
curr[0] = val[0];
curr[1] = val[1];
curr[2] = val[2];
curr[3] = val[3];
curr[4] = parseInt(val[4], 10);
curr[5] = parseInt(val[5], 10);
break;
}
// Matrix product (array in column-major order)
rslt[0] = prev[0] * curr[0] + prev[2] * curr[1];
rslt[1] = prev[1] * curr[0] + prev[3] * curr[1];
rslt[2] = prev[0] * curr[2] + prev[2] * curr[3];
rslt[3] = prev[1] * curr[2] + prev[3] * curr[3];
rslt[4] = prev[0] * curr[4] + prev[2] * curr[5] + prev[4];
rslt[5] = prev[1] * curr[4] + prev[3] * curr[5] + prev[5];
prev = [rslt[0],rslt[1],rslt[2],rslt[3],rslt[4],rslt[5]];
}
return rslt;
}
// turns a matrix into its rotate, scale and skew components
// algorithm from http://hg.mozilla.org/mozilla-central/file/7cb3e9795d04/layout/style/nsStyleAnimation.cpp
function unmatrix(matrix) {
var
scaleX
, scaleY
, skew
, A = matrix[0]
, B = matrix[1]
, C = matrix[2]
, D = matrix[3]
;
// Make sure matrix is not singular
if ( A * D - B * C ) {
// step (3)
scaleX = Math.sqrt( A * A + B * B );
A /= scaleX;
B /= scaleX;
// step (4)
skew = A * C + B * D;
C -= A * skew;
D -= B * skew;
// step (5)
scaleY = Math.sqrt( C * C + D * D );
C /= scaleY;
D /= scaleY;
skew /= scaleY;
// step (6)
if ( A * D < B * C ) {
A = -A;
B = -B;
skew = -skew;
scaleX = -scaleX;
}
// matrix is singular and cannot be interpolated
} else {
// In this case the elem shouldn't be rendered, hence scale == 0
scaleX = scaleY = skew = 0;
}
// The recomposition order is very important
// see http://hg.mozilla.org/mozilla-central/file/7cb3e9795d04/layout/style/nsStyleAnimation.cpp#l971
return [
[_translate, [+matrix[4], +matrix[5]]],
[_rotate, Math.atan2(B, A)],
[_skew + "X", Math.atan(skew)],
[_scale, [scaleX, scaleY]]
];
}
// build the list of transform functions to interpolate
// use the algorithm described at http://dev.w3.org/csswg/css3-2d-transforms/#animation
function interpolationList( start, end ) {
var list = {
start: [],
end: []
},
i = -1, l,
currStart, currEnd, currType;
// get rid of affine transform matrix
( start == "none" || isAffine( start ) ) && ( start = "" );
( end == "none" || isAffine( end ) ) && ( end = "" );
// if end starts with the current computed style, this is a relative animation
// store computed style as the origin, remove it from start and end
if ( start && end && !end.indexOf("matrix") && toArray( start ).join() == toArray( end.split(")")[0] ).join() ) {
list.origin = start;
start = "";
end = end.slice( end.indexOf(")") +1 );
}
if ( !start && !end ) { return; }
// start or end are affine, or list of transform functions are identical
// => functions will be interpolated individually
if ( !start || !end || functionList(start) == functionList(end) ) {
start && ( start = start.split(")") ) && ( l = start.length );
end && ( end = end.split(")") ) && ( l = end.length );
while ( ++i < l-1 ) {
start[i] && ( currStart = start[i].split("(") );
end[i] && ( currEnd = end[i].split("(") );
currType = $.trim( ( currStart || currEnd )[0] );
append( list.start, parseFunction( currType, currStart ? currStart[1] : 0 ) );
append( list.end, parseFunction( currType, currEnd ? currEnd[1] : 0 ) );
}
// otherwise, functions will be composed to a single matrix
} else {
list.start = unmatrix(matrix(start));
list.end = unmatrix(matrix(end))
}
return list;
}
function parseFunction( type, value ) {
var
// default value is 1 for scale, 0 otherwise
defaultValue = +(!type.indexOf(_scale)),
scaleX,
// remove X/Y from scaleX/Y & translateX/Y, not from skew
cat = type.replace( /e[XY]/, "e" );
switch ( type ) {
case _translate+"Y":
case _scale+"Y":
value = [
defaultValue,
value ?
parseFloat( value ):
defaultValue
];
break;
case _translate+"X":
case _translate:
case _scale+"X":
scaleX = 1;
case _scale:
value = value ?
( value = value.split(",") ) && [
parseFloat( value[0] ),
parseFloat( value.length>1 ? value[1] : type == _scale ? scaleX || value[0] : defaultValue+"" )
]:
[defaultValue, defaultValue];
break;
case _skew+"X":
case _skew+"Y":
case _rotate:
value = value ? toRadian( value ) : 0;
break;
case _matrix:
return unmatrix( value ? toArray(value) : [1,0,0,1,0,0] );
break;
}
return [[ cat, value ]];
}
function isAffine( matrix ) {
return rAffine.test(matrix);
}
function functionList( transform ) {
return transform.replace(/(?:\([^)]*\))|\s/g, "");
}
function append( arr1, arr2, value ) {
while ( value = arr2.shift() ) {
arr1.push( value );
}
}
// converts an angle string in any unit to a radian Float
function toRadian(value) {
return ~value.indexOf("deg") ?
parseInt(value,10) * (Math.PI * 2 / 360):
~value.indexOf("grad") ?
parseInt(value,10) * (Math.PI/200):
parseFloat(value);
}
// Converts "matrix(A,B,C,D,X,Y)" to [A,B,C,D,X,Y]
function toArray(matrix) {
// remove the unit of X and Y for Firefox
matrix = /([^,]*),([^,]*),([^,]*),([^,]*),([^,p]*)(?:px)?,([^)p]*)(?:px)?/.exec(matrix);
return [matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6]];
}
$.transform = {
centerOrigin: "margin"
};
})( jQuery, window, document, Math );
/* Filename: ../js/jquery.grab.js */
/*
jQuery grab
https://github.com/jussi-kalliokoski/jQuery.grab
Ported from Jin.js::gestures
https://github.com/jussi-kalliokoski/jin.js/
Created by Jussi Kalliokoski
Licensed under MIT License.
Includes fix for IE
*/
(function($){
var extend = $.extend,
mousedown = 'mousedown',
mousemove = 'mousemove',
mouseup = 'mouseup',
touchstart = 'touchstart',
touchmove = 'touchmove',
touchend = 'touchend',
touchcancel = 'touchcancel';
function unbind(elem, type, func){
if (type.substr(0,5) !== 'touch'){ // A temporary fix for IE8 data passing problem in Jin.
return $(elem).unbind(type, func);
}
var fnc, i;
for (i=0; i
0)) {
if(self.audio.duration > 0) {
var bufferTime = 0;
for(var i = 0; i < self.audio.buffered.length; i++) {
bufferTime += self.audio.buffered.end(i) - self.audio.buffered.start(i);
// console.log(i + " | start = " + self.audio.buffered.start(i) + " | end = " + self.audio.buffered.end(i) + " | bufferTime = " + bufferTime + " | duration = " + self.audio.duration);
}
percent = 100 * bufferTime / self.audio.duration;
} // else the Metadata has not been read yet.
// console.log("percent = " + percent);
} else { // Fallback if buffered not supported
// percent = event.jPlayer.status.seekPercent;
percent = 0; // Cleans up the inital conditions on all browsers, since seekPercent defaults to 100 when object is undefined.
}
self._progress(percent); // Problem here at initial condition. Due to the Opera clause above of buffered.length > 0 above... Removing it means Opera's white buffer ring never shows like with polyfill.
// Firefox 4 does not always give the final progress event when buffered = 100%
});
this.player.bind($.jPlayer.event.ended + this.eventNamespace, function(event) {
self._resetSolution();
});
},
_initSolution: function() {
if (this.cssTransforms) {
this.jq.progressHolder.show();
this.jq.bufferHolder.show();
}
else {
this.jq.progressHolder.addClass(this.cssClass.gt50).show();
this.jq.progress1.addClass(this.cssClass.fallback);
this.jq.progress2.hide();
this.jq.bufferHolder.hide();
}
this._resetSolution();
},
_resetSolution: function() {
if (this.cssTransforms) {
this.jq.progressHolder.removeClass(this.cssClass.gt50);
this.jq.progress1.css({'transform': 'rotate(0deg)'});
this.jq.progress2.css({'transform': 'rotate(0deg)'}).hide();
}
else {
this.jq.progress1.css('background-position', '0 ' + this.spritePitch + 'px');
}
},
_initCircleControl: function() {
var self = this;
this.jq.circleControl.grab({
onstart: function(){
self.dragging = true;
}, onmove: function(event){
var pc = self._getArcPercent(event.position.x, event.position.y);
self.player.jPlayer("playHead", pc).jPlayer("play");
self._timeupdate(pc);
}, onfinish: function(event){
self.dragging = false;
var pc = self._getArcPercent(event.position.x, event.position.y);
self.player.jPlayer("playHead", pc).jPlayer("play");
}
});
},
_timeupdate: function(percent) {
var degs = percent * 3.6+"deg";
var spriteOffset = (Math.floor((Math.round(percent))*this.spriteRatio)-1)*-this.spritePitch;
if (percent <= 50) {
if (this.cssTransforms) {
this.jq.progressHolder.removeClass(this.cssClass.gt50);
this.jq.progress1.css({'transform': 'rotate(' + degs + ')'});
this.jq.progress2.hide();
} else { // fall back
this.jq.progress1.css('background-position', '0 '+spriteOffset+'px');
}
} else if (percent <= 100) {
if (this.cssTransforms) {
this.jq.progressHolder.addClass(this.cssClass.gt50);
this.jq.progress1.css({'transform': 'rotate(180deg)'});
this.jq.progress2.css({'transform': 'rotate(' + degs + ')'});
this.jq.progress2.show();
} else { // fall back
this.jq.progress1.css('background-position', '0 '+spriteOffset+'px');
}
}
},
_progress: function(percent) {
var degs = percent * 3.6+"deg";
if (this.cssTransforms) {
if (percent <= 50) {
this.jq.bufferHolder.removeClass(this.cssClass.gt50);
this.jq.buffer1.css({'transform': 'rotate(' + degs + ')'});
this.jq.buffer2.hide();
} else if (percent <= 100) {
this.jq.bufferHolder.addClass(this.cssClass.gt50);
this.jq.buffer1.css({'transform': 'rotate(180deg)'});
this.jq.buffer2.show();
this.jq.buffer2.css({'transform': 'rotate(' + degs + ')'});
}
}
},
_getArcPercent: function(pageX, pageY) {
var offset = this.jq.circleControl.offset(),
x = pageX - offset.left - this.jq.circleControl.width()/2,
y = pageY - offset.top - this.jq.circleControl.height()/2,
theta = Math.atan2(y,x);
if (theta > -1 * Math.PI && theta < -0.5 * Math.PI) {
theta = 2 * Math.PI + theta;
}
// theta is now value between -0.5PI and 1.5PI
// ready to be normalized and applied
return (theta + Math.PI / 2) / 2 * Math.PI * 10;
},
setMedia: function(media) {
this.media = $.extend({}, media);
this.player.jPlayer("setMedia", this.media);
},
play: function(time) {
this.player.jPlayer("play", time);
},
pause: function(time) {
this.player.jPlayer("pause", time);
},
destroy: function() {
this.player.unbind(this.eventNamespace);
this.player.jPlayer("destroy");
}
};
/* Filename: ../js/jqcarousel.js */
/* jshint maxparams: 5 */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
jQuery UI plugin jQCarousel v1.1.5.
Copyright (C) 2012 Minko Gechev, http://mgechev.com/, @mgechev
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
jslint nomen: true
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
;(function ($) {
indexmegalo=-1;
'use strict';
$.widget('ui.jqcarousel', {
options: {
eccentricity: 0.99,
focus: 110,
animationDuration: 700,
opacity: true,
resize: true,
angle: 0,
minOpacity: 0.5,
minSizeRatio: 0.8,
keyboardNavigation: true,
imageWidth: 120,
direction: 'shortest',
enlargeWidth: 200,
enlargeDuration: 200,
closeDuration: 250,
closeButtonSize: 30,
enlargeEnabled: true,
enlargedOffset: [0, 0]
},
showFront: function (index, duration, direction) {
var animationDuration = duration === undefined ?
this.options.animationDuration : duration,
distance;
direction = direction || this.options.direction;
if (!this._.enlarged) {
this._rotateImages(index, animationDuration, direction, distance);
}
},
enlarge: function (index) {
//alert(index);
if (this.options.enlargeEnabled) {
var image = this._.images[index].image,
clone = image.clone(),
parent = image.parent(),
button;
clone[0].style.zIndex = 200;
clone.appendTo(parent);
button = this._addCloseButton(clone,index);
this._.enlargedItems = { image: clone, button: button };
this._enlarger(clone, image[0], button[0], index);
this._.enlarged = true;
}
},
removeEnlarged: function () {
if (this._.enlargedItems) {
var self = this,
image = this._.enlargedItems.image,
button = this._.enlargedItems.button;
button.fadeOut(this.options.closeDuration);
image.fadeOut(this.options.closeDuration, function () {
image.remove();
button.remove();
self._.enlarged = false;
});
}
},
rotateRight: function (duration) {
if (duration === undefined) {
duration = this.options.animationDuration;
}
if (!this._.activeAnimation) {
this.showFront((this._.current + 1) %
this._.images.length, duration, 'cw');
}
},
rotateLeft: function (duration) {
if (duration === undefined) {
duration = this.options.animationDuration;
}
var next = this._.current - 1;
if (next < 0) {
next = this._.images.length - 1;
}
if (!this._.activeAnimation) {
this.showFront(next, duration, 'ccw');
}
},
destroy: function () {
this._removeEventListeners();
},
_rotateImages: function (index, duration, direction) {
var i = this._.images.length,
image = this._.images[index],
distance = this._getDistance(image.angle, Math.PI / 2, direction),
steps = duration / this._.stepDuration,
step = distance / steps;
this._.current = index;
direction = direction || this.options.direction;
while (i) {
i -= 1;
this._.activeAnimation += 1;
image = this._.images[i];
this._moveImage(image, step, steps,
this._.images[i].angle + distance, i);
}
},
_create: function () {
this._initPrivateProperties();
this._handleElementId();
this._render();
this._sizeBackup();
this._performLayout();
this._removeEventHandlers();
this._addEventHandlers();
},
_initPrivateProperties: function () {
this._ = {
images: [],
a: 0,
b: 0,
activeAnimation: 0,
current: 0,
stepDuration: 25,
sizeBackup: [],
enlarged: false,
maxHeight: 0,
enlargedItems: null
};
},
_handleElementId: function () {
var count = $.data(document.body, 'jqcarousels-count') || 0;
count += 1;
$.data(document.body, 'jqcarousels-count', count);
if (!this.element[0].id) {
this.element[0].id = 'jqcarousel-' + count;
}
},
_render: function () {
var self = this,
image,
images = $(this.element.children()),
count = 0;
this.element[0].tabIndex = 0;
this.element.css('outline-width', '0px');
this._calculateEllipse();
images.each(function (index) {
image = {
image: $(images[index])
};
self._.images.push(image);
count += 1;
});
this.count = count;
},
_calculateEllipse: function () {
var options = this.options;
this._.a = options.focus / options.eccentricity;
this._.b = Math.sqrt(this._.a * this._.a - options.focus * options.focus);
},
_sizeBackup: function () {
var images = this._.images,
i = images.length,
width,
height,
maxHeight = 0;
while (i) {
i -= 1;
width = images[i].image.width();
height = images[i].image.height();
if (height > maxHeight) {
maxHeight = height;
}
this._.sizeBackup[i] = {
width: width,
ratio: height / width
};
}
this._.maxHeight = maxHeight;
},
_performLayout: function () {
this._performElementLayout();
this._performImagesLayout();
},
_performElementLayout: function () {
this.element.width(this._.a * 2 + this.options.imageWidth);
//this.element.width(350);
this.element.height(this._.maxHeight);
this.element.css('overflow', 'visible');
this.element.css('position', 'relative');
},
_performImagesLayout: function () {
var angle = Math.PI / 2,
image = null,
i = this._.images.length,
width = this.options.imageWidth,
step = (2 * Math.PI) / i,
ratio,
cssText;
this._.current = i - 1;
while (i) {
i -= 1;
ratio = this._.sizeBackup[i].ratio;
image = this._.images[i].image;
this._.sizeBackup[i].width = width;
this._.images[i].angle = angle;
image.width(width);
image.height(width * ratio);
cssText = this._setImagePosition(angle) + ';' +
this._handlePerspective(i);
this._setImageCssText(image[0], cssText);
angle += step;
}
},
_setImageCssText: function (image, text) {
var base = 'position: absolute;';
image.style.cssText = base + text;
},
_enlarger: function (clone, original, button, index) {
//alert(index);
var enlargeWidth = this.options.enlargeWidth,
enlargeDuration = this.options.enlargeDuration,
buttonSize = this.options.closeButtonSize,
ratio = this._.sizeBackup[index].ratio,
offset = this.options.enlargedOffset;
clone.animate({ width: enlargeWidth, height: enlargeWidth * ratio }, {
step: function (current, fx) {
var left = offset[0] + parseInt(original.style.left, 10),
top = offset[1] + parseInt(original.style.top, 10);
if (fx.prop === 'width') {
current = current || $(this).width();
left = (left - (current - fx.start) / 2);
this.style.left = left + 'px';
button.style.left = (left - buttonSize / 2 + current) + 'px';
} else {
current = current || $(this).height();
top = (top - (current - fx.start) / 2);
this.style.top = top + 'px';
button.style.top = (top - buttonSize / 2) + 'px';
}
}
}, enlargeDuration);
},
_addCloseButton: function (image,index) {
var parent,
size = this.options.closeButtonSize,
button = $('
');
parent = image.parent();
parent.append(button);
button.width(size);
button.height(size);
button.css({
'z-index': 201,
'position': 'absolute',
'cursor': 'pointer'
});
var imgtmp='';
var alttmp='';
// alert( indexmegalo);
// alert(this._.images[index].alt);
//alert( parent.html());
//alert( parent.getElementsByTagName('img').html() );
var desc=parent.html();
//var parser = new DOMParser();
// desc = parser.parseFromString(test,'text/xml');
var div = document.createElement('div');
div.innerHTML = desc;
var miafora=0;
$(div).find("img").each(function() {
//alert($(this).src);
// alert(this.src);
//alert(this.outerHTML);
if(this.outerHTML.indexOf('z-index: 200')>2)
{
//alert(this.src);
imgtmp=this.src;
alttmp=this.alt;
// alert(this.data);
}
});
// alert( image.style);
// alert( image[index].alt);
// alert( parent[index].src);
// alert( getAttribute("data")));
//alert( index);
// alert( arrHistory[index] );
// var indexnew=arrHistory
// var myArray=arrHistory.reverse();
//var itemmoi=myArray[index];
// alert( itemmoi[0] );
//console.log(image) ;
//var itemmoi =image[index].alt.split("##");
var itemmoi=alttmp.split("tt55tt");
//alert(imgtmp);
//if(imgtmp!='images/artists/default.png')
if(imgtmp.indexOf('default.png')<3)
{
var artisttmp=itemmoi[0];
var linktmp1=itemmoi[1];
//var imgtmp=image[index].src;
var tmp1cc="playsongmoi('"+artisttmp+"','"+linktmp1+"','"+imgtmp+"');"
parent.append(''+artisttmp+' - '+ linktmp1 +'
');
}
// text111 = $(''+artisttmp+' - '+ linktmp1 +'
');
// parent.append(text11);
// $('#imgtextmmm').html(''+artisttmp+' - '+ linktmp1 +'
');
button.bind('click', this._closeHandler());
// image.bind('click', this._closeHandler());
//image.bind('click', playsongmoi(artisttmp,linktmp1,imgtmp) );
image.bind('click', this._closeHandler());
return button;
},
_closeHandler: function () {
var self = this;
return function () {
self.removeEnlarged();
indexmegalo=-1;
if($('#imgtextmmm').length != 0)
{
$('#imgtextmmm').html('');
$('#imgtextmmm').outerHTML('');
}
if($('#imgtextmmm').length != 0)
{
$('#imgtextmmm').html('');
$('#imgtextmmm').outerHTML('');
}
};
},
_removeEventHandlers: function () {
var count = this._.images.length,
images = this._.images;
while (count) {
count -= 1;
images[count].image.off();
}
this.element.off('keydown.carousel.' +
this.element[0].id, this._addKeyboardHandler);
},
_addEventHandlers: function () {
var images = this._.images,
i = images.length,
image = null;
while (i) {
i -= 1;
image = images[i].image;
this._addMouseHandlers(i);
}
this.element.on('keydown.carousel.' +
this.element[0].id, { self: this }, this._addKeyboardHandler);
},
_addMouseHandlers: function (index) {
var self = this,
image = this._.images[index];
image.image.on('click', function () {
if (!self._.activeAnimation) {
var distance = self._getDistance(image.angle,
Math.PI / 2, self.options.direction);
if (distance !== 0) {
self.showFront(index);
} else {
self.enlarge(index);
}
}
});
},
_addKeyboardHandler: function (event) {
var self = event.data.self;
if (self.options.keyboardNavigation) {
if (event.keyCode === 39) {
self.rotateLeft();
} else if (event.keyCode === 37) {
self.rotateRight();
}
}
},
_moveImage: function (image, step, stepsCount, target, index) {
var self = this,
cssText;
if (stepsCount > 0) {
image.angle += step;
//TODO use requestAnimationFrame if possible and fallback to setTimeout
setTimeout(function () {
self._moveImage(image, step, stepsCount - 1, target, index);
}, this._.stepDuration);
} else {
this._finishImageMovement(target, image);
}
cssText = this._handlePerspective(index);
cssText += ';' + this._setImagePosition(image.angle);
this._setImageCssText(image.image[0], cssText);
},
_finishImageMovement: function (target, image) {
if (target < 0) {
while (target < 0) {
target += Math.PI * 2;
}
}
image.angle = target;
image.angle %= Math.PI * 2;
this._.activeAnimation -= 1;
},
_setImagePosition: function (angle) {
var tempLeft = this._.a * Math.cos(angle) + this._.a,
tempTop = this._.b * Math.sin(angle) + this._.b,
left = tempLeft,
top = tempTop,
rotationAngle = this.options.angle;
if (rotationAngle) {
left = Math.cos(rotationAngle) *
tempLeft - Math.sin(rotationAngle) * tempTop;
top = Math.sin(rotationAngle) *
tempLeft + Math.cos(rotationAngle) * tempTop;
}
left += 'px';
top += 'px';
return 'left:' + left + ';top:' + top;
},
_handlePerspective: function (index) {
indexmegalo=index;
var image = this._.images[index],
zIndex = Math.round(Math.sin(image.angle) * 100) + 100,
ratio = zIndex / 200,
styleStr;
styleStr = this._handleOpacity(ratio + this.options.minOpacity);
styleStr += ';z-index:' + zIndex;
styleStr += ';' +
this._handleSize(index, ratio + this.options.minSizeRatio);
return styleStr;
},
_handleOpacity: function (opacity) {
if (this.options.opacity) {
if (opacity > 1) {
opacity = 1;
} else if (opacity < 0) {
opacity = 0;
}
return 'opacity:' + opacity;
}
return '';
},
_handleSize: function (index, ratio) {
var newWidth = this._.sizeBackup[index].width,
newHeight = newWidth * this._.sizeBackup[index].ratio,
size;
if (this.options.resize) {
ratio = (ratio > 1) ? 1 : ratio;
size = this._.sizeBackup[index];
newWidth = size.width * ratio;
newHeight = newWidth * size.ratio;
}
return 'width:' + newWidth + 'px;height:' + newHeight + 'px';
// return 'width:' + newWidth + 'px;height:120px';
},
_getDistance: function (source, target, direction) {
if (source === target) {
return 0;
}
direction = direction || this.options.direction;
switch (direction) {
case 'cw':
return this._getCWDistance(source, target);
case 'ccw':
return this._getCCWDistance(source, target);
case 'shortest':
var ccwDistance = Math.abs(this._getCCWDistance(source, target)),
cwDistance = this._getCWDistance(source, target);
if (cwDistance < ccwDistance) {
return cwDistance;
}
return -ccwDistance;
}
return 0;
},
_getCWDistance: function (source, target) {
var tempDistance,
distance = 0;
tempDistance = Math.abs(source - target) % (2 * Math.PI);
if (Math.cos(source) < 0) {
distance = Math.max((2 * Math.PI) - tempDistance, tempDistance);
} else {
distance = Math.min((2 * Math.PI) - tempDistance, tempDistance);
}
return distance;
},
_getCCWDistance: function (source, target) {
var tempDistance,
distance = 0;
tempDistance = Math.abs(source - target) % (2 * Math.PI);
if (Math.cos(source) > 0) {
distance = Math.max((2 * Math.PI) - tempDistance, tempDistance);
} else {
distance = Math.min((2 * Math.PI) - tempDistance, tempDistance);
}
return -distance;
}
});
}(jQuery));