﻿function pageLoad(sender, args)
{
    try
    {
        $(document).ready
        (
            function() {
                SetupPanelGallery();
                SetupLogoClick();
                SetupTooltips();
                SetupPageMenuLinks();
                SetupPageTitleEffects();
            }
        );
	}
	catch (ex) {
	}
}

function SetupPageTitleEffects() {
    $("#pageTitleDiv").hover
    (
        function() { $(this).stop().animate({opacity:1}, 300); },
        function() { $(this).stop().animate({ opacity: 0.8 }, 500); }
    );

   
}

function SetupPanelGallery() {
    $("#container").panelGallery(
        {
            viewDuration: 6000,
		    transitionDuration: 500,
		    boxSize: 35,
		    boxFadeDuration: 500,
		    boxTransitionDuration: 100,
		    pauseOnHover: true
        }
    );
}

function SetupPageMenuLinks() {
    $(".pageMenuLink").hover
    (
        function() { $(this).stop().animate({backgroundColor:'#333', color:"White"}, 300); },
        function() { $(this).stop().animate({ backgroundColor: 'white', color: "#555"}, 500); }
    );
}

function SetupLogoClick() 
{
    $("#logo").live('click', function() { window.location = "http://www.rotec.ro"; }).
    hover(
        function() { $("#logoMotto").stop().animate({ color: '#3797cd' }, 500); },
        function() { $("#logoMotto").stop().animate({ color: '#fff' }, 500); }
    );
}

function SetupTooltips() 
{

    
    $("[id*='lnkRO'],[id*='lnkEN']").qtip
			                    (
			                        { style:
			                            {
			                                width: 200,
			                                padding: 5,
			                                background: '#333333',
			                                color: '#cccccc',
			                                textAlign: 'center',
			                                fontStyle: 'italic',
			                                border:
			                                {
			                                    width: 1,
			                                    radius: 3,
			                                    color: '#333333'
			                                },
			                                tip: true,
			                                name: 'dark'

			                            },
			                            position:
			                            {
			                                corner:
			                                {
			                                    target: 'bottomMiddle',
			                                    tooltip: 'topMiddle'
			                                }
			                            }
			                        }
			                    );


    $("td[class*='mandatoryTd'][title]").qtip
			    (
			        { style:
			            {
			                width: 200,
			                padding: 5,
			                background: '#333333',
			                color: '#cccccc',
			                textAlign: 'center',
			                fontStyle: 'italic',
			                border:
			                {
			                    width: 1,
			                    radius: 3,
			                    color: '#333333'
			                },
			                tip: true,
			                name: 'dark'

			            },
			            position:
			            {
			                corner:
			                {
			                    target: 'topMiddle',
			                    tooltip: 'bottomMiddle'
			                }
			            }
			        }
			    );


}


