﻿// fancybox contact
function contactfancybox() {
    $(".ContactMapPlace").fancybox({
        'transitionIn': 'elastic',
        'transitionOut': 'elastic',
        'easingIn': 'easeOutBack',
        'easingOut': 'easeInBack',
        'speedIn': 1200,
        'speedOut': 600,
        'autoScale': true,
        'type': 'iframe',
        'padding': 5,
        'hideOnContentClick': true,
        'enableEscapeButton': true,
        'overlayShow': true,
        'titleShow': false,
        'showCloseButton': true,
        'height': 400,
        'width': 650
    });
};

// fancybox youtube
$("#RecoDefPlay").click(function () {
    $.fancybox({
        'padding': 0,
        'autoScale': false,
        'transitionIn': 'none',
        'transitionOut': 'none',
        'title': this.title,
        'width': 680,
        'height': 495,
        'href': this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
        'type': 'swf',
        'swf': {
            'wmode': 'transparent',
            'allowfullscreen': 'true'
        }
    });

    return false;
});

//main menu

function onloadmenu() {
    $('.SubMenuPalceHolderClass').css('height', '0px');
    didsel = '';
    Alldivs = document.getElementsByTagName('div');
    for (i = 0; i < Alldivs.length; i++) {
        if (Alldivs[i].className == 'MainMenuControlSelPlaceHolderClass') {
            didsel = Alldivs[i].id;
        }
    }
}
function mouseOver(selected) {

    if (didsel != '') {
        document.getElementById(didsel).className = 'MainMenuControlPlaceHolderClass';
    }
    document.getElementById(selected.id).className = 'MainMenuControlSelPlaceHolderClass';
    $('.SubMenuPalceHolderClass').css('height', '100%');
    $('.SubMenuPalceHolderClass').css('overflow', 'visible');
}
function mouseOut(selected) {


    document.getElementById(selected.id).className = 'MainMenuControlPlaceHolderClass';
    if (didsel != '') {
        document.getElementById(didsel).className = 'MainMenuControlSelPlaceHolderClass';
    }
    $('.SubMenuPalceHolderClass').css('height', '0px');
    $('.SubMenuPalceHolderClass').css('overflow', 'hidden');
}
//main menu



function recofancybox() {
    $(".myImage").fancybox({
        'transitionIn': 'elastic',
        'transitionOut': 'elastic',
        'easingIn': 'easeOutBack',
        'easingOut': 'easeInBack',
        'speedIn': 1200,
        'speedOut': 600,
        'autoScale': true,
        'type': 'image',
        'padding': 5,
        'hideOnContentClick': true,
        'enableEscapeButton': true,
        'overlayShow': true,
        'titleShow': false,
        'showCloseButton': true
        
    });
};

// cycle
function HeaderCycle() {
    $('.HeaderCycleClass').cycle({
        fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
        timeout: 5000,
        pause: true,
        next: '#HeaderPrevArrow',
        prev: '#HeaderNextArrow'
    });
};

function gotoimage() {

    $('#goto2').click(function() {
        $('.HeaderCycleClass').cycle(1);
        return false;
    });
    $('#goto3').click(function() {
        $('.HeaderCycleClass').cycle(2);
        return false;
    });
    $('#sgoto1').click(function() {
        $('.HeaderCycleClass').cycle(0);
        return false;
    });
    $('#sgoto3').click(function() {
        $('.HeaderCycleClass').cycle(2);
        return false;
    });
    $('#tgoto1').click(function() {
        $('.HeaderCycleClass').cycle(0);
        return false;
    });
    $('#tgoto2').click(function() {
        $('.HeaderCycleClass').cycle(1);
        return false;
    });
}

// cycleDefault
function DefaultCycle() {
    $('.CustomCycleTableHolder').cycle({
        fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
        timeout: 5000,
        pause: true,
        next: '#CutomerCycleLeftArrow',
        prev: '#CutomerCycleRightArrow',
        width: '190px',
        height: '100px'
    });
};

//watermark

    $(document).ready(function textboxwatermark() {
        $('input').each(function () {
            $(this).watermark($(this).attr('watermark'));
            $(".ContactMultilineTBox").watermark('הערות');
        });
    });

// customers cover layer
		    function OnCustomerOver(sender) {
		        $(sender).children('.CustomerBoxBG_Over').css('display', 'block')
    };

    function OnCustomerOut(sender) {
        $(sender).children('.CustomerBoxBG_Over').css('display', 'none')
    };


// default properties popup
    function popupShow(sender) {
        //alert($(sender).next().attr('class'));
        $(sender).next('.PropertiesPopupBalloonBG').css('display', 'block')
    };

    function popupHide(sender) {
        $(sender).next('.PropertiesPopupBalloonBG').css('display', 'none')
    };



    function ClosePopup() {
        $(".DownloadSoftPopupBG").css('height', '0px');
    };

    function OpenPopup() {
        $(".DownloadSoftPopupBG").css('height', '285px');
    };
    
    


