String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"");}
String.prototype.capitalize=function(){return this.replace(/^\w/,function($0){return $0.toUpperCase();})}
function hasEmailFormat(email){var emailReg=/^[a-z][a-z-_0-9\.]+@[a-z-_=>0-9\.]+\.[a-z]{2,3}$/i;return emailReg.test(email);}
function confirmAction(message,url){if(confirm(message)){window.location.href=url;}}
function popUp(desktopURL,ancho,alto,resizable,scrollbars,target){var x=parseInt((window.screen.width-ancho)/2);var y=parseInt((window.screen.height-alto)/2);var desktop=window.open(desktopURL,target,"left="+x+",top="+y+",width="+ancho+",height="+alto+",scrollbars="+scrollbars+",resizable="+resizable+"");}
function permutImage(flag,img){if(document.images){if(document.images[img].permloaded){if(flag==1){document.images[img].src=document.images[img].perm.src;}else{document.images[img].src=document.images[img].perm.oldsrc;}}}}
function preLoadPermut(img,src){if(document.images){img.onload=null;img.perm=new Image();img.perm.oldsrc=img.src;img.perm.src=src;img.permloaded=true;}}
function initAjax(){var xmlHttp;try{xmlHttp=new XMLHttpRequest();}
catch(e){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e){return false;}}}
return xmlHttp;}
function setCookie(name,value,expires,path,domain,secure){var today=new Date();today.setTime(today.getTime());if(expires){expires=expires*1000*60*60*24;}
var expires_date=new Date(today.getTime()+(expires));document.cookie=name+"="+escape(value)+
((expires)?";expires="+expires_date.toGMTString():"")+
((path)?";path="+path:"")+
((domain)?";domain="+domain:"")+
((secure)?";secure":"");}
function getCookie(check_name){var a_all_cookies=document.cookie.split(';');var a_temp_cookie='';var cookie_name='';var cookie_value='';var b_cookie_found=false;for(i=0;i<a_all_cookies.length;i++){a_temp_cookie=a_all_cookies[i].split('=');cookie_name=a_temp_cookie[0].replace(/^\s+|\s+$/g,'');if(cookie_name==check_name){b_cookie_found=true;cookie_value=unescape(a_temp_cookie[1].replace(/^\s+|\s+$/g,''));return cookie_value;break;}
a_temp_cookie=null;cookie_name='';}
if(!b_cookie_found){return null;}}
function isMSIE(){return(navigator.appName=="Microsoft Internet Explorer"?true:false);}
var Denko={redirect:function(url){document.location.href=url;}}
