function getURL( url, type ) { switch( type || '_blank' ) { case "_blank": window.open( url ); break; case "_self": window.location = url; break; default: // nothing } }