

///////////////////////////////////////////////////////


// make dojo.toJson() print dates correctly (this feels a bit dirty)
Date.prototype.json = function(){ return dojo.date.stamp.toISOString(this, {selector: 'date'});};
//

var initdiag = false;

var deviceBB = "blackberry";

//Initialize our user agent string to lower case.
var uagent = navigator.userAgent.toLowerCase();

//**************************
// Detects if the current browser is a BlackBerry of some sort.
function DetectBlackBerry()
{
   if (uagent.search(deviceBB) > -1)
      return true;
   else
      return false;
}

/////////////////////////////////////////
var mmenu = [];
mmenu["SERVICES"] = 0; 
mmenu["cases"] = 1;

function newVw( vwid, newvw ){
  var vw = dijit.byId(vwid);
  vw.setHref(newvw);
  }
  
function openVw(vwnum) {
  switch(vwnum)
    {
    case mmenu["home"]:
      //newVw('vwwelcome', 'xhpswel_left.htm'); newVw('columnA', 'xhpswel_right.htm');
      newVw('vwwelcome', 'wnd/wel_left.jsp');
      newVw('columnA', 'wnd/WIT.jsp');
      break;    
    case  mmenu["cases"]:
     newVw('columnA', 'wnd/Cases.jsp');
     break;
    }
}

var  secondDlg = null;
var contactDialog = null;

var elb = null;

var nano1 = null;


function init(){
 initCenter();     
 // initHeader(); 
 initToolbar()
 //setTimeout("initToolbar()", 3000);	
 
 
 
////  getTwitter();
//// secondDlg = new dijit.Dialog({
////	    title: "Service Oriented Architecture",
////	    style: "width: 750px"	    
////	});

elb = new dojox.image.LightboxDialog({});
elb.connect(elb.textNode, "onclick", function(e){
	e.preventDefault();
	elb.show({
		leaveTitle:true,
		href: dojo.attr(e.target, "href")
	});
})
elb.startup();
 
nano1 = new dojox.image.LightboxNano({
    href: "images/site/stream/Slide1.GIF"
}, "myNano1");
 


 
 
  if( docReq == "1") {
	showContactView(  "Request Form", "jsp/wnd/requestdoc.jsp", "600px" );
	} else
    sendVisitorInfo();
 
	
}
 
 
 
var cp;

var cp2;

function initCenter() {
	//dojo.require("dijit.layout.ContentPane");
	
    cp = new dijit.layout.ContentPane({
        style: "height:315px; width: 100%;"
     },
    "topMiddle");
    
    cp.attr('href', 'jsp/top_right.jsp');
 
    //#content-wrap {background-image: url(images/3-maincontent-backgd.gif);float:left;margin:auto;width:933px;padding:5px 15px 0 15px;background-repeat: repeat-y}
    cp2 = new dijit.layout.ContentPane({
        style: "float:left;margin:auto;width: 933px;padding:5px 15px 0 15px;"
     },
    "botMiddle");    
    cp2.attr('href', 'jsp/bot_middle.jsp');
 
    cp3 = new dijit.layout.ContentPane({
        style: "float:left;margin:auto;width: 933px;padding:5px 15px 0 15px;"
     },
    "footer_top");    
    cp3.attr('href', 'jsp/footer_top.jsp');
    
   //setTimeout("initNews()",2000);
  }

//function initNews() { 
//    cp4 = new dijit.layout.ContentPane({},  "middle2_right");    
//    cp4.attr('href', 'jsp/wnd/News.jsp');
//    
//    
//}

function initToolbar() {
	//dojo.require("dijit.Toolbar");
	//dojo.require("dijit.PopupMenuItem");
	//dojo.require("dojo.data.ItemFileReadStore");
	//dojo.require("dijit.Menu");

	//dojo.require("dijit.form.DropDownButton");
	
  var toolbar = new dijit.Toolbar({style:"text-align:left;background:transparent; "}, dojo.byId("mainMenu"));

  createDDMenuServices(toolbar); //Services
  
  createDDMenuSolutions(toolbar); //Solutions
  
  button = new dijit.form.Button({
                 label: "CLIENTS",
                 id: "mainMenu.client",
                 //showLabel:  true
                onClick: function(){ showView2("CLIENTS", './jsp/wnd/clients.jsp', 500, 400 ); }
	  //newVw('columnA', 'wnd/contacts.jsp'); }
                 });		
  toolbar.addChild(button);	
	
  button = new dijit.form.Button({
      label: "PARTNERS",
      id: "mainMenu.partners",
      //showLabel:  true
     onClick: function(){ showView2("PARTNERS", './jsp/wnd/partners.jsp', 500, 400 ); }
      });		
  toolbar.addChild(button);	
  
  createDDMenuOpportunities(toolbar);  // Opportunities
  
  createDDMenuManagement(toolbar); // Management
}

function createDDMenuOpportunities(xtoolbar) {
	  var menu = new dijit.Menu({ });
	  menu.domNode.style.display="none";
	  
	  var pSubMenu = new dijit.Menu();
 //     pSubMenu.addChild(new dijit.MenuItem({
 //         label: "Java/SOA Tester",
  //        onClick: function(){  showEmploymentView("soatester01.jsp");   }
  //    }));
      
//      pSubMenu.addChild(new dijit.MenuItem({
//          label: "Java SOA Senior Developer"
//      }));
//      
//      pSubMenu.addChild(new dijit.MenuItem({
//          label: "Java SOA Architect"
//      }));
      
      menu.addChild(new dijit.PopupMenuItem({
          label: "Employment",
          popup: pSubMenu
      }));

	  
	 // var subjob1 = new dijit.PopupMenuItem();
	 /// subjob1.setLabel("Employment");
	  
	 // var menuItem1 = new dijit.MenuItem({
	 //                      //   label: "Coaching Technology",
	 //                      onClick: function(){  showEmploymentView();   }                               });
	 //                
	 // menuItem1.setLabel("Java/SOA Tester");  
	  
	 // subjob1.addChild(subjob1);
	  
	 // menu.addChild(menuItem1);

	  var menuItem2 = new dijit.MenuItem({onClick: function(){   showPartnershipView(); }});
	  menuItem2.setLabel("Partnership");                      
	  menu.addChild(menuItem2);

	  var params = {
	                label: "OPPORTUNITIES",
	                name: "mainMenu.opportunities",
	                dropDown: menu,
	                id: "mainMenu.opportunities"
	                };
	  var widget = new dijit.form.DropDownButton(params);
	  xtoolbar.addChild( widget );

	return widget;
	}

function createDDMenuServices(xtoolbar) {
	  var menu = new dijit.Menu({ });

	  menu.domNode.style.display="none";
	  var menuItem1 = new dijit.MenuItem({
	                       //   label: "Coaching Technology",
	                       onClick: function(){   cp.attr('href', './jsp/wnd/soa_right.jsp');   }                               });
	                 
	  menuItem1.setLabel("Service Oriented Architecture");  
	  menu.addChild(menuItem1);
	  
	  //var menuItem3 = new dijit.MenuItem({onClick: function(){  showView( "Master Data Management", "jsp/wnd/Mdm.jsp", "650px" ); }});
	  var menuItem3 = new dijit.MenuItem({onClick: function(){  cp.attr('href', './jsp/wnd/mdm_right.jsp'); }});
	  menuItem3.setLabel("Master Data Management");                      
	  menu.addChild(menuItem3);

	  
	  //var menuItem4 = new dijit.MenuItem({onClick: function(){  showInConstruction("Cloud Computing"); }});
	  var menuItem4 = new dijit.MenuItem({onClick: function(){   cp.attr('href', './jsp/wnd/cloud_right.jsp'); }});	      
	  menuItem4.setLabel("Cloud Computing");                      
	  menu.addChild(menuItem4);

	   
	  	  
	  
	  var menuItem2 = new dijit.MenuItem({onClick: function(){   cp.attr('href', './jsp/wnd/sysImpl_right.jsp');  }});
	  menuItem2.setLabel("System Integration/Implementation");                      
	  menu.addChild(menuItem2);

	  var params = {
	                label: "SERVICES",
	                name: "mainMenu.services",
	                dropDown: menu,
	                id: "mainMenu.services"
	                };
	  var widget = new dijit.form.DropDownButton(params);
	  xtoolbar.addChild( widget );

	return widget;
	}

function createDDMenuSolutions(xtoolbar) {
	  var menu = new dijit.Menu({ });

	  menu.domNode.style.display="none";
	//  var menuItem1 = new dijit.MenuItem({
	//                       //   label: "Coaching Technology",
	//	  
	//	                   onClick: function(){ showView("SOA_In_A_Box", './jsp/wnd/Underc.jsp', '250px' );   }
	//                       //onClick: function() {window.open('http://www.soahpsi.com/archetypes/soainabox','SOA_In_A_Box',
	//                       //'left=20,top=20,width=800,height=500,scrollbars=1');}        
	  //                      });
	                 
	 
	 // var menuItem2 = new dijit.MenuItem({onClick: function(){  showInnoInABox(); }});
	 // menuItem2.setLabel("Innovation 'IN-A-BOX'");                      
	 // menu.addChild(menuItem2);

	  var surl = hpsiurl + "data/doc/SOA-MDM-Services-v4.0.pdf";
	  var menuItem3 = new dijit.MenuItem({		
		  onClick: function(){ var load = window.open(surl,'','scrollbars=no,menubar=no,height=600,width=800,resizable=yes,toolbar=no,location=no,status=no'); } //showView("SYNOPSIS", './jsp/wnd/docSynopsis.jsp', '250px' );   }
          //onClick: function() {window.open('http://www.soahpsi.com/archetypes/dwinabox','DW_In_A_Box',
          //'left=20,top=20,width=800,height=500,scrollbars=1');}        
           });
	  menuItem3.setLabel("Hybrid Solutions");                      
	  menu.addChild(menuItem3);
	  
	  var params = {
	                label: "SOLUTIONS",
	                name: "mainMenu.solutions",
	                dropDown: menu,
	                id: "mainMenu.solutions"
	                };
	  var widget = new dijit.form.DropDownButton(params);
	  xtoolbar.addChild( widget );

	return widget;
	}

function createDDMenuManagement(xtoolbar) {
  var menu = new dijit.Menu({ });

  menu.domNode.style.display="none";
  var menuItem1 = new dijit.MenuItem({
                       //   label: "Coaching Technology",
                       //onClick: function(){  cp.attr('href', './jsp/wnd/Management2.jsp');  }
  onClick:  function(){ showManagementView();}
                                 });
                 
  menuItem1.setLabel("Directors & Officers");  
  menu.addChild(menuItem1);

  var menuItem2 = new dijit.MenuItem({
	  //onClick: function(){   cp.attr('href', './jsp/wnd/BusSumm2.jsp');  }});
       onClick:  function(){ showView("Business Summary", './jsp/wnd/BusSumm2.jsp', '800px' ); } });
  menuItem2.setLabel("company profile");                      
  menu.addChild(menuItem2);

  
  var params = {
                label: "ABOUT US",
                name: "toolbar4.management",
                dropDown: menu,
                id: "toolbar4.management"
                };
  var widget = new dijit.form.DropDownButton(params);
  xtoolbar.addChild( widget );

return widget;
}
	
function createDDMenu(xtoolbar) {
  var menu = new dijit.Menu({ });

  menu.domNode.style.display="none";
  var menuItem1 = new dijit.MenuItem({
                       //   label: "Coaching Technology",
                       onClick: function(){   newVw('columnA', 'wnd/Cases.jsp');  }
                                 });
                 
  menuItem1.setLabel("Coaching Technology");  
  menu.addChild(menuItem1);

  var menuItem2 = new dijit.MenuItem({onClick: function(){   newVw('columnA', 'wnd/Underc.jsp');  }});
  menuItem2.setLabel("Enable SOA");                      
  menu.addChild(menuItem2);

  
  var params = {
                label: "case studies",
                name: "cases_stud",
                dropDown: menu,
                id: "cases_stud"
                };
  var widget = new dijit.form.DropDownButton(params);
  xtoolbar.addChild( widget );

return widget;
}

function createDDMenu2(xtoolbar) {
  var menu = new dijit.Menu({ });

  menu.domNode.style.display="none";
  var menuItem1 = new dijit.MenuItem({
                 onClick: function(){   newVw('columnA', 'wnd/Underc.jsp');}
                                 });
                 
  menuItem1.setLabel("Technical Leadership");  
  menu.addChild(menuItem1);

  var menuItem2 = new dijit.MenuItem({onClick: function(){   newVw('columnA', 'wnd/Underc.jsp');} });
  menuItem2.setLabel("System Integration");                      
  menu.addChild(menuItem2);

  var menuItem2 = new dijit.MenuItem({onClick: function(){   newVw('columnA', 'wnd/Underc.jsp');} });
  menuItem2.setLabel("Enterprise Architecture");                      
  menu.addChild(menuItem2);
  
  var params = {
                label: "services",
                name: "services",
                dropDown: menu,
                id: "services"
                };
  var widget = new dijit.form.DropDownButton(params);
  xtoolbar.addChild( widget );

return widget;
}


function initItemStoreGallery(){
alert("aalo");
			var itemRequest = {
				query: {},
				count: 20
			};
			var itemNameMap = {
				imageThumbAttr: "thumb",
				imageLargeAttr: "large"
			};
			
			//Set the dojo.data.ItemFileReadStore on two of the dojox.image.ThumbnailPicker widgets
			//Note the use of the 'itemNameMap', which tells the widget what attributes to
			//read from the store.  Look in the 'images.json' file in the same folder as this
			//file to see the data being read by the widget.
			dijit.byId('thumbPicker4').setDataStore(imageItemStore, itemRequest, itemNameMap);
		}

lastID = 0;

function SelectImg(id) {
if (lastID > 0) {
  document.getElementById(lastID).className = "thumbNormal";
  }
document.getElementById(id).className = "thumbSelected";
document.getElementById(0).src = document.getElementById(id).src;
lastID = id;
}


onDownload = function() {
  getDownLoadFile();  
  }


function getDownLoadFile() {
  alert("allo");
  window.open('servlet/UpDownFileServlet?TY=DWN','dwnpage','width=400,height=200');
/*
  //dojo.byId('dWTxt0').innerHTML = "";
  //dojo.byId('dWTxt1').innerHTML = "";
  //dojo.byId('dWTxt2').innerHTML = "";
  //dojo.byId('dWTxt3').innerHTML = "";
  //dojo.byId('dWTxt4').innerHTML = "";
//	    url: "servlet/UpDownFileServlet?UN=" + $('miuser').value + "&TY=DWN" ,
  dojo.io.iframe.send({
    url: "servlet/UpDownFileServlet?TY=DWN" ,
	method: "post",
	handleAs: "text/json",
	form: dojo.byId('dwnForm'),
	load: function(type, data,evt) {
		var foo = dojo.fromJson(type);
		//dojo.byId('dWTxt').innerHTML = foo.mess;
	    //dijit.byId('diagMess').show();
//        window.open('dwnpage.htm?' + "F=" + foo.mess,'_blank','width=400,height=200');

//alert(foo.status);
 //       if( foo.status == 0 ) {
          window.open('/xmimpact/servlet/FMSUploadServlet?TY=DWN&DWNF=' + foo.mess + "&UPD=" + upd,'dwnpage','width=400,height=200');
  //        }
  //      else {
   //       dojo.byId('dWTxt').innerHTML = foo.mess;
	//        dijit.byId('diagMess').show();
  //       }
			},			
	handle: function(type, data, evt) {		
	  dojo.byId('dWTxt').innerHTML = type.message;
    dijit.byId('diagMess').show();
	//alert(type.message + " allo erreur");		
			}
	});
*/
}


function emailContactForm(e) {
	 e.preventDefault();

var formobj =dijit.byId("contactForm");

  if(formobj.validate()) {		          
			   //var JSONString = dojo.toJson(this.attr("value"), true);
			      //window.alert(JSONString);
	//if( isEmailValid(formobj.attr("emailaddress")) == 0 ) {
	//	 window.alert("Invalid email address.");
	 //     return false;
	//  }
    var att_val = formobj.attr("value");		    
       
	sendMail(att_val);
    } else{
      window.alert("Invalid data, please correct your entries.");
      return;
    }
	
  formobj.reset();
  if( contactDialog != null) contactDialog.hide(); 
	//return true;
  }



/*String cny = request.getParameter("cny");
String name= request.getParameter("name");
String add = request.getParameter("add");
String city = request.getParameter("city");
String state = request.getParameter("st");
String zip = request.getParameter("zip");

String email = request.getParameter("email"); 

String purpose = request.getParameter("pur");
*/
function sendMail(att_val) { // 
	
    dojo.xhrGet( { // 
      // The following URL must match that used to test the server.
      url: "servlet/RequestFormServlet", 
      handleAs: "text",
      content: { "cny": att_val.ciename,
    			 "name": att_val.name,
    			 "add": att_val.address,
    			 "city":att_val.city,
    			 "st": att_val.state,
    			 "zip": att_val.zip,
    		     "email":att_val.emailaddress,
    	         "pur":att_val.purpose,
    	         "doc":att_val.doc
    	        },
      timeout: 120000, // Time in milliseconds
      ///sync: "true",
       // The LOAD function will be called on a successful response.
      load: function(response, ioArgs) { //
    	window.alert("Request Sent Successfully"); // + response);
       	//showEmailRequestMessage("<h2>Request Form<h2><br>Request Sent Successfully"); 
        return response; // 
      },

      // The ERROR function will be called in an error case.
      error: function(response, ioArgs) { // 
    	  if (ioArgs.xhr.status != null && ioArgs.xhr.status != 0) 
    	    window.alert("Request Failed, HTTP status code: ", ioArgs.xhr.status);
    	//showEmailRequestMessage("<h2>Request failed</h2> please try again later"); 
        console.error("HTTP status code: ", ioArgs.xhr.status); //
        //dojo.byId("replace").innerHTML = 'Loading the ressource from the server did not work'; //  
        return response; // 
        }
      });
    }

function showEmailRequestMessage(text){
	showDialogTwo(txt);
	//dijit.byId('toast').setContent(text,'message',10000);
   // dijit.byId('toast').show();	
}

function sendVisitorInfo() {
	   dojo.xhrGet( { // 
		      url: "servlet/VisitorServlet", 
		      handleAs: "json",
		      timeout: 120000, // Time in milliseconds
		      load: function(response, ioArgs) { //
	              return response; // 
		      },
		      error: function(response, ioArgs) { // 
		    	 // alert("error: " + ioArgs.xhr.status);
		    	//showEmailRequestMessage("<h2>Request failed</h2> please try again later"); 
		       // console.error("HTTP status code: ", ioArgs.xhr.status); //
		      
		        return response; // 
		        }
		      });	
}

function sendReqDoc(e) {
	 e.preventDefault();
	var formobj =dijit.byId("requestForm");

    if(formobj.validate()) {		          
	    var att_val = formobj.attr("value");	
	    att_val.doc = docReq;
	  
		sendMail(att_val);
	    docReq = "";
	    } else{
	      window.alert("Invalid data, please correct your entries.");
	      return;
	    }
		
	  formobj.reset();
	  if( contactDialog != null) contactDialog.hide(); 
}



function getTwitter() {
	
	
	//http://twitter.com/statuses/user_timeline.xml?screen_name=dougw
//	var deferred = dojox.io.windowName.send("GET", {url:"http://twitter.com/statuses/user_timeline.xml?screen_name=dougw"});
//	deferred.addCallback(function(result){
//	  alert("The request returned " + result);
//	});
	
	   dojo.xhrGet( { // 
		      url: "../servlet/HPSiTwitterServlet", 
		      handleAs: "json",
		      content: { "name": "xhpsi",
		   				 "co" : 5,
		   				 "type" : "json"
		    	        },
		      timeout: 120000, // Time in milliseconds
		      ///sync: "true",
		       // The LOAD function will be called on a successful response.
		      load: function(response, ioArgs) { //
		       
		    	//var JSONString = dojo.toJson(response, true);		    	
		    	//window.alert(JSONString);
		    	var l = response.length;	
		    	var result = "";
		    	for ( i =0; i < l; i++) {
		    		result += "<span style=" + "'font-weight:bold;'" + ">" + response[i].text + "</span><br>" + response[i].created_at.split("+",1) + "<br>" +  response[i].source + "<br><br>";
		    	}
		       	showEmailRequestMessage("<span style=" + "'font-weight:bold;'" + ">HPSi twitter</span><br><br>"+ result); 
		        return response; // 
		      },

		      // The ERROR function will be called in an error case.
		      error: function(response, ioArgs) { // 
		    	 // alert("error: " + ioArgs.xhr.status);
		    	showEmailRequestMessage("<h2>Request failed</h2> please try again later"); 
		        console.error("HTTP status code: ", ioArgs.xhr.status); //
		        //dojo.byId("replace").innerHTML = 'Loading the ressource from the server did not work'; //  
		        return response; // 
		        }
		      });	
		      
}

function showDialogTwo(txt) {
    secondDlg.attr("content",txt );
  //  secondDlg.attr("href" , "jsp/wnd/soa_.jsp" );
    secondDlg.show();
	 
}

function showContactView(title, jsppage, swidth) {

	showView(  title, jsppage, swidth);  
}



function showManagementView() {
	showView( "Management", "jsp/wnd/Management2.jsp", "600px" );
}

function showPartnershipView() {

	showView2( "Partnership", "jsp/wnd/Underc.jsp", 250,250 );
}

function showEmploymentView(jobfile) {
	showView( "Employment", "jsp/wnd/jobs/" + jobfile, "650px" );
}

function showInnoInABox() {
	showView( "Innovation IN-A-BOX", "jsp/wnd/Underc.jsp", "650px" );
}

function showInConstruction(title) {
	showView( title, "jsp/wnd/Underc.jsp", "650px" );
}

function showView(stitle, shref, nwidth ) {
	if( contactDialog == null) {
	  dojo.require("dijit.Dialog");
	  contactDialog = new dijit.Dialog({
             title: "Contact Us",
             content: ""
            	 ,
             style: "width: " + nwidth
             })

	}
	//contactDialog.attr("content", "Hey, I wasn't there before, I was added at " + new Date() + "!");
	contactDialog.attr("href" , shref );
	contactDialog.attr("title" , stitle );
	contactDialog.attr("style" , "width: " + nwidth );
	contactDialog.show();
  
}

function showView2x(stitle, shref, nwidth, nheight ) {
//	if( contactDialog == null) {
//		//dojo.require("dojox.widget.DialogSimple");
//	  dojo.require("dijit.Dialog");
//	  contactDialog = new dijit.Dialog({
//             title: "Contact Us",
//             content: ""
//            	 ,
//             style: "width: " + nwidth
//             })
//
//	}
//	
//	var stmp = " <div ><a href=\'http://www.fiorano.com/\' target=\'_blank\'><img src=\'images/partners/fiorano_logo.gif\' style=\'MARGIN: 12px 12px 12px 0px; WIDTH: 200px; FLOAT: left; HEIGHT: 58px\'/></a></div><div> </div><div class=\'TxtNormalwnd10\'>";
//	stmp +="<p>Founded in 1995, Silicon Valley based Fiorano is a California Corporation" +
//			" with proven leadership in enterprise middleware and peer-to-peer distributed systems. Fiorano" + "'" +
//			"s innovative event-driven, dataflow SOA platform integrates applications and complex technologies into an enterprise nervous system," +
//			" increases business process performance, yields higher message throughput and enhances availability through agent-based visual composition" +
//			" that bridges the capability gap between business models and their implementation - the model is the application, ready to run.</p>";
//    
//    stmp += "<p>Global leaders including Boeing, British Telecom, Capgemini Telecom, Chicago Mercantile Exchange Group, McKesson, NASA," +
//    		" Qwest Communications, Schlumberger, Lockheed Martin, United States Coast Guard and  have deployed Fiorano to drive innovation through open," +
//    		" standards-based, dataflow SOA applications built in just days, yielding unprecedented productivity.</p>";
//    stmp += "<p>Fiorano Enterprise Service Bus (ESB) and Fiorano Message Queue (MQ) deliver the industry fastest, lowest latency, highest" +
//    		" throughput real-time messaging (asynchronous and synchronous) to power high performance, highly available, and collaborative" +
//    		" workflow applications whose application services are distributed throughout the IT landscape.  Fiorano" + "'" +
//    		"s distributed, peer-to-peer agents abstract complexity of developing and deploying services to unlock value in a customer"+"'"+
//    		"s enterprise architecture framework. </div></p>";

//    <div>
//      <a href=\'http://www.talend.com/\' target=\'_blank\'><img src=\'images/partners/logo_talend.jpg\' style=\'MARGIN: 12px 12px 12px 0px; WIDTH: 179px; FLOAT: left; HEIGHT: 67px\'/></a>
//      </div>
//      <div> </div>
//      <div  class=\'TxtNormalwnd10\'>Talend is the first provider of open source data integration software. After three years of intense research and development, and with solid financial backing from leading investment firms, Talend revolutionized the world of data integration when it released the first version of Talend Open Studio in 2006.
//      <p>Talend's solutions are used primarily for migration and integration between operational systems, as well as for ETL (Extract, Transform, Load) for Business Intelligence and Data Warehousing. Unlike proprietary, closed solutions, which can only be afforded by the largest organizations, Talend makes enterprise-class data integration solutions affordable to organizations of all sizes.</p> </div><div> </div><div> </div>
//  ";
//	contactDialog.attr("content", stmp);
	
	var diag = dijit.byId('commomDlg2');
	diag.attr("href" , shref );
	diag.attr("title" , stitle );
//	diag.attr("style" , "width: " + nwidth + "; height:" + nheight );

	diag.show();
  
}


function showView2(stitle, shref, nwidth, nheight ) {
	if( initdiag == false) {
		// a programatic test:
		   //dojo.require("dojox.widget.Dialog");
			//dojo.require("dojo.fx.easing");

			var thinger = new dojox.widget.Dialog({
				showTitle:"true",
				//href: "jsp/wnd/partners.jsp",
				//title:"<h2 style=\'margin-top:0\'>Wow!</h2>",
				dimensions: [550,100],
				draggable:false,
				//easing: dojo.fx.easing.elasticOut,
				//sizeDuration:900,
				sizeMethod:"combine"
			},"commomDlg");
			thinger.startup();
			initdiag = true;
	}
	
	var obj = [nwidth,nheight ];
	
	var diag = dijit.byId('commomDlg');
	diag.attr("href" , shref );
	diag.attr("dimensions" , obj); 
	diag.attr("title" , stitle );
	
	//diag.set("dimensions", [400, 500]); // [width, height]
	//  diag.layout();
	diag.show()
}




function isEmailValid(sem) {
	   dojo.xhrGet( { // 
		      url: "../servlet/EmailValidatorServlet", 
		      handleAs: "json",
		      content: { "em": "xhpsi"
		    	        },
		      timeout: 120000, // Time in milliseconds
		      ///sync: "true",
		       // The LOAD function will be called on a successful response.
		      load: function(response, ioArgs) { //
		       
		    	var JSONString = dojo.toJson(response, true);		    	
		    	window.alert(JSONString);
		    	//var l = response.length;	
		    	//var result = "";
		    	//for ( i =0; i < l; i++) {
		    	//	result += "<span style=" + "'font-weight:bold;'" + ">" + response[i].text + "</span><br>" + response[i].created_at.split("+",1) + "<br>" +  response[i].source + "<br><br>";
		    	//}
		       	//showEmailRequestMessage("<span style=" + "'font-weight:bold;'" + ">HPSi twitter</span><br><br>"+ result); 
		        return response; // 
		      },

		      // The ERROR function will be called in an error case.
		      error: function(response, ioArgs) { // 
		    	 alert("error: " + ioArgs.xhr.status);
		    	//showEmailRequestMessage("<h2>Request failed</h2> please try again later"); 
		        console.error("HTTP status code: ", ioArgs.xhr.status); //
		        //dojo.byId("replace").innerHTML = 'Loading the ressource from the server did not work'; //  
		        return response; // 
		        }
		      });	
		      
}

///////////////////////////////// lightshow


var content = "<a href='images/site/stream/src/Slide1.jpg'  >1<a/>"  
	+ " | <a href='images/site/stream/src/Slide2.GIF'  >2</a>"
	+ " | <a href='images/site/stream/src/Slide3.GIF' >3</a>"
	+ " | <a href='images/site/stream/src/Slide4.GIF'  >4</a>"
	+ " | <a href='images/site/stream/src/Slide5.GIF'  >5</a>"
;
	
function lightHPSiShowHide(){
	elb.hide();
	
	}
function lightHPSiShow(){
	elb.show({
			title:content,
			href:"images/site/stream/src/Slide1.jpg"
		});
	}

var replacementText = "ALLO TOI"

text_blockfade_1 = function(node){
	if(node.style.height){
		return false;
	}
	var properties = {
		node: node,
		words: true
	};
	properties.onEnd = function(){
		
		currentAnimation = dojox.fx.text.blockFadeIn(dojo.mixin(properties, {
			onEnd: undefined,
			text: (replacementText && node.innerHTML != replacementText) ?
				replacementText : 
				originalText
		}));
		currentAnimation.play()
	};
	currentAnimation = dojox.fx.text.blockFadeOut(properties);
	currentAnimation.play();
};


