// JavaScript Document
//Author: Vicente Nze Elomba
//Name: IndexPopUpWindow.js
//Description: To display extra information in a popup window.

//function to get the ID of the clicked div
function getDiv(){
 //Use Ext 2.0 to create the window container
 Ext.onReady(function(){
//Create about us panel
 var pAboutUs = new Ext.Panel({
		collapsible:false,
        defaults:{autoHeight: true, autoScroll: true, autoWidth:true},
		bodyStyle: 'padding:4px; font-size:12px; font-family:Geneva, Arial, Helvetica;color:#002851;',
		autoLoad: {url: 'AboutUs.htm'}
	});   
 
 var winAboutUs  = new Ext.Window({
        title: 'A MESSAGE FROM H.E. THE AMBASSADOR',
        width: 700,	
        height:550,	
        minWidth: 100,
        minHeight: 50,
		layout: 'fit',
		model:true,
        plain:true,
        bodyStyle:'padding:5px; text-align:left;overflow:scroll;',
		defaults:{autoHeight: true,autoWidth:true},
		autoScroll: true,
		closable:false,
		items: pAboutUs,
		allowDomMove: true,
		animCollapse: true,
		collapsible:true,
		resizable:false,
		maximizable : false,
		minimizable : false,
		modal:true,
		footer: true,
		fbar:[
			   {text: 'Close', iconCls: 'cerrar', scale: 'large', handler: function(){winAboutUs.hide();}}
			]
	 });
    winAboutUs.setPosition(100,10);	 
     winAboutUs.show();
  });
}

//function to display about Equatorial Guinea window
function aboutEG(){
     //Use Ext 2.0 to create the window container
     Ext.onReady(function(){
		var pAboutEG = 	new Ext.Panel({
		collapsible:false,
        defaults:{autoHeight: true, autoScroll: true, autoWidth:true},
		bodyStyle: 'padding:4px;',
		autoLoad: {url: 'aboutGE.cfm', scripts: true}
	   }); 
		
 //About Equatorial Guinea window		
  var winAboutEG  = new Ext.Window({
        title: 'ABOUT EQUATORIAL GUINEA',
        width: 700,
        height:300,		
        minWidth: 100,
        minHeight: 50,
		layout: 'fit',
		model:true,
        plain:true,
        bodyStyle:'padding:5px; text-align:left; color:#fff;overflow:scroll;',
		defaults:{autoHeight: true, autoWidth:true},
		autoScroll: true,
		closable:false,
		items: pAboutEG,
		allowDomMove: true,
		animCollapse: true,
		collapsible:true,
		resizable:false,
		maximizable : false,
		minimizable : false,
		modal:true,
		footer: true,
		fbar:[
			   {text: 'Cerrar', iconCls: 'cerrar', scale: 'large', handler: function(){winAboutEG.hide();}}
			],
		style: 'margin-top:1%'
	 }); 
	 winAboutEG.setPosition(100,10);
     winAboutEG.show(); 
    });		
}

//Create Actuacion de la Embajada window
function ActuacionEmbajada(){
	
     Ext.onReady(function(){
		var pActuacionEmbajada = 	new Ext.Panel({
		collapsible:false,
        defaults:{autoHeight: true, autoScroll: true, autoWidth:true},
		bodyStyle: 'padding:4px; font-size:12px; font-family:Geneva, Arial, Helvetica;color:#002851;',
		autoLoad: {url: 'ActuacionEmbajada.cfm', scripts:true}
	   }); 
		
		//Actuacion de la Embajada Window
		 var winActuacionEmbassy  = new Ext.Window({
        title: 'ACTUACION DE LA EMBAJADA',
        width: 600,	
		height:450,
        minWidth: 100,
        minHeight: 50,
		layout: 'fit',
		model:true,
        plain:true,
        bodyStyle:'padding:5px; text-align:left;overflow:scroll;',
		defaults:{autoHeight: true, autoWidth:true},
		autoScroll: true,
		closable:false,
		items: pActuacionEmbajada,
		allowDomMove: true,
		animCollapse: true,
		collapsible:true,
		resizable:false,
		maximizable : false,
		minimizable : false,
		modal:true,
		style: 'margin-top:1%',
		footer: true,
		fbar:[
			   {text: 'Cerrar', iconCls: 'cerrar', scale: 'large', handler: function(){winActuacionEmbassy.hide();}}
			]
	 });
	 winActuacionEmbassy.setPosition(100,10);
     winActuacionEmbassy.show(); 
    });				 
}

//Create Personal de la Embajada window
function personalEmbassy(){
	
     Ext.onReady(function(){
		var pEmbassyPersonal = 	new Ext.Panel({
		collapsible:false,
        defaults:{autoHeight: true, autoScroll: true, autoWidth:true},
		bodyStyle: 'padding:4px; font-size:12px; font-family:Geneva, Arial, Helvetica;color:#002851;',
		autoLoad: {url: 'Personal.cfm', scripts: true}
	   }); 
		
		//Personal Embassy Window
		 var winPersonalEmbassy  = new Ext.Window({
        title: 'PERSONAL DE LA EMBAJADA',
        width: 500,
        height: 600,		
        minWidth: 100,
        minHeight: 50,
		layout: 'fit',
		model:true,
        plain:true,
        bodyStyle:'padding:5px; text-align:left;overflow:scroll;',
		defaults:{autoHeight: true, autoWidth:true},
		autoScroll: true,
		closable:false,
		items: pEmbassyPersonal,
		allowDomMove: true,
		animCollapse: true,
		collapsible:true,
		resizable:false,
		maximizable : false,
		minimizable : false,
		modal:true,
		style: 'margin-top:1%',
						 footer: true,
						 fbar:[
							   {text: 'Cerrar', iconCls: 'cerrar', scale: 'large', handler: function(){winPersonalEmbassy.hide();}}
							]
	 }); 
	 winPersonalEmbassy.setPosition(100,10);
     winPersonalEmbassy.show(); 
    });				 
}

function gobiernoGE(){	
      Ext.onReady(function(){
		var pGobiernoGE = 	new Ext.Panel({
		collapsible:false,
        defaults:{autoHeight: true, autoScroll: true, autoWidth:true,resizable:true},
		bodyStyle: 'padding:4px; font-size:12px; font-family:Geneva, Arial, Helvetica;color:#002851;',
		autoLoad: {url: 'nuevoGobierno.html', scripts: true}
	   }); 
		//Nuevo Gobierno de Guinea Ecuatorial
		 var winGobiernoGE  = new Ext.Window({
        title: 'NUEVO GOBIERNO DE GUINEA ECUATORIAL',
        width: 550,
        height: 600,		
        minWidth: 100,
        minHeight: 50,
		layout: 'fit',
		model:true,
        plain:true,
        bodyStyle:'padding:5px; text-align:left;overflow:scroll;',
		defaults:{autoHeight: true, autoWidth:true},
		autoScroll: true,
		closable:false,
		items: pGobiernoGE,
		allowDomMove: true,
		animCollapse: true,
		collapsible:true,
		resizable:false,
		maximizable : false,
		minimizable : false,
		modal:true,
		style: 'margin-top:1%',
		footer: true,
		fbar:[
			   {text: 'Cerrar', iconCls: 'cerrar', scale: 'large', handler: function(){winGobiernoGE.hide();}}
			]
	 }); 
	 winGobiernoGE.setPosition(200,10);
     winGobiernoGE.show(); 
    });				 
}

function GeneralInfo(){	
      Ext.onReady(function(){
		var pGenInfo = 	new Ext.Panel({
		collapsible:false,
        defaults:{autoHeight: true, autoScroll: true, autoWidth:true,resizable:true},
		bodyStyle: 'padding:4px; font-size:12px; font-family:Geneva, Arial, Helvetica;color:#002851;',
		autoLoad: {url: 'GeneralInformation.cfm', scripts:true}
	   }); 
		//General Information about Guinea Ecuatorial
		var winGenInfo  = new Ext.Window({
        title: 'GENERAL INFORMATION',
        width: 550,
        height: 600,		
        minWidth: 100,
        minHeight: 50,
		layout: 'fit',
		model:true,
        plain:true,
        bodyStyle:'padding:5px; text-align:left;overflow:scroll;',
		defaults:{autoHeight: true, autoWidth:true},
		autoScroll: true,
		closable:false,
		items: pGenInfo,
		allowDomMove: true,
		animCollapse: true,
		collapsible:true,
		resizable:false,
		maximizable : false,
		minimizable : false,
		modal:true,
		style: 'margin-top:1%',
		footer: true,
		fbar:[
			   {text: 'Cerrar', iconCls: 'cerrar', scale: 'large', handler: function(){winGenInfo.hide();}}
			]
	 }); 
	 winGenInfo.setPosition(100,10);
     winGenInfo.show(); 
    });				 
}

//read Full News
function leerNoticia(noticiaID)
{
	 Ext.onReady(function(){	
	 	
		var fullNewsPanel = new Ext.Panel({
			collapsible:false,
			defaults:{autoHeight: true, autoScroll: true, autoWidth:true,resizable:true},
			bodyStyle: 'padding:4px;',
			autoLoad: {url:'leerNoticia.cfm?noticiaID='+noticiaID},

        buttons: [
             { 
               text: 'Volver al Inicio',
               tooltip: 'Pulsar para ir a la pagina de inicio',
               handler: function(){winFullNoticia.hide();},
		   type: 'button'
             }
            ]
	   });		
		
		//Full news window
		var winFullNoticia = new Ext.Window({
        title: 'NOTICIERO DE LA EMBAJADA',
        width: screen.width/2,		
        minWidth: 100,
        height: 700,
        minHeight: 50,
		layout: 'fit',
		model:true,
        plain:true,
        bodyStyle:'padding:5px;',
		defaults:{autoHeight: true, autoWidth:true},
		autoScroll: true,
		closable:true,
		items: fullNewsPanel,
		allowDomMove: true,
		animCollapse: true,
		collapsible:true,
		resizable:true,
		maximizable : true,
		minimizable : false,
		modal:true,
		style: 'margin-top:1%'
	 });
	winFullNoticia.setPosition(100,10);
      winFullNoticia.show(); 
    });				
}