1function createCookie(name,value,hours) { 2 if (hours) { 3 var date = new Date(); 4 date.setTime(date.getTime()+(hours*60*60*1000)); 5 var expires = "; expires="+date.toGMTString(); 6 } 7 else var expires = ""; 8 document.cookie = name+"="+value+expires+"; path=/"; 9} 10 11function readCookie(name) { 12 var nameEQ = name + "="; 13 var ca = document.cookie.split(';'); 14 for(var i=0;i < ca.length;i++) { 15 var c = ca[i]; 16 while (c.charAt(0)==' ') c = c.substring(1,c.length); 17 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); 18 } 19 return null; 20} 21 22function eraseCookie(name) { 23 createCookie(name,"",-1); 24} 25 26function isScrolledIntoView(elem,beforeSize) 27{ 28 var beforeSize = typeof beforeSize !== 'undefined' ? beforeSize : 1; 29 var $elem = $(elem); 30 var $window = $(window); 31 var docViewTop = $window.scrollTop(); 32 var docViewBottom = docViewTop + $window.height(); 33 var elemTop = $elem.offset().top; 34 var elemBottom = elemTop + $elem.height(); 35 return ((parseInt(elemBottom - beforeSize) <= docViewBottom) && (elemTop - beforeSize >= docViewTop)) ; 36} 37 38$.fn.ajaxContainerLoad = function(options) { 39 var settings = $.extend({ 40 41 }, options ); 42 43 return this.each(function() { 44 var $this = $(this); 45 $(window).on('scroll',function(){ 46 if (!$this.attr('data-loaded') && $this.attr('data-src')) { 47 if (isScrolledIntoView($this,200)) { 48 var location = $this.attr('data-src'); 49 $this.attr('data-loaded','1'); 50 //console.log(jQuery.parseJSON($this.attr('data-srcData')) ); 51 $.ajax({ 52 type: "POST", 53 url: location, 54 data: jQuery.parseJSON($this.attr('data-srcData')), 55 success: function (data) 56 { 57 $this.html(data); 58 } 59 }); 60 } 61 } 62 }); 63 }); 64}; 65 66//$(".ajaxContainer").ajaxContainerLoad(); 67 68$.ajaxSetup({ cache: false }); 69function newsletterSubscribe(email){ 70 $.ajax({ 71 type: "POST", 72 url: '/d/index/newsletter_subscribe', 73 data: {email:email}, // serializes the form's elements. 74 success: function (data) 75 { 76 var response = JSON.parse(data); 77 if(response.success){ 78 sweetAlert("Va multumim", "Sunteti abonat la newsletterul ARQ", "success"); 79 $('#newsletter_input').val(''); 80 }else{ 81 sweetAlert("Eroare", "Va rugam verificati daca adresa de email este valida", "error"); 82 } 83 } 84 }); 85} 86 87jQuery(document).scroll(function() { 88 var position = jQuery(window).scrollTop(); 89 var windowHeight = jQuery(window).height(); 90 if(position <= 500) { 91 jQuery("a[href='#top']").fadeOut('fast'); 92 }else{ 93 jQuery("a[href='#top']").fadeIn('fast'); 94 } 95 96 if(position >= jQuery('.header .header-menu.thisisfixed').attr("rel")) { 97 jQuery('.floatingmainmenu').show(); 98 jQuery('.floatingmainmenu_b').show(); 99 }else{ 100 jQuery('.floatingmainmenu').hide(); 101 jQuery('.floatingmainmenu_b').hide(); 102 } 103}); 104 105var _legatus_slider_timer; 106 107function searchWebsite(){ 108 var search = $('#search_top_field').val(); 109 if(search.length > 2){ 110 window.location.href = '/search/' + search; 111 }else{ 112 alert('cautare trebuie sa contina minim 3 caractere'); 113 } 114} 115 116jQuery(document).ready(function() { 117 118$('#search_top_field').keypress(function( event ) { 119 if ( event.which == 13 ) { 120 event.preventDefault(); 121 searchWebsite(); 122 } 123 124}); 125 126 jQuery("body").append("<a href='#top' class='backtopbutton'><span class='icon-text'></span></a>"); 127 128 jQuery("a[href='#top']").click(function() { 129 jQuery("html, body").animate({ scrollTop: 0 }, "slow"); 130 return false; 131 }); 132 133 jQuery("a[href=#top]").click(function(){ 134 jQuery("html, body").animate({ scrollTop: 0 }, "normal"); 135 return false;
136 }); 137 138 // For image borders 139 jQuery("img.setborder").each(function() { 140 jQuery(this).wrap("<span class='set-image-border'>"); 141 jQuery(this).parent().css("margin", jQuery(this).css("margin")).css("padding", jQuery(this).css("padding")).css("float", jQuery(this).css("float")); 142 if(jQuery(this).css("position") == "absolute"){ 143 jQuery(this).parent().css("position", "absolute"); 144 jQuery(this).css("position", "relative"); 145 } 146 jQuery(this).css("margin", "0px").css("padding", "0px").css("float", "none").css("position", "relative"); 147 }); 148 149 jQuery('.gallery-preview-control').click(function(){ 150 var theElement = jQuery(this); 151 var theList = theElement.parent().find('.gallery-thumbs > ul > li'); 152 var theFullsize = theElement.parent().find('ul.full-size > li'); 153 var theActive = theElement.parent().find('.gallery-thumbs > ul > li.active').index(); 154 if(theElement.attr("href") == "#gallery-left"){ 155 if(theActive <= 0){ 156 var prevElement = false; 157 }else{ 158 var prevElement = true; 159 } 160 161 theList.each(function(){ 162 if(jQuery(this).index() == theActive){ 163 theFullsize.removeClass('active'); 164 jQuery(this).removeClass("active"); 165 if(prevElement){ 166 jQuery(this).prev().addClass("active"); 167 theFullsize.eq(jQuery(this).index()-1).addClass('active'); 168 }else{ 169 theList.eq(theList.size()-1).addClass("active"); 170 theFullsize.eq(theList.size()-1).addClass('active'); 171 } 172 } 173 }); 174 }else{ 175 if(theActive >= theList.size()-1){ 176 var nextElement = false; 177 }else{ 178 var nextElement = true; 179 } 180 181 theList.each(function(){ 182 if(jQuery(this).index() == theActive){ 183 theFullsize.removeClass('active'); 184 jQuery(this).removeClass("active"); 185 if(nextElement){ 186 jQuery(this).next().addClass("active"); 187 theFullsize.eq(jQuery(this).index()+1).addClass('active'); 188 }else{ 189 theList.eq(0).addClass("active"); 190 theFullsize.eq(0).addClass('active'); 191 } 192 } 193 }); 194 } 195 return false; 196 }); 197 198 // jQuery('.youtube-video, .youtube-video iframe').click(function(){ 199 // jQuery(this).find("iframe").animate({width: 680, height: 383}, 'slow'); 200 // }); 201 202 203 // Legatus custom tooltips 204 jQuery("body").append("<div id='_legatus-tooltip'></div>"); 205 jQuery(".legatus-tooltip").mouseenter(function(){ 206 if(jQuery(this).attr("title")){ 207 var offset = jQuery(this).offset(); 208 jQuery("#_legatus-tooltip").html(jQuery(this).attr("title")); 209 jQuery(this).attr("title", ""); 210 jQuery("#_legatus-tooltip").addClass("active"); 211 jQuery("#_legatus-tooltip").css("left", offset.left+"px").css("top", offset.top+"px"); 212 var wii = (parseInt(jQuery(this).css("width"))/2); 213 var wiiii = ((parseInt(jQuery("#_legatus-tooltip").css("width"))+parseInt(jQuery("#_legatus-tooltip").css("padding-right"))+parseInt(jQuery("#_legatus-tooltip").css("padding-left")))/2); 214 //alert(wii); 215 jQuery("#_legatus-tooltip").css("margin-left", ((wiiii-wii)*(-1))+"px"); 216 } 217 }).mouseleave(function(){ 218 jQuery("#_legatus-tooltip").removeClass("active"); 219 jQuery(this).attr("title", jQuery("#_legatus-tooltip").html()); 220 //jQuery("#_legatus-tooltip").html(""); 221 }); 222 223 224 // For slider 225 if(jQuery(".slider-container")){ 226 // Builds slider controls 227 var this_count = jQuery(".slider-container .slider-content ul li").size(); 228 jQuery(".slider-container .slider-content ul li").each(function () { 229 if(jQuery(this).index() == 0){var clss = " active";}else{var clss = "";} 230 jQuery("ul.slider-controls").append("<li class='slider-control"+clss+"'><a href='#'>"+(jQuery(this).index())+"</a></li>"); 231 }); 232 233 // Slider controls 234 jQuery(".slider-controls a").click(function (){ 235 stopSlider(); 236 var this_index = jQuery(this).parent().index(); 237 var this_height = jQuery(".slider-container .slider-content ul li").height(); 238 jQuery(this).parent().parent().find("li").removeClass("active"); 239 jQuery(this).parent().addClass("active"); 240 jQuery(".slider-container .slider-content ul").css("top", "-"+(this_index*this_height)+"px"); 241 return false; 242 }); 243 244 // Slider loading bar 245 /* 246 if(_legatus_slider_autostart){ 247 setTimeout("startSlider()", _legatus_slider_interval); 248 if(_legatus_slider_loading){ 249 jQuery(".slider-container .slider-content").append("<div class='slider-loading'></div>"); 250 sliderLoading(); 251 } 252 }*/ 253 } 254 255 256 jQuery(".images-scroll li a").click(function() { 257 jQuery(this).parent().parent().find("li").removeClass("active"); 258 jQuery(this).parent().addClass("active"); 259 jQuery(this).parent().parent().parent().find(".images-content > li").removeClass("active"); 260 jQuery(this).parent().parent().parent().find(".images-content > li").eq(jQuery(this).parent().index()).addClass("active"); 261 var step = ((-250)*(jQuery(this).parent().index()-1))-60; 262 //alert(step); 263 jQuery(this).parent().parent().css("margin-left", step+"px"); 264 return false;
265 }); 266 267 268 269 270 jQuery(".gallery-navi-right").click(function (){ 271 var thiscount = parseInt(jQuery(this).parent().find("ul li").size())-1; 272 var thisindex = parseInt(jQuery(this).parent().find("ul li.active").index()); 273 var thisnext = (thisindex >= thiscount)?(0):(thisindex+1); 274 275 jQuery(this).parent().find("ul li.active").addClass("current"); 276 jQuery(this).parent().find("ul li.current").removeClass("active"); 277 jQuery(this).parent().find("ul li").eq(thisnext).addClass("active"); 278 jQuery(this).parent().find("ul li.current").removeClass("current"); 279 return false; 280 }); 281 282 jQuery(".gallery-navi-left").click(function (){ 283 var thiscount = parseInt(jQuery(this).parent().find("ul li").size())-1; 284 var thisindex = parseInt(jQuery(this).parent().find("ul li.active").index()); 285 var thisnext = (thisindex <= 0)?(thiscount):(thisindex-1); 286 287 jQuery(this).parent().find("ul li.active").addClass("current"); 288 jQuery(this).parent().find("ul li.current").removeClass("active"); 289 jQuery(this).parent().find("ul li").eq(thisnext).addClass("active"); 290 jQuery(this).parent().find("ul li.current").removeClass("current"); 291 return false; 292 }); 293 294 295 296 jQuery("#calendar_wrap tbody td").each(function() { 297 var el_this = jQuery(this); 298 if(!el_this.hasClass("pad")){ 299 el_this.html("<span>"+el_this.html()+"</span>"); 300 } 301 }); 302 303 304 // Breaking News Scroller 305 jQuery(".breaking-news .breaking-block").each(function() { 306 var thisitem = jQuery(this); 307 thisitem.find("ul li").css("width", thisitem.width()+"px"); 308 }); 309 310 jQuery(".breaking-controls a").click(function() { 311 var thisitem = jQuery(this); 312 var itemul = thisitem.parent().parent().find(".breaking-block ul"); 313 var items = itemul.find("li"); 314 var sega = (items.size()-1)*(items.width()+parseInt(items.css("margin-right"))); 315 if(thisitem.hasClass("breaking-arrow-left")){ 316 if(0 >= Math.abs(parseInt(itemul.css("margin-left")))){ 317 itemul.css("margin-left", (sega*(-1))+"px"); 318 }else{ 319 itemul.css("margin-left", (parseInt(itemul.css("margin-left"))+(items.width()+parseInt(items.css("margin-right"))))+"px"); 320 } 321 }else{ 322 if(sega <= Math.abs(parseInt(itemul.css("margin-left")))){ 323 itemul.css("margin-left", "0px"); 324 }else{ 325 itemul.css("margin-left", (parseInt(itemul.css("margin-left"))+(items.width()+parseInt(items.css("margin-right")))*(-1))+"px"); 326 } 327 } 328 return false; 329 }); 330 331 332 // Share buttons in article 333 if(jQuery(".social-icons-float").length != 0){ 334 var boooo = jQuery(".social-icons-float").offset().top-31; 335 336 jQuery(window).scroll(function () { 337 //console.log(jQuery(this).css("top")); 338 var position = jQuery(window).scrollTop(); 339 if(position >= boooo){ 340 jQuery(".social-icons-float").css("position", "fixed").css("top", "30px").css("left", "50%").css("margin-left", "-620px"); 341 jQuery(".logged-in .social-icons-float").css("top", "58px"); 342 }else{ 343 jQuery(".social-icons-float").css("position", "absolute").css("top", "70px").css("left", "-115px").css("margin-left", "0px"); 344 } 345 }); 346 } 347 348 349 jQuery('.tab-block li a').click(function() { 350 var theitem = jQuery(this); 351 theitem.parent().parent().find("li").removeClass("active"); 352 theitem.parent().addClass("active"); 353 theitem.parent().parent().parent().parent().find(".tab-content > ul > li").removeClass("active"); 354 theitem.parent().parent().parent().parent().find(".tab-content > ul > li").eq(theitem.parent().index()).addClass("active"); 355 return false; 356 }); 357 358 359 jQuery(".accordion > div > a").click(function (){ 360 var thiselement = jQuery(this); 361 if(thiselement.parent().hasClass("active")){ 362 thiselement.parent().toggleClass('active'); 363 return false; 364 } 365 thiselement.parent().parent().children().removeClass('active'); 366 thiselement.parent().toggleClass('active'); 367 return false; 368 }); 369 370 371 jQuery(".alert-box > a.closebutton").click(function (){ 372 var thiselement = jQuery(this); 373 thiselement.parent().hide(); 374 return false; 375 }); 376 377 378 // for toggle 379 jQuery(".toggle > a").click(function (){ 380 var thiselement = jQuery(this); 381 thiselement.parent().toggleClass('active'); 382 return false; 383 }); 384 385 386 jQuery(".gallery-box-thumbs").each(function() { 387 var thiselement = jQuery(this); 388 var newvalue = thiselement.find("ul li").size()*(parseInt(thiselement.find("ul li").css("width"))+parseInt(thiselement.find("ul li").css("margin-right"))); 389 thiselement.find("ul").css("width", newvalue+"px"); 390 if(thiselement.find("ul li").size() > 13){ 391 thiselement.find(".control-right").addClass("active"); 392 } 393 }); 394 395 396
397 jQuery(".gallery-box-thumbs .control-right").click(function() { 398 var thiselement = jQuery(this); 399 var ulwidth = parseInt(thiselement.parent().parent().find("ul").width()); 400 var thewidth = parseInt(thiselement.parent().parent().width()); 401 var themargin = parseInt(thiselement.parent().find("ul").css("margin-left")); 402 console.log(ulwidth+" <= "+(Math.abs(themargin)+thewidth)); 403 if(ulwidth <= (Math.abs(themargin)+72+thewidth)){ 404 thiselement.parent().find("ul").css("margin-left", "-"+(ulwidth-thewidth)+"px"); 405 thiselement.removeClass("active"); 406 }else{ 407 thiselement.parent().find("ul").css("margin-left", (themargin-72)+"px"); 408 } 409 thiselement.parent().find(".control-left").addClass("active"); 410 return false; 411 }); 412 413 jQuery(".gallery-box-thumbs .control-left").click(function() { 414 var thiselement = jQuery(this); 415 var ulwidth = parseInt(thiselement.parent().parent().find("ul").width()); 416 var thewidth = parseInt(thiselement.parent().parent().width()); 417 var themargin = parseInt(thiselement.parent().find("ul").css("margin-left")); 418 console.log(themargin+" <= "+(Math.abs(themargin)+thewidth)); 419 if(themargin+72 >= 0){ 420 thiselement.parent().find("ul").css("margin-left", "0px"); 421 thiselement.removeClass("active"); 422 }else{ 423 thiselement.parent().find("ul").css("margin-left", (themargin+72)+"px"); 424 } 425 thiselement.parent().find(".control-right").addClass("active"); 426 return false; 427 }); 428 429 jQuery(".lightbox").click(function () { 430 jQuery(".lightbox").css('overflow', 'hidden'); 431 jQuery("body").css('overflow', 'auto'); 432 jQuery(".lightbox .lightcontent").fadeOut('fast'); 433 jQuery(".lightbox").fadeOut('slow'); 434 }).children().click(function(e) { 435 return false; 436 }); 437 438 439 jQuery("body").append("<div class='menu-block'></div>"); 440 jQuery(".header .header-menu").clone().appendTo(".header").addClass("thisisfloat"); 441 jQuery(".header .header-menu.thisisfloat .main-menu").prepend(jQuery(".very-top-menu").html()); 442 jQuery(".header .header-menu.thisisfloat .main-menu").append(jQuery(".header-undermenu .wrapper ul.secondary-menu").html()); 443 jQuery(".header .header-menu.thisisfloat").append("<a href='#show-menu' class='phone-icon icon-text'>☰</div>"); 444 445 jQuery("a[href='#show-menu']").click(function () { 446 jQuery(this).parent().toggleClass("active"); 447 jQuery(".menu-block").fadeToggle('fast'); 448 jQuery("body").toggleClass('setscreen'); 449 return false; 450 }); 451 452 jQuery('.header .header-menu.thisisfixed').each(function() { 453 var thiselement = jQuery(this); 454 if (!thiselement.hasClass("thisisfloat")) { 455 thiselement.attr("rel", thiselement.offset().top); 456 thiselement.clone().appendTo('.header').css("display", "none").css("position", "fixed").css("top", "0px").css("left", "0px").css("width", "100%").css("z-index", "20").addClass("floatingmainmenu"); 457 thiselement.parent().find('.header-undermenu').clone().appendTo('.header').css("display", "none").css("position", "fixed").css("background", "#fff").css("top", "41px").css("left", "0px").css("width", "100%").css("z-index", "20").addClass("floatingmainmenu_b"); 458 jQuery('.social-icons-float').addClass("morespace"); 459 } 460 }); 461 462}); 463 464 465function lightboxclose(){ 466 jQuery(".lightbox").css('overflow', 'hidden'); 467 jQuery(".lightbox .lightcontent").fadeOut('fast'); 468 jQuery(".lightbox").fadeOut('slow'); 469 jQuery("body").css('overflow', 'auto'); 470} 471 472 473function stopSlider() { 474 _legatus_slider_autostart = false;
475 var _legatus_slider_timer = false; 476 if(_legatus_slider_loading){ 477 jQuery(".slider-container .slider-content .slider-loading").css("display", "none"); 478 } 479} 480 481function startSlider() { 482 if(!_legatus_slider_autostart)return false; 483 sliderLoading(); 484 var this_height = jQuery(".slider-container .slider-content ul li").height(); 485 var this_index = jQuery(".slider-container .slider-controls .slider-control.active").index(); 486 var this_count = jQuery(".slider-container .slider-controls .slider-control").size(); 487 if(this_index+1 < this_count){var new_index = this_index+1;}else{var new_index = 0;} 488 jQuery(".slider-container .slider-controls .slider-control").removeClass("active"); 489 jQuery(".slider-container .slider-controls .slider-control").eq(new_index).addClass("active"); 490 jQuery(".slider-container .slider-content ul").css("top", "-"+(new_index*this_height)+"px"); 491 var _legatus_slider_timer = setTimeout("startSlider()", _legatus_slider_interval); 492} 493 494function sliderLoading() { 495 if(!_legatus_slider_loading)return false; 496 jQuery(".slider-container .slider-content .slider-loading").css("width", "0px"); 497 jQuery(".slider-container .slider-content .slider-loading").animate({width:'100%'}, (_legatus_slider_interval-100)); 498} 499 500 501 502 503function printArticle() { 504 var html = jQuery(".main-article-content .shortcode-content").html(); 505 var htmltitle = jQuery(".main-article-content h2.article-title").html(); 506 if(jQuery(".main-article-content .article-photo img").size() > 0){var htmlphoto = "<img src='"+jQuery(".main-article-content .article-photo img").attr("src")+"' alt='' style='max-width: 600px;'/>";}else{var htmlphoto = "";} 507 if(jQuery(".logo-image img").size() > 0){var htmllogo = '<div class="logo-image">'+jQuery(".logo-image").html()+'</div>';var logotext = false;}else{var htmllogo = '<div class="logo-text">'+jQuery(".logo-text").html()+'</div>';var logotext = true;} 508 var htmlcopy = jQuery(".footer-content .left").html(); 509 var htmlauthor = jQuery(".right-side div").eq(1).children().eq(0).html(); 510 var htmldate = jQuery(".date .calendar-date").html(); 511 512 top.consoleRef=window.open('','articleprint', 513 'width=680,height=800' 514 +',menubar=0' 515 +',toolbar=1' 516 +',status=0' 517 +',scrollbars=1' 518 +',resizable=1'); 519 top.consoleRef.document.writeln( 520 '<html><head><title>'+jQuery(document).attr('title')+'</title><link type="text/css" rel="stylesheet" href="css/reset.css" /><link type="text/css" rel="stylesheet" href="css/print.css?'+Date()+'" /><link type="text/css" rel="stylesheet" href="css/shortcode.css?'+Date()+'" /></head>' 521 +'<body onLoad="self.focus()"><div class="wrapper">' 522 +htmllogo 523 +'<h2>'+htmltitle+'</h2>' 524 +'<div class="smallinfo"><strong>'+htmlauthor+'</strong><span>'+htmldate+'</span><a href="'+jQuery(location).attr('href')+'">'+jQuery(location).attr('href')+'</a></div>' 525 +'<div class="article-main-content shortcode-content">'+htmlphoto+''+html+'</div>' 526 +htmlcopy 527 +'</div></body></html>' 528 ); 529 top.consoleRef.document.close(); 530}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.