Ext.BLANK_IMAGE_URL = 'js/ext-3.3.0/resources/images/default/s.gif';

var banner=0;
var sponsor=0;

function register(){
  
  mypage = 'https://transactions.c5groupinc.com/event_reg.php?conf=2885&site=1&lang=en&gap=12';
  myname = 'reg_now';
  w=720;
  h=600;
  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=form&sub=generic";
	}
	else{
		window.location = "/files/901W12-ANC.pdf";
	}
}

Ext.onReady(
	function()
	{
		Ext.QuickTips.init();
		
		//init menu drop downs
		var menu = new DropDownManager();
		
		var slideShow = new SlideShow({
			limit:8,
			body:'slide-show',
			list:'rotate-list'
		});
		
		var spkrRotator = new Rotator({
			limit:14,
			list:'speaker-rotate',
			duration:9000
		});
		
		var sponsorRotator = new Rotator({
			limit:7,
			list:'sponsor-rotate',
			duration:9000
		});
		
		
		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'
		});*/
		
	
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/ArcticGas2011/SPEEDMAN%20VIDEO.mp4';
            	break;
            	case "player3":
            		v = 'http://blip.tv/file/get/Mcleanpartners-ArcticGas007786.flv';
            	break;
				case "player4":
            		v =' http://econtext.s3.amazonaws.com/2011/ArcticGas2011/BERGER%20VIDEO.mp4';
            	break;
				case "player5":
            		v =' http://econtext.s3.amazonaws.com/2011/ArcticGas2011/MACGUIRE%20VIDEO.mp4';
            	break;
				
            } 
	/*		
		if(Ext.get(player0) != null)
			{
			   var id = "player0";
        	   var videoform = Ext.get(id);
         	   var v = "http://econtext.s3.amazonaws.com/2011/ArcticGas2011/BERGER%20VIDEO.mp4";
			else if (Ext.get(player1) != null)
			{
				 var id = "player1";
        	   var videoform = Ext.get(id);
         	   var v = "http://econtext.s3.amazonaws.com/2011/ArcticGas2011/MACGUIRE%20VIDEO.mp4";
			}
      */ 
            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://www.alaskaoilandgascongress.com/files/swf/flowplayer.commercial-3.2.5.swf",wmode:'transparent'}, {
                    // commercial version requires product key
                    key: '#@d20b55d53d109726e0a',
                    // change the default controlbar to modern
                    plugins:{
                        controls:{
                            url: 'http://www.alaskaoilandgascongress.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
                    }
                });
            }
        }
		
	}
);
