Ext.BLANK_IMAGE_URL = 'js/ext-3.3.0/resources/images/default/s.gif';

var banner=0;
var sponsor=0;

function register(){
  
  var mypage = 'https://transactions.c5groupinc.com/event_reg.php?conf=3044&site=1&lang=en&gap=3';
  var myname = 'reg_now';
  var w=720;
  var h=600;
  var features="";
  
  if(screen.width){
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  }else{winl = 0;wint =0;}
  if (winl < 0) winl = 0;
  if (wint < 0) wint = 0;
  
  var settings = 'toolbar=0,location=0,directories=0,menuBar=0,scrollbars=1,width='+w+',height='+h+',top='+wint+',left='+winl+',resizable=0';
  
  win = window.open(mypage,myname,settings);
  win.window.focus();
}

function downloadAgenda(){
	
	if(!genericForm){
		window.location = "index.php?page=pdf";
	}
	else{
		window.location = "/files/385W12-CAL.pdf";
	}
}
Ext.onReady(
	function()
	{
		Ext.QuickTips.init();
		
		//init menu drop downs
		var menu = new DropDownManager();
		
		var slideShow = new SlideShow({
			limit:6,
			body:'slide-show',
			list:'rotate-list'
		});
		
		var spkrRotator = new Rotator({
			limit:6,
			list:'speaker-rotate',
			duration:9000
		});
		
		var sponsorRotator = new Rotator({
			limit:5,
			list:'sponsor-rotate',
			duration:9000
		});
		
		
	for(var x=0;Ext.get('player'+x) != null;x++)
 {
        	var id = 'player'+x;
        	var videoform = Ext.get(id);
            
            var v = "";

            switch(id){
            	case "player0":
				v = 'http://econtext.s3.amazonaws.com/2011/ArcticGas2011/BERGER%20VIDEO.mp4';
			break;
			case "player1":
				v = 'http://econtext.s3.amazonaws.com/2011/ArcticGas2011/MACGUIRE%20VIDEO.mp4';
			break;
			case "player2":
				v = 'http://econtext.s3.amazonaws.com/2011/Various/Marketing/ArcticGas/ArcticGas009.mp4';
			break;
			case "player3":
				v = 'http://econtext.s3.amazonaws.com/2011/Various/Marketing/ArcticGas/ArcticGas013.mp4';
			break;
			case "player4":
				v = 'http://econtext.s3.amazonaws.com/2011/Various/Marketing/ArcticGas/ArcticGas014.mp4';
			break;
            }
            
            if(videoForm){
                videoform.on('click',function(){                    
                    var vid = new VideoDownloadWindow({
                    	video:v,
                    	videoId:id
                    });
                    vid.show();
                });    
            }
            else{
                videoform.replaceWith({
                    id:id,
                    tag:'div',
                    style:'margin-left:'+
                        videoform.getMargins('l')+
                        'px;display:block;width:'+
                        videoform.getWidth()+
                        'px;height:'+
                        videoform.getHeight()
                });
                
                flowplayer(id, { src:"http://arcticgassymposium.com/files/swf/flowplayer.commercial-3.2.5.swf",wmode:'transparent'}, {
                    // commercial version requires product key
                    key: '#@0fcd864b7f35ff23675',
                    // change the default controlbar to modern
                    plugins:{
                        controls:{
                            url: 'http://arcticgassymposium.com/files/swf/flowplayer.controls-3.2.3.swf',
                            
                            borderRadius: '0px',
                            timeColor: '#ffffff',
                            bufferGradient: 'none',
                            slowForward: true,
                            backgroundColor: 'rgba(46, 84, 133, 0.55)',
                            volumeSliderGradient: 'none',
                            slowBackward: false,
                            timeBorderRadius: 20,
                            progressGradient: 'none',
                            time: true,
                            height: 26,
                            volumeColor: '#4599ff',
                            
                            tooltips:{
                                marginBottom: 5,
                                volume: true,
                                scrubber: true,
                                buttons: false
                            },
                            
                            fastBackward: false,
                            opacity: 1,
                            timeFontSize: 12,
                            bufferColor: '#a3a3a3',
                            border: '0px',
                            volumeSliderColor: '#ffffff',
                            buttonColor: '#ffffff',
                            mute: true,
                            
                            autoHide:{
                                enabled: true,
                                hideDelay: 500,
                                hideStyle: 'fade',
                                mouseOutDelay: 500,
                                hideDuration: 400,
                                fullscreenOnly: false
                            },
                            
                            backgroundGradient: [0,0.2,0.4],
                            width: '100pct',
                            display: 'block',
                            sliderBorder: '1px solid rgba(128, 128, 128, 0.7)',
                            buttonOverColor: '#ffffff',
                            fullscreen: true,
                            timeBgColor: 'rgb(0, 0, 0, 0)',
                            scrubberBarHeightRatio: 0.1,
                            bottom: 0,
                            stop: false,
                            zIndex: 1,
                            sliderColor: '#000000',
                            scrubberHeightRatio: 0.6,
                            tooltipTextColor: '#ffffff',
                            sliderGradient: 'none',
                            timeBgHeightRatio: 0.8,
                            volumeSliderHeightRatio: 0.4,
                            name: 'controls',
                            timeSeparator: ' ',
                            volumeBarHeightRatio: 0.1,
                            left: '50pct',
                            tooltipColor: 'rgba(0, 0, 0, 0)',
                            playlist: false,
                            durationColor: '#b8d9ff',
                            play: true,
                            fastForward: true,
                            timeBorder: '0px solid rgba(0, 0, 0, 0.3)',
                            progressColor: '#4599ff',
                            volume: true,
                            scrubber: true,
                            builtIn: false,
                            volumeBorder: '1px solid rgba(128, 128, 128, 0.7)'
                        }
                    },
                    
                    // setting for movie clip
                    clip:  {
                        url: v,
                        autoPlay: false,
                        autoBuffering: true
                    }
                });
            }
        }
		
		/*var wordRotate = new Rotator({
			limit:4,
			list:'letter-rotate',
			duration:9000
		});*/
		
		/*var poll = new PollForm({
			view:'poll-view',
			submit:'poll-submit'
		});
		*/
		/*var banner = new BottomBanner({
			item:'bottom-banner',
			close:'bottom-banner-close'
		});*/
	}
);
