// TOP NAVIGATION
$(document).ready(function() { 
        $('ul.sf-menu').superfish({ 
            delay:       800,                            // one second delay on mouseout 
            animation:   {height:'show'},  // fade-in and slide-down animation 
            speed:       200,                          // faster animation speed 
            autoArrows:  false,                           // disable generation of arrow mark-up 
            dropShadows: false                            // disable drop shadows 
        }); 
    }); 		



/*
 * jQuery popup v1 - A jQuery popup plugin.
 * By Jordan Thomas - http://labs.wondergroup.com
 * Licensed under the do whatever you want to license.
 * If you like, keep this message intact so
 * someone else can find the origin.
*/
jQuery.fn.popup = function(options) {
	var defaults = {
		width: 640,
		height: 480,
		titlebar: true,
		status: true,
		resizable: true,
		toolbar: true,
		scrollbars: true,
		menubar: true
	};
	var options = jQuery.extend(defaults, options);

	Boolean.prototype.setProperty = function() {
		if (this == true) { return "yes"; } else { return "no"; }
	};

	jQuery(this).click( function() {
		var target = this.target;
		var href = this.href;
		var posY = (parseInt(screen.height/2)) - (parseInt(options.height/2));
		var posX = (parseInt(screen.width/2)) - (parseInt(options.width/2));
		var win = window.open(href, target, 'titlebar=' + options.titlebar.setProperty() + ', screenX='+ posX +', screenY='+ posY +', left='+ posX +', top='+ posY +', status=' + options.status.setProperty() + ', resizable=' + options.resizable.setProperty() + ', toolbar=' + options.toolbar.setProperty() + ', scrollbars=' + options.scrollbars.setProperty() + ', menubar=' + options.menubar.setProperty() + ', width='+ options.width +', height='+ options.height);
		win.focus();
		return false;
	});
	return this;
};


$(document).ready( function() {
			$(".popup1").popup({
				width: 680,
				height: 600,
		    status: false,
		    resizable: true,
	    	toolbar: false,
		    scrollbars: true,
		    menubar: false
			});
		});

$(document).ready(function(){
  
$.fn.slideFadeToggle = function(speed, easing, callback) {
    return this.animate({opacity: 'toggle', height: 'toggle'}, speed, easing, callback);
};

  
  $(".expand-container").hide();
  $(".expand-link").click(function(){
    //$(this) .next('.expand-container').slideToggle('normal','linear');
    $(this) .next('.expand-container').slideFadeToggle('normal','linear');
  });
});


// Autoplay
function autoplay() {
  if (document.getElementById('video-object'))
    document.getElementById('video-object').SetVariable('player:jsPlay', '');
};
$(document).ready(function(){
    var URL=window.location.href;
    if (URL.indexOf('autoplay') > -1) {
      setTimeout('autoplay()',500);
  };
});

/*
function startPlay() {
    document.getElementById('video-object').SetVariable('player:jsPlay', '');
}

  onload = function(){
    var URL=window.location.href;
    if (URL.indexOf('autoplay') > -1) {
      setTimeout('startPlay();',500);
     
  }
}
*/
