String.implement({parseCssString:function(value,divider){if(this.indexOf(value+divider)>-1){var cssArray;cssArray=this.split(" ");cssArrayLength=cssArray.length;for(z=0;z<cssArrayLength;z++){if(cssArray[z].indexOf(value+divider)>-1){var cssSelectorArray;cssSelectorArray=cssArray[z].split(divider);if(cssSelectorArray[0]==value){return cssSelectorArray[1];}}}}else{return null;}},trim:function(value,divider){return this.replace(/^\s+|\s+$/g,"");},parseURL:function(){return this.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&~\?\/.=]+/g,function(url){return url.link(url);});},parseUsername:function(){return this.replace(/[@]+[A-Za-z0-9-_]+/g,function(u){var username=u.replace("@","");return u.link("http://twitter.com/"+username);});},parseHashtag:function(){return this.replace(/[#]+[A-Za-z0-9-_]+/g,function(t){var tag=t.replace("#","%23");return t.link("http://search.twitter.com/search?q="+tag);});},getSegment:function(index,separator){var stringArray=this.split(separator);return stringArray[index];}});function fixPNG(myImage){if(Browser.Engine.trident4&&document.body.filters){var imgID=(myImage.id)?"id='"+myImage.id+"' ":"";var imgClass=(myImage.className)?"class='"+myImage.className+"' ":"";var imgTitle=(myImage.title)?"title='"+myImage.title+"' ":"title='"+myImage.alt+"' ";var imgStyle="display:inline-block;"+myImage.style.cssText;var strNewHTML="<span "+imgID+imgClass+imgTitle+' style="'+"width:"+myImage.width+"px; height:"+myImage.height+"px;"+imgStyle+";"+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"+"(src='"+myImage.src+"', sizingMethod='scale');\"></span>";myImage.outerHTML=strNewHTML;}}function recordOutboundLink(link,category,action){try{_gat._getTrackerByName()._trackEvent(category,action);}catch(error){}}function openSurvey(){var properties={width:700,height:460};properties.id="feedback-modal-wrapper";properties.title="eMeter.com Feedback";this.modal=new Modal($("surveyMonkeyInfo").get("html"),properties);this.modal.openModal();}MenuPress=new Class({Impliments:Options,options:{selectId:"menu-1-select",hiddenFieldPageName:"page-name"},initialize:function(options){this.selectObj=$(this.options.selectId);this.selectObj.addEvent("change",this.change.pass(this.selectObj,this));this.pageName=$(this.options.hiddenFieldPageName);var optionValueArray;if(this.pageName!=null){for(i=0;i<this.selectObj.options.length;i++){optionValueArray=this.selectObj.options[i].value.split("/");if(this.pageName.value==optionValueArray[(optionValueArray.length-1)]){this.selectObj.options[i].selected="selected";}}}optionValueArray=null;},change:function(selectObj){if(this.selectObj.options[this.selectObj.selectedIndex].value){window.location=this.selectObj.options[this.selectObj.selectedIndex].value;}}});ListCustomers=new Class({Extends:Request.JSON,options:{wrapper:"content-wrapper",noResults:'<div class="no-results" >Sorry. No customers are available in this category</div>',columns:5},initialize:function(options){this.parent(options);},onSuccess:function(json,text){var wrapper=$(this.options.wrapper);var dataLength=json.length;var cell=0;var i=0;var row=0;var classExtra="";var rows=dataLength/this.options.columns;var rowsRounded=Math.ceil(rows);if(dataLength===0){wrapper.set("html",this.options.noResults);return;}var htmlString='<ul class="customers-logo clearfix">';for(i=0;i<dataLength;i++){var classExtra="";classExtra=classExtra+"row-"+row+" ";classExtra=classExtra+"rowItem-"+cell+" ";classExtra=classExtra+"cell-"+i+" ";classExtra=classExtra+this.checkFirst(i,row);classExtra=classExtra+this.checkLast(i,(dataLength-1));classExtra=classExtra+this.checkBottom(row,(rowsRounded-1));classExtra=classExtra+this.checkCorner(cell,row,this.options.columns,rowsRounded,"left");classExtra=classExtra+this.checkCorner(cell,row,this.options.columns,rowsRounded,"right");htmlString=htmlString+'<li class="clearfix '+classExtra+' "><a href="'+json[i].customer_url+'" style="background:url('+json[i].customer_logo+') no-repeat;" ><span>'+json[i].customer_name+"</span></a></li>";if(cell===4){cell=0;row=row+1;}else{cell=cell+1;}}htmlString=htmlString+"</ul>";wrapper.set("html",htmlString);},checkFirst:function(i,row){if(i===0&&row===0){return"first"+" ";}return"";},checkLast:function(cell,length){if(cell==length){return"last"+" ";}return"";},checkBottom:function(row,total){if(row===total){return"bottom"+" ";}return"";},checkCorner:function(cell,row,columns,totalRows,xPostion){if(xPostion=="left"){if(cell===0&&row===(totalRows-1)){return"bottomLeftCorner"+" ";}}if(xPostion=="right"){if(cell===(columns-1)&&row===(totalRows-1)){return"bottomRightCorner"+" ";}}return"";}});MenuCustomers=new Class({Extends:ListCustomers,options:{anchorClassName:""},initialize:function(options){this.parent(options);this.hash=this.getHash(window.location.hash);this.anchorArray=$$(this.options.anchorClassName);this.url=this.options.url;for(i=0;i<this.anchorArray.length;i++){this.resetHref(this.anchorArray[i]);this.anchorArray[i].onclick=this.onclick.pass(this.anchorArray[i],this);}},onclick:function(link){this.options.url=this.url+this.getHash(link.get("href"));this.send();},getHash:function(hash){var hash=hash.split("#");if(0<hash.length){return hash[1];}return false;},resetHref:function(anchor){var hrefArray;hrefArray=anchor.get("href").split("/");hrefArray.shift();hrefArray.pop();anchor.set("href","/customers/#"+hrefArray[1]);hrefArray=null;return;}});LoadCustomers=new Class({Extends:ListCustomers,options:{anchorClassNames:{size:".sizeDropDownAnchor",type:".typeDropDownAnchor",service:".serviceDropDownAnchor"},type:"",value:""},initialize:function(options){this.parent(options);this.hash=this.getHash(window.location.hash);if(this.hash==null){return false;}if(!this.hash){return false;}if(this.hash===""){return false;}this.url=this.options.url;this.type="";this.sizeArray=$$(this.options.anchorClassNames.size);this.typeArray=$$(this.options.anchorClassNames.type);this.serviceArray=$$(this.options.anchorClassNames.service);for(i=0;i<this.sizeArray.length;i++){if(this.sizeArray[i].get("href").indexOf(this.hash)>-1){this.type="size";}}for(i=0;i<this.typeArray.length;i++){if(this.typeArray[i].get("href").indexOf(this.hash)>-1){this.type="type";}}for(i=0;i<this.serviceArray.length;i++){if(this.serviceArray[i].get("href").indexOf(this.hash)>-1){this.type="service";}}this.options.url=this.url+this.type+"/"+this.hash;this.send();},getHash:function(hash){var hash=hash.split("#");if(0<hash.length){return hash[1];}return;}});CustomerVideoPanel=new Class({Implements:Options,options:{index:0},initialize:function(videoData,options){this.setOptions(options);this.data=videoData;},getHtml:function(){if(this.data.length===0){return;}this.wrapper=new Element("div",{id:"customer-videos","class":"clearfix"});this.billboard=new Element("div",{id:"customer-videos-hero","class":"clearfix center"});this.billboard.adopt(this.data[this.options.index].swiff);this.wrapper.adopt(this.billboard);if(this.data.length>1){this.navigation=new Element("div",{id:"customer-videos-nav-wrapper","class":"clearfix"});this.wrapper.adopt(this.navigation);this.navigation.ul=new Element("ul",{id:"customer-videos-nav-ul","class":"clearfix"});this.navigation.adopt(this.navigation.ul);for(i=0;i<this.data.length;i++){this.data[i].anchor.onclick=this.onclick.pass(this.data[i].anchor,this);li=new Element("li",{"class":"clearfix center"});this.data[i].anchor.adopt(this.data[i].thumbnail);li.adopt(this.data[i].anchor);li.inject(this.navigation.ul);}}this.wrapper.inject($("customer-content-wrapper"),"top");},onclick:function(link){this.billboard.set("html","");var swif=this.data[parseFloat(link.get("name").replace("video-",""))].swiff;swif.inject(this.billboard);return false;}});formValidation=new Class({Implements:Options,options:{length:0,index:0},initialize:function(options){this.setOptions(options);this.wrappers=$$(".mktFormReq");this.fields=$$(".mktFReq");this.restrictEmail=new Array("yahoo.com","gmail.com","msn.com","aol.com","hotmail.com","optimussolutions.com","siriuscom.com","cox.net","sbcglobal.net","yahoo.com","yahoo.fr","yahoo.de","yahoo.uk","mail.aim.com","us.logicalis.com","yahoo.co.jp","yahoo.co.in","yahoo.com.br","yahoo.com.cn","yahoo.ca","fastmail.com","championsg.com","yahoo.com.au","yahoo.co.jp","yahoo.co.in","yahoo.com.br","yahoo.com.cn","hushmail.com","yahoo.ca","yahoo.com.au","rediffmail.com","ymail.com","test.com","invalid-email.com");this.regEmail=/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/;$each(this.fields,function(field){var fieldWrapper=field.getParents("li");if((field.tagName.toLowerCase()=="input"&&field.type.toLowerCase()=="text")||(field.tagName.toLowerCase()=="select")){if(field.hasClass("mktFReq")){field.onblur=this.onblur.pass(field,this);}}if(field.tagName.toLowerCase()=="input"&&field.type.toLowerCase()=="checkbox"){}},this);if($("mktFrmSubmit")!=null){$("mktFrmSubmit").onclick=this.onclick.pass($("mktFrmSubmit"),this);}},onblur:function(element){if(element.tagName.toLowerCase()=="select"){if(element.selectedIndex==0){this.setError(element,true);return;}else{this.setError(element,false);return;}}else{if(element.value.length<1){this.setError(element,true);return;}else{this.setError(element,false);}if(element.getProperty("name").toLowerCase()=="email"){if(!element.value.toLowerCase().match(this.regEmail)){this.setError(element,true);return;}}}this.setError(element,false);},onclick:function(element){var error=0;for(i=0;i<this.fields.length;i++){if(this.fields[i].tagName.toLowerCase()=="select"){if(this.fields[i].hasClass("mktFReq")){if(this.fields[i].selectedIndex==0){this.setError(this.fields[i],true);error=error+1;}else{this.setError(this.fields[i],false);}}}else{if(this.fields[i].hasClass("mktFReq")){if(this.fields[i].value.length<1){this.setError(this.fields[i],true);error=error+1;}else{this.setError(this.fields[i],false);}}}}if(error===0){return;}else{return false;}return false;},setError:function(element,state){if(state===true){if(!$(element).hasClass("error")){$(element).addClass("error");}}else{if($(element).hasClass("error")){$(element).removeClass("error");}}}});Modal=new Class({Implements:[Events,Options],options:{id:"",title:"",height:450,width:714,left:0,top:0,zindex:400,state:0},initialize:function(content,options){this.setOptions(options);if(this.options.id===""){this.options.id=$$("modal-wrapper").length;}if(typeof(content)=="object"){this.content=content;}else{if(typeof(content)=="string"){this.content=new Element("div",{"html":content});}else{this.content=new Element("div");}}if(this.content.get("tag")=="iframe"){this.content.set("id",("modal-content-iframe-"+this.options.id));this.content.set("class",("modal-content-iframe"));}else{this.content.set("id",("modal-content-div-"+this.options.id));this.content.set("class",("modal-content-div"));}if(this.options.title.length>50){sentanceTemp=this.options.title.substr(0,80);sentanceArray=sentanceTemp.split(" ");sentanceArray=sentanceArray.slice(0,(sentanceArray.length-2));this.options.title=sentanceArray.join(" ")+"&#8230";}this.modalWrapper=new Element("div",{"class":"modal-wrapper","id":("modal-wrapper-"+this.options.id)});this.modalInner=new Element("div",{"class":"modal-inner","id":("modal-inner-"+this.options.id),styles:{"height":((this.options.height-2)+"px")}});this.modalHeader=new Element("div",{"class":"modal-header","id":("modal-header-"+this.options.id)});this.modalClose=new Element("div",{"class":"modal-close","id":("modal-close-"+this.options.id)});this.modalCloseImg=new Element("img",{"src":"/i/buttons/modal-close.png","id":("modal-close-img-"+this.options.id),"alt":"close","width":"16","height":"16","border":"0"});this.modalTitle=new Element("h3",{"class":"modal-title","id":("modal-title-"+this.options.id),"html":this.options.title});this.modalContent=new Element("div",{"class":"modal-content","id":("modal-content-"+this.options.id),styles:{"height":((this.options.height-52)+"px")}});this.modalContentInner=new Element("div",{"class":"modal-content-inner","id":("modal-content-inner-"+this.options.id)});this.modalFooter=new Element("div",{"class":"modal-footer","id":("modal-footer-"+this.options.id)});this.modalCloseImg.onclick=this.closeModal.pass(this);this.modalInner.inject(this.modalWrapper);this.modalHeader.inject(this.modalInner);this.modalClose.inject(this.modalHeader);this.modalCloseImg.inject(this.modalClose);this.modalTitle.inject(this.modalHeader);this.modalContent.inject(this.modalInner);this.modalContentInner.inject(this.modalContent);this.content.inject(this.modalContentInner);this.modalFooter.inject(this.modalInner);this.modalWrapper.setStyle("height",this.options.height);this.modalWrapper.setStyle("width",this.options.width);this.modalWrapper.setStyle("z-index",this.options.zindex);this.modalInner.setStyle("height",(this.options.height-2));this.modalContentInner.setStyle("height",(this.options.height-52));this.content.setStyle("height",(this.options.height-52));},openModal:function(){this.modalWrapper.inject($(document.body));this.modalWrapper.setStyle("display","block");this.center();this.modalWrapper.setStyle("visibility","visible");this.options.state=1;},closeModal:function(modal){if(modal==null){this.options.state=0;$(this.modalWrapper).destroy();}else{modal.options.state=0;$(modal.modalWrapper).destroy();}},center:function(){var dimensions=$(document.body).getCoordinates();var top=window.getScroll().y+(window.getSize().y*0.5)-(this.modalWrapper.offsetHeight*0.5);var left=(dimensions.width*0.5)-(this.modalWrapper.offsetWidth*0.5);this.modalWrapper.setStyles({"top":top,"left":left});}});ModalIframe=new Class({Extends:Modal,initialize:function(src,options){var iframe=new Element("iframe",{"src":src,"class":"modal-iframe","id":("modal-iframe"),"name":("modal-iframe"),"marginwidth":0,"marginheight":0,"frameborder":0,"scrolling":"auto"});this.parent(iframe,options);}});Tabs=new Class({Implements:[Events,Options],options:{previous:0,index:0,wrapper:{"class":"tabs-wrapper"},tabs:{"class":"tabs","active":"active"},regions:{"class":"tabRegion","active":"tabActive"}},initialize:function(options){this.setOptions(options);var pageUrl=new URI(document.URL);this.index=this.options.index;this.wrapper=$$("."+this.options.wrapper["class"]);if(this.wrapper.length<1){return false;}this.navigation=this.wrapper[0].getElement("."+this.options.tabs["class"]);this.tabs=this.navigation.getElements("li");this.tabAnchors=this.navigation.getElements("a");this.regions=$$("."+this.options.regions["class"]);this.bookmark="";this.length=this.tabs.length;if(pageUrl.get("fragment")){this.bookmark=pageUrl.get("fragment");for(i=0;i<this.length;i++){if(this.tabAnchors[i].get("id")==this.bookmark){this.index=i;}}}this.tabs[this.index].addClass(this.options.tabs.active);this.regions[this.index].addClass(this.options.regions.active);for(i=0;i<this.length;i++){this.tabAnchors[i].addClass("tab-"+i);this.tabAnchors[i].onclick=this.onclick.pass(this.tabAnchors[i],this);}},onclick:function(link){this.tabs[this.index].removeClass(this.options.tabs.active);this.regions[this.index].removeClass(this.options.regions.active);var index=link.get("class").parseCssString("tab","-");this.tabs[index].addClass(this.options.tabs.active);this.regions[index].addClass(this.options.regions.active);this.index=index;}});ReSizeParentHeight=new Class({initialize:function(selector){var elementsArray=$$(selector);var elementsLength=elementsArray.length;if(elementsLength>0){for(i=0;i<elementsLength;i++){this.resize(elementsArray[i]);}}},resize:function(element){var parentElement=element.getParent();parentSize=parentElement.getSize();element.setStyle("height",parentSize.y);return;}});window.addEvent("domready",function(){var menu=$$("a.menu-0-a");var pageUrl=new URI(document.URL);for(i=0;i<menu.length;i++){var menuUrl=new URI(menu[i].get("href"));if(pageUrl.get("directory").getSegment(1,"/")==menuUrl.get("directory").getSegment(1,"/")){menu[i].addClass("selected");}}if($("template")!=null){if($("template").get("value")=="page-0-customers-home"){var menuCustomerBySize=new MenuCustomers({"anchorClassName":".sizeDropDownAnchor","url":"/api/index.php/customers/size/"});var menuCustomerByType=new MenuCustomers({"anchorClassName":".typeDropDownAnchor","url":"/api/index.php/customers/type/"});var menuCustomerByService=new MenuCustomers({"anchorClassName":".serviceDropDownAnchor","url":"/api/index.php/customers/service/"});var loadCustomers=new LoadCustomers({"url":"/api/index.php/customers/"});}}$$(".model-anchor").each(function(element){element.addEvent("click",function(e){new Event(e).stop();var width=640;var height=400;if(this.getProperty("class").indexOf("width-")>-1){width=parseInt(this.getProperty("class").parseCssString("width","-"));}if(this.getProperty("class").indexOf("height-")>-1){height=parseInt(this.getProperty("class").parseCssString("height","-"));}var properties={width:width,height:height};if(this.getProperty("id")){properties.id=this.getProperty("id")+"-modal-wrapper";}if(this.getProperty("title")){properties.title=this.getProperty("title");}this.modal=new ModalIframe(this.get("href"),properties);this.modal.openModal();});},this);$$(".hp-feed-header").each(function(element){element.addEvent("click",function(e){new Event(e).stop();if(this.get("html")==="Press"){var jsonRequest=new Request.JSON({url:"/api/index.php/press/latest/4/",onSuccess:function(data){var htmlString="<ul>";var className;for(i=0;i<data.length;i++){if(i%2==0){className="row-0";}else{className="row-1";}htmlString=htmlString+'<li class="'+className+'"><a href="'+data[i]["href"]+'" >'+data[i]["post_title"]+'</a><div class="datetime">'+data[i]["date_publication_simple"]+"</div></li>";}htmlString=htmlString+'<li><a href="/company/news/" class="more">More press articles &rsaquo;</a></li>';htmlString=htmlString+"</ul>";$("hp-feed-wrapper").empty();$("hp-feed-wrapper").set("html",htmlString);}}).send();}if(this.get("html")==="Smart Grid Watch Blog"){var jsonRequest=new Request.JSON({url:"/api/index.php/blog/latest/4/",onSuccess:function(data){var htmlString="<ul>";var className;for(i=0;i<data.length;i++){if(i%2==0){className="row-0";}else{className="row-1";}htmlString=htmlString+'<li class="'+className+'"><a href="'+data[i]["href"]+'" >'+data[i]["post_title"]+'</a><div class="datetime">'+data[i]["post_date_simple"]+"</div></li>";}htmlString=htmlString+'<li><a href="/smart-grid-watch/" class="more">More blog articles &rsaquo;</a></li>';htmlString=htmlString+"</ul>";$("hp-feed-wrapper").empty();$("hp-feed-wrapper").set("html",htmlString);}}).send();}$$(".hp-feed-header-wrapper a.active").each(function(element){element.removeClass("active");});this.set("class","active");});});var resize=new ReSizeParentHeight(".height-100");var tabs=new Tabs();var surveyMonkeyInfo=$("surveyMonkeyInfo");if(surveyMonkeyInfo!=null){var iframeArray=surveyMonkeyInfo.getChildren("iframe");if(iframeArray.length>0){var feedbackButton=new Element("div",{"class":"feedback-wrapper",events:{click:function(){openSurvey();}}});feedbackButton.inject($$("body")[0]);}}});
