$(window).load(function() {
	$('.imagefit').imagefit();

});
$(document).ready(function() {
	$('.externallink').click(function(){
		this.target = "_blank";
	});

	// CODE FOR SUPERFISH MENU
	$('ul.sf-menu').superfish({
		delay: 500,
		animation: {opacity:'show',height:'show'},
		speed: 'fast',
		autoArrows: true,
		dropShadows: true,
		hoverClass: 'sfHover'
	});

	// CODE FOR FLASH BOX
	$('#flashmenu').show();
	$('#flashcontentdevelopment').hide();
	$('#flashcontentsecurity').hide();
	$('#flashcontentsupport').hide();
	//$('#flashcontentalt').hide();
	$('#flashcontentmanaged').hide();

	var url = document.URL;
	var filename = (url.substring(url.indexOf("pantek\.com\/")+11,url.lastIndexOf("\.php")))
	if (filename=='index'||filename=='http://www.pantek.com/'||filename=='http://pantek.com/'||filename=='http://pantek.com'||filename=='http://development.pantek.com/') {
		flashembed("flashcontentdevelopment", {src: '/image/development.swf',  wmode:'transparent'});
		flashembed("flashcontentsecurity", {src: '/image/security.swf',  wmode:'transparent'});
		flashembed("flashcontentsupport", {src: '/image/support.swf',  wmode:'transparent'});
		flashembed("flashcontentmanaged", {src: '/image/managed.swf',  wmode:'transparent'});
		$('#flashcontentsupport').show();
	}
        // CODE FOR FLASH MENU
        $('ul.flashmenulist li').hoverIntent(function() {
                var currentId = $(this).attr('id');
                if ( currentId == 'supportlink' ) {
                        $('#flashcontentsupport').show();
                        $('#flashcontentdevelopment').hide();
                        $('#flashcontentsecurity').hide();
			$('#flashcontentmanaged').hide();
                }
                if ( currentId == 'securitylink' ) {
                        $('#flashcontentsecurity').show();
                        $('#flashcontentdevelopment').hide();
                        $('#flashcontentsupport').hide();
			$('#flashcontentmanaged').hide();
                }
                if ( currentId == 'developmentlink' ) {
                        $('#flashcontentdevelopment').show();
                        $('#flashcontentsecurity').hide();
                        $('#flashcontentsupport').hide();
			$('#flashcontentmanaged').hide();
                }
                if ( currentId == 'managedlink' ) {
			$('#flashcontentmanaged').show();
                        $('#flashcontentdevelopment').hide();
                        $('#flashcontentsecurity').hide();
                        $('#flashcontentsupport').hide();
                }

                $(this).find('div').addClass("hover").stop() /* Add class of "hover", then stop animation queue buildup*/
                        .animate({
                                top: '-17px'

                        }, 400); /* this value of "200" is the speed of how fast/slow this hover animates */

        } , function() {
                $(this).find('div').removeClass("hover").stop()  /* Remove the "hover" class , then stop animation queue buildup*/
                        .animate({
                                top: '0'
                        }, 400);
        });
	// Twitter box
	$(".tweet").tweet({
		username: "pantekInc",
		count: 6,
		loading_text: "loading tweets..."
	});

});


