
function isEmail(s){var regex=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;return regex.test(s);}
function isEmpty(s){s=trim(s);return((s==null)||(s.length==0))}
function trim(b){var i=0;while(b.charAt(i)==" "){i++;}
b=b.substring(i,b.length);len=b.length-1;while(b.charAt(len)==" "){len--;}
b=b.substring(0,len+1);return b;}
function redirectBrowser(url){window.location=url;}
function openChatWindow(url,width,height){if(!width)
width=380;if(!height)
height=550;leftVal=(screen.width-width)/2;topVal=(screen.height-height)/2;chatWin=window.open(url,'','scrollbars=0,resizable=0,width='+width+'height='+height+',left='+leftVal+',top='+topVal);resizeWindow(chatWin,width,height);}
function resizeWindow(win,w,h){if(parseInt(navigator.appVersion)>3){if(navigator.appName=="Netscape"){win.outerWidth=w;win.outerHeight=h;}
else win.resizeTo(w,h);}}
function resizeWindow_old(win,width,height){if(window.innerWidth){iWidth=window.innerWidth;iHeight=window.innerHeight;}else{iWidth=document.body.clientWidth;iHeight=document.body.clientHeight;}
iWidth=width-iWidth;alert(iWidth);iHeight=height-iHeight;win.resizeBy(iWidth,iHeight);win.focus();};function hidestatus(win){win.status=''
return true}
function hideWindowStatus(win){if(win.document.layers)
win.document.captureEvents(Event.MOUSEOVER|Event.MOUSEOUT)
win.document.onmouseover=hidestatus
win.document.onmouseout=hidestatus}
function openChatWindowVisitor()
{var width=375;var height=600;var url="livesupport/visitor/";leftVal=(screen.width-width)/2;topVal=(screen.height-height)/2;chatWin1=window.open(url,'','location=0,scrollbars=0,resizable=0,width='+width+'height='+height+',left='+leftVal+',top='+topVal);resizeWindow(chatWin1,width,height);}
var contentWin;function winShow(){if(contentWin!=null){return false;}else{contentWin=new Window('Get2Chat',{className:"alphacube",title:"Live Chat - WebDesignOffice.us",right:0,bottom:0,width:365,height:500,url:"visitor/",draggable:true,maximizable:false,opacity:1,closable:true,maxWidth:365,destroyOnClose:true,maxHeight:520})
contentWin.setConstraint(true,{left:5,right:5,top:30,bottom:10});contentWin.show();myObserver={onDestroy:function(eventName,win){if(win==contentWin){contentWin=null;Windows.removeObserver(this);}}};Windows.addObserver(myObserver);}}
