/**
 * Base namespace setup
 */
var ENGINETECH = {
    globals: {
		labels: {}
	},
    pages: {
        all: {}
    },
    widgets: {}
}

/**
 * Init for all pages
 */
ENGINETECH.pages.all.init = function () {
      
	/**
	* Initialize EngineTech Pop up page
	*/
	ENGINETECH.globals.modifyInfo = new YAHOO.widget.Panel(
		"modify-info",
		{ 
			width: "748px",
			height: "374px",
			constraintoviewport: true,
			underlay:"shadow",
			close:true,
			visible:false,
			fixedcenter: true,
			draggable:false,
			zIndex: 9999,
			modal: true
		}
	);
	//Render the panel for screen
	ENGINETECH.globals.modifyInfo.render(document.body);
	
	//Create an array with all anchor with the classname "modify"
     var el = YAHOO.util.Dom.getElementsByClassName('modify','a');

     for (var i=0; el[i]; i++) {
		el[i].onclick = function() {
			var pnl = ENGINETECH.globals.modifyInfo;
			pnl.setBody("<div id='engine-iframe'><iframe width='724' marginwidth='0' marginheight='0' scrolling='no' frameborder='0' height='330' src='" + this.href + "'></iframe></div><div id='engine-bg'></div>");
			pnl.render();
			pnl.show();
	        return false;
			}
		el[i].style.visibility = "visible";
      }      
      
      //Fix bug to click in the flash button after close the popop
      //Add to display none
      var parentModify = document.getElementById('modify-info_c');      
      parentModify.onclick = function() {
		parentModify.style.display = "none";
      }
      
      //Call function to open popup
      ENGINETECH.globals.popIframe = function (href) {
		var pnl = ENGINETECH.globals.modifyInfo;		
		pnl.setBody("<div id='engine-iframe'><iframe width='724' marginwidth='0' marginheight='0' scrolling='no' frameborder='0' height='330' src='" + href + "'></iframe></div><div id='engine-bg'></div>");
		pnl.render(document.body);		
		pnl.show();
		//Create and add to display block
		parentModify.style.display = "block";
      }
}



