var popWidth=700; var popHeight=300; function confirmDelete(href) { if(confirm("Are you sure you want to delete?")) { window.location=href; return true; } } function confirmed(href) { if(confirm("Are you sure?")) { window.location=href; return true; } } /* this function is not likely to be used so it is commented. please use openPopWin function openNewWin(url,winName,features ) { window.open(url,winName,features); } */ function closeWin() { window.close(); } function autoCloseWin(message) { alert (message); setTimeout("closeWin()",5000); } function reloadParentWin() { window.opener.location.reload(); } var win = null; function NewWindow(mypage,myname,w,h,scroll){ LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=no' win = window.open(mypage,myname,settings) } function openPopWin(url,winName, winHeight) { if(winHeight>0) popHeight=winHeight; NewWindow(url,winName, popWidth , popHeight , 'yes'); } function openEditor(code,siteCode) { var url; url ="EDITOR_URL?code=" + code + "&siteCode="+ siteCode; openPopWin(url,'Editor', popHeight); } function test(str) { alert(str); } function unSubscribe(href) { if(confirm("Are you sure you want to unsubscribe?")) { window.location=href; return true; } } function openHelpWin(url) { NewWindow(url,'Help', 400 , 200 , 'yes'); window.active="Help"; } //******************************* leftTrim() *************************************// function leftTrim(str) { len = str.length; count = 0; for(i=0;i=0 && (str.charAt(i)==" " || str.charAt(i)=="\r" || str.charAt(i)=="\n");i--) count++; str = str.substr(0,len-count); return str; } //******************************* trim() *************************************// function trim(str) { str = leftTrim(str); str = rightTrim(str); return str; }