﻿$(document).ready(function () {
    $(".slider").owlCarousel({
        loop: true,
        nav: true,
        items: 1,
        mouseDrag: true,
        dots: true,
        navText: ["<i class='fa fa-chevron-right'></i>", "<i class='fa fa-chevron-left'></i>"],
        autoplay: true,
        rtl: true,
    });
    $(".slider-big").owlCarousel({
        loop: true,
        nav: true,
        items: 3,
        mouseDrag: true,
        margin: 30,
        dots: false,
        navText: ["<i class='fa fa-arrow-right'></i>", "<i class='fa fa-arrow-left'></i>"],
        autoplay: false,
        rtl: true,
        responsive: {
            0: {
                items: 1,
            },
            745: {
                item:2
            }
        }
    });
	 $(".slider-big1").owlCarousel({
        loop: true,
        nav: true,
        items: 2,
        mouseDrag: true,
        margin: 30,
        dots: false,
        navText: ["<i class='fa fa-arrow-right'></i>", "<i class='fa fa-arrow-left'></i>"],
        autoplay: false,
        rtl: true,
        responsive: {
            0: {
                items: 1,
            },
            745: {
                item:2
            }
        }
    });
  $(".slider-big0").owlCarousel({
        loop: true,
        nav: true,
        items: 4,
        mouseDrag: true,
        margin: 30,
        dots: false,
        navText: ["<i class='fa fa-arrow-right'></i>", "<i class='fa fa-arrow-left'></i>"],
        autoplay: false,
        rtl: true,
        responsive: {
            0: {
                items: 1,
            },
            745: {
                item:2
            }
        }
    });

    $(".search").click(function () {
        $(".search-sec").toggleClass("hide");
    });

    $(".nav-link").click(function () {
        $(".collapse").toggleClass("show");
    });

	
		$(window).scroll(function () {
			if ($(this).scrollTop() > 50) {
				$('#back-to-top').fadeIn();
			} else {
				$('#back-to-top').fadeOut();
			}
		});
		// scroll body to 0px on click
		$('#back-to-top').click(function () {
			$('body,html').animate({
				scrollTop: 0
			}, 400);
			return false;
		});
	
	
	});
if (innerWidth > 767) {
    $(document).ready(function () {
        $(".dropdown").hover(function () {
            var dropdownMenu = $(this).children(".dropdown-menu");
            console.log(dropdownMenu);
            if (!dropdownMenu.parent().hasClass("show")) {
                dropdownMenu.toggleClass("show");
                dropdownMenu.parent().toggleClass("show");
            } else {
                dropdownMenu.removeClass("show");
                dropdownMenu.parent().removeClass("show");
            }
        });
    });
    console.log(innerWidth);
} else {
    $(document).ready(function () {
        $(".navbar-toggler").click(function () {
            $(".navbar-collapse").toggleClass("collapse")
        });
        $(".dropdown").click(function () {
            var dropdownMenu = $(this).children(".dropdown-menu");
            console.log(dropdownMenu);
            if (!dropdownMenu.parent().hasClass("show")) {
                dropdownMenu.toggleClass("show");
                dropdownMenu.parent().toggleClass("show");
            } else {
                dropdownMenu.removeClass("show");
                dropdownMenu.parent().removeClass("show");
            }
        });
    });
}




//Specify affected tags. Add or remove from list:
var tgs = new Array('div', 'td', 'tr' , 'p');

//Specify spectrum of different font sizes:
//var szs = new Array('xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large');
var szs = new Array('13px', '15px', '17px', '21px', '23px', '25px', '27px');
var startSz = 2;

function ts(trgt, inc) {
    if (!document.getElementById) return
    var d = document, cEl = null, sz = startSz, i, j, cTags;

    sz += inc;
    if (sz < 0) sz = 0;
    if (sz > 6) sz = 6;
    startSz = sz;

    if (!(cEl = d.getElementById(trgt))) cEl = d.getElementsByTagName(trgt)[0];

    cEl.style.fontSize = szs[sz];

    for (i = 0; i < tgs.length; i++) {
        cTags = cEl.getElementsByTagName(tgs[i]);
        for (j = 0; j < cTags.length; j++) cTags[j].style.fontSize = szs[sz];
    }
}


function print(ref) {
    var str = "toolbar=no,status=no,menubar=no,location=no,scrollbars=yes,resizable=no,height=610,width=800"
    tellaFriend = window.open(ref, "TellObj", str);
    tellaFriend.opener = top;
} 

